Re: Moving cursor to start of current word

2008-08-27 Fir de Conversatie Andy Wokula
Andy Wokula schrieb: > Robert Webb schrieb: :silent! normal! heb >>> Won't work if the word is a single character. >> Also won't work at the start of this text: "== blah". >> The idea is to put the cursor at the start of the word that >> expand("") would return. >> >> This works quite

Re: Moving cursor to start of current word

2008-08-26 Fir de Conversatie Andy Wokula
Robert Webb schrieb: >>>:silent! normal! heb >> Won't work if the word is a single character. > > Also won't work at the start of this text: "== blah". > The idea is to put the cursor at the start of the word that > expand("") would return. > > This works quite well: > > func! Sow() >

RE: Moving cursor to start of current word

2008-08-26 Fir de Conversatie Robert Webb
I wrote: > This works quite well: > > func! Sow() > if (getline(".")[col(".") - 1] =~ '\k') > normal wb > else > call search('\<', 'sW') > endif > endfunc Or even better: func! StartOfWord() call search('.\>', 'cWs') call search('\<', 'cWb') endfunc Rob. -- R

RE: Moving cursor to start of current word

2008-08-25 Fir de Conversatie Robert Webb
> >:silent! normal! heb > > Won't work if the word is a single character. Also won't work at the start of this text: "== blah". The idea is to put the cursor at the start of the word that expand("") would return. This works quite well: func! Sow() if (getline(".")[col(".") - 1] =~ '

Re: Moving cursor to start of current word

2008-08-24 Fir de Conversatie Tony Mechelynck
On 24/08/08 22:57, Fredrik Gustafsson wrote: > On Sun, Aug 24, 2008 at 09:14:25PM +0200, Tony Mechelynck wrote: >> On 24/08/08 08:01, Robert Webb wrote: >>> Tony Mechelynck wrote: >>> > What's the simplest way to move the cursor to the start of > the word under it? > "Under it" include

Re: Moving cursor to start of current word

2008-08-24 Fir de Conversatie Fredrik Gustafsson
On Sun, Aug 24, 2008 at 09:14:25PM +0200, Tony Mechelynck wrote: > > On 24/08/08 08:01, Robert Webb wrote: > > Tony Mechelynck wrote: > > > >>> What's the simplest way to move the cursor to the start of > >>> the word under it? > >>> "Under it" includes the word after the cursor if there's no > >

Re: Moving cursor to start of current word

2008-08-24 Fir de Conversatie Peter Prohaska
On Sun, Aug 24, 2008 at 21:14, Tony Mechelynck <[EMAIL PROTECTED]> wrote: > What about eb then? (forward to end of word, then back to begin of > word). Hm, this works when in the space between words, but not when on > the last letter of a word. OK: heb (left one, right to end of word, left > to be

Re: Moving cursor to start of current word

2008-08-24 Fir de Conversatie Tony Mechelynck
On 24/08/08 08:01, Robert Webb wrote: > Tony Mechelynck wrote: > >>> What's the simplest way to move the cursor to the start of >>> the word under it? >>> "Under it" includes the word after the cursor if there's no >>> identifier under it. >> ... >> viw`< > > Won't work if cursor is in the sp

Re: Moving cursor to start of current word

2008-08-24 Fir de Conversatie Andy Wokula
Robert Webb schrieb: > Here's what seems like a really stupid question: > > What's the simplest way to move the cursor to the start of the word under > it? > "Under it" includes the word after the cursor if there's no identifier under > it. > > None of these quite work: > > b - The obvious choice,

RE: Moving cursor to start of current word

2008-08-23 Fir de Conversatie Robert Webb
Tony Mechelynck wrote: > > What's the simplest way to move the cursor to the start of > > the word under it? > > "Under it" includes the word after the cursor if there's no > > identifier under it. > ... > viw`< Won't work if cursor is in the space before the word. Weird actually how all

Re: Moving cursor to start of current word

2008-08-23 Fir de Conversatie Tony Mechelynck
On 24/08/08 06:56, Robert Webb wrote: > Here's what seems like a really stupid question: > > What's the simplest way to move the cursor to the start of the word under > it? > "Under it" includes the word after the cursor if there's no identifier under > it. > > None of these quite work: > > b - Th

Moving cursor to start of current word

2008-08-23 Fir de Conversatie Robert Webb
Here's what seems like a really stupid question: What's the simplest way to move the cursor to the start of the word under it? "Under it" includes the word after the cursor if there's no identifier under it. None of these quite work: b - The obvious choice, but won't work if the cursor is alrea