viw / how to select a one char word ?

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

viw / how to select a one char word ?

M Kelly
Hi,

Is there a way to select a one char word ?
lbve or viw or ?  All my attempts seem to continue on to the beginning (or end) of the next word.
Is it that a 'word' cannot be a single char ?

thx for everything vim,
-m

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/b72be123-6911-49bb-bae5-feae15f173a4%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: viw / how to select a one char word ?

Tony Mechelynck
On Mon, Feb 3, 2020 at 12:17 PM M Kelly <[hidden email]> wrote:
>
> Hi,
>
> Is there a way to select a one char word ?
> lbve or viw or ?  All my attempts seem to continue on to the beginning (or end) of the next word.
> Is it that a 'word' cannot be a single char ?
>
> thx for everything vim,
> -m

When I do viw with the cursor on a one-letter word, that one-letter
word becomes visually selected. What is 'selection' set to? (":verbose
set sel?" will tell you the value and — if other than by default or
from the keyboard — where it was set.)

My vimrc includes the following, BTW:
" :behave tonymec
if exists('+selectmode')
  set slm=mouse,key
endif
if exists('+mousemodel')
  set mousemodel=popup
endif
if exists('+keymodel')
  set keymodel=startsel
endif
if exists('+selection')
  set selection=inclusive
endif

Best regards,
Tony.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXtR31gAn1ohJ2QwZ6uzwFkmjZGrFp%2B1qiuVe8RVFTceyw%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: viw / how to select a one char word ?

M Kelly
Tony, hi

I have 

selection=inclusive.

For me, if there is a sentence -

 a few words

and my cursor is on the 'a' and I am in normal mode and I press 'viw'
I get 'a f' visually highlighted/selected.  

It must be some plugin / mapping then, sorry.  I just tried again with -

vim -u NONE

and now 'viw' will only include the 'a' - although the cursor does not change color indicating the selection.

I am very curious where/how this is altered and will have to dig through my .vimrc and plugins.

thx again for your help,
mark

On Monday, February 3, 2020 at 6:33:16 AM UTC-5, Tony Mechelynck wrote:
On Mon, Feb 3, 2020 at 12:17 PM M Kelly <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="ImLpLii-EwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mckel...@...> wrote:
>
> Hi,
>
> Is there a way to select a one char word ?
> lbve or viw or ?  All my attempts seem to continue on to the beginning (or end) of the next word.
> Is it that a 'word' cannot be a single char ?
>
> thx for everything vim,
> -m

When I do viw with the cursor on a one-letter word, that one-letter
word becomes visually selected. What is 'selection' set to? (":verbose
set sel?" will tell you the value and — if other than by default or
from the keyboard — where it was set.)

My vimrc includes the following, BTW:
" :behave tonymec
if exists('+selectmode')
  set slm=mouse,key
endif
if exists('+mousemodel')
  set mousemodel=popup
endif
if exists('+keymodel')
  set keymodel=startsel
endif
if exists('+selection')
  set selection=inclusive
endif

Best regards,
Tony.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/6999c838-0779-4fc2-bada-a6dd2a56a649%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: viw / how to select a one char word ?

Boyko Bantchev
In reply to this post by M Kelly
On Mon, 3 Feb 2020 at 13:16, M Kelly <[hidden email]> wrote:
>
> Hi,
>
> Is there a way to select a one char word ?
> lbve or viw or ?  All my attempts seem to continue on to the beginning (or end) of the next word.
> Is it that a 'word' cannot be a single char ?

If you are in a normal mode, typing ‘v’ (visually) selects the
character under the cursor.
Then, typing ‘y’ will yank that character (and take you back to the
normal mode).
Or instead, type ‘yl’ to the same end.
Either way you will have the character stored in the unnamed register.
Is this what you need?

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CALdOZq%3D7L4U0QubvnCHkH7fLe9U3An7ipr%2BsOVbHvrim4cL01w%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: viw / how to select a one char word ?

M Kelly
Hi,

Yes, thanks.
I was looking for a consistent way to select the whole word the cursor is on, no matter how many chars it is.
This could then become a new mapping or mouse double-click etc.

It seems viw, vaw, lbve are all good and work most of the time, but I cannot seem to find one set of cmds that always works.
It is also weird the difference between my vim and with -u NONE about the viw.

thx,
-m

On Monday, February 3, 2020 at 6:55:32 AM UTC-5, Boyko Bantchev wrote:
On Mon, 3 Feb 2020 at 13:16, M Kelly <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="c166Xl-_EwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mckel...@...> wrote:
>
> Hi,
>
> Is there a way to select a one char word ?
> lbve or viw or ?  All my attempts seem to continue on to the beginning (or end) of the next word.
> Is it that a 'word' cannot be a single char ?

If you are in a normal mode, typing ‘v’ (visually) selects the
character under the cursor.
Then, typing ‘y’ will yank that character (and take you back to the
normal mode).
Or instead, type ‘yl’ to the same end.
Either way you will have the character stored in the unnamed register.
Is this what you need?

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/58a6756f-9851-4f5a-bf6d-f6094c333b92%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: viw / how to select a one char word ?

M Kelly
Hi,

ok I found my error and fixed it. It was in a bad vmap I had for iw
Thank you all, as always, for the info.
Now I think 'viw' works well for me in all cases :-)
I wish the one char word, when selected, changed colour but not a problem.

take care,
-m

On Monday, February 3, 2020 at 7:03:18 AM UTC-5, M Kelly wrote:
Hi,

Yes, thanks.
I was looking for a consistent way to select the whole word the cursor is on, no matter how many chars it is.
This could then become a new mapping or mouse double-click etc.

It seems viw, vaw, lbve are all good and work most of the time, but I cannot seem to find one set of cmds that always works.
It is also weird the difference between my vim and with -u NONE about the viw.

thx,
-m

On Monday, February 3, 2020 at 6:55:32 AM UTC-5, Boyko Bantchev wrote:
On Mon, 3 Feb 2020 at 13:16, M Kelly <[hidden email]> wrote:
>
> Hi,
>
> Is there a way to select a one char word ?
> lbve or viw or ?  All my attempts seem to continue on to the beginning (or end) of the next word.
> Is it that a 'word' cannot be a single char ?

If you are in a normal mode, typing ‘v’ (visually) selects the
character under the cursor.
Then, typing ‘y’ will yank that character (and take you back to the
normal mode).
Or instead, type ‘yl’ to the same end.
Either way you will have the character stored in the unnamed register.
Is this what you need?

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/cd2c245d-5af3-4d74-b211-b414828f3242%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: viw / how to select a one char word ?

Tony Mechelynck
On Mon, Feb 3, 2020 at 2:33 PM M Kelly <[hidden email]> wrote:
>
> Hi,
>
> ok I found my error and fixed it. It was in a bad vmap I had for iw
> Thank you all, as always, for the info.
> Now I think 'viw' works well for me in all cases :-)
> I wish the one char word, when selected, changed colour but not a problem.

In my gvim the one-character visually selected word's Visual highlight
is visible during the "off" phase of the blinking cursor; and with
'showcmd' on the number of characters (and bytes, if different) in the
selection is displayed near bottom right of the Vim screen.

Best regards,
Tony.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXshS6ieJbcdy6j5VnrBqd4AOhauEuY5x_sqMa-_b8Z1yQ%40mail.gmail.com.
BPJ
Reply | Threaded
Open this post in threaded view
|

Re: viw / how to select a one char word ?

BPJ
In reply to this post by M Kelly


Den mån 3 feb. 2020 12:17M Kelly <[hidden email]> skrev:
Hi,

Is there a way to select a one char word ?
lbve or viw or ?  All my attempts seem to continue on to the beginning (or end) of the next word.
Is it that a 'word' cannot be a single char ?

thx for everything vim,
-m

I simply use v. Doesn't that work for you? I have to wait a little moment before I hit the next key because I have 'timeoutlen' set to a rather high value to compensate for my motor disability (I have cerebral palsy and move slower than normal), but with the normal 'timeoutlen' of 100 ms that should not be a problem for physically normal people.


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CADAJKhAH09gXtz7jmK-nAdxfXxZzLRt%2BLcxzj-MU1i%3DyJqpZ2g%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: viw / how to select a one char word ?

M Kelly
In reply to this post by Tony Mechelynck
Hi,

Yes, I'll wager this has something to do with my terminal and its terminfo capabilities.

thx,
-m

On Monday, February 3, 2020 at 8:45:14 AM UTC-5, Tony Mechelynck wrote:
On Mon, Feb 3, 2020 at 2:33 PM M Kelly <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="tb19xVvFEwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mckel...@...> wrote:
>
> Hi,
>
> ok I found my error and fixed it. It was in a bad vmap I had for iw
> Thank you all, as always, for the info.
> Now I think 'viw' works well for me in all cases :-)
> I wish the one char word, when selected, changed colour but not a problem.

In my gvim the one-character visually selected word's Visual highlight
is visible during the "off" phase of the blinking cursor; and with
'showcmd' on the number of characters (and bytes, if different) in the
selection is displayed near bottom right of the Vim screen.

Best regards,
Tony.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/3f324d66-cb05-4088-a500-142d901d9345%40googlegroups.com.