On Wed, July 1, 2009 5:20 pm, Tim Chase wrote:
> You might try this pair of mappings:
>
> nnoremap <f4> :let @/=escape(getline('.')[col('.')-1],
> '.~\\')<cr><right>
>
> nnoremap <f5> :let @/.=escape(getline('.')[col('.')-1],
> '.~\\')<cr><right>
>

I personally would use something like this:

nnoremap <f4> :norm! "ayl<cr>:let @/=escape(@a, '.~\\')<cr><right>
nnoremap <f5> :norm! "ayl<cr>:let @/.=escape(@a, '.~\\')<cr><right>

The reason is, that col('.')-1 has problems with multibyte chars and
will return only the first byte of the char under the cursor.

But this has the disadvantage of cluttering your "a register.

regards,
Christian
-- 
:wq!


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to