Neshama wrote:
> Is it possible to (visually) select a word under the cursor ?
>
> The reason I need that is to easily copy and paste words
> under the cursor, without having to manually select them with
> 'v' first (which is slow).
It is very easy to type the following (in normal mode):
yiw (yank inner word)
viw (visually select inner word)
The first copies the current word.
The second just selects it (as per your first line).
If you want to make it really easy because you are doing a lot
of copying, you could enter some mappings (pick one of these):
:map <F1> :let @@=expand('<cword>')<CR>
:map <F2> :let @+=expand('<cword>')<CR>
:map <F3> yiw
:map <F4> "+yiw
The F1 and F2 examples use the same logic as * does to search
for the current word. F1 copies to default register, F2 to the
clipboard.
The F3 and F4 examples use the slightly different logic of
"inner word".
John
--
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