Thursday, March 31, 2011

Re: Finding the correct map

On 03/31/2011 05:01 PM, carlosvillu wrote:
> I came from Textmate and i try to created a map that i was so
> useful for me. When i edit a file in insert mode, i want can
> press <shift>Left /<shift>Rigth for select caracter by
> caracter and <shift><cmd>Left<shift><cmd>Right to select word
> by word. Really I tried, but I don´t make work fine.

Assuming your vim can see that key-sequence (see note below), you
can use

:nnoremap <s-left> v<left>
:nnoremap <s-right> v<right>
:vnoremap <s-left> <left>
:vnoremap <s-right> <right>

which should implement the behavior you expect.

-tim


NOTE: to see if your Vim distinguishes between them, in either
insert-mode or command-line (":"-prompt) mode, you can type
control-V followed by shift-left. Then try the same with
control-V followed by plain-left and see if Vim sees the same
key-sequence. Alternatively in insert-mode, you can prefix the
key-to-check with control-K to see the vim-key-code representation.

:help i_CTRL-V
:help i_CTRL-K

--
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

No comments: