On 10/08/11 09:34, Dmitry Teslenko wrote:
Hello!
Since long ago using  this config:

noremap .<esc>:tnext<cr>
noremap ,<esc>:tprevious<cr>

Now I missing (.) dot command to repeat last action. First I've tried
to remap them to Ctrl+. but with no success. It seems it must be done
some other way than:

noremap<C-.>  <esc>:tnext<cr>
noremap<C-,>  <esc>:tprevious<cr>

Two questions:
1) Can Ctrl+. be mapped and how?
2) What's your favorite mappings for tnext/tprev?



1) The only Ctrl+printable keys which Vim can reliably see are the following:

Ctrl+@ = 0x00
Ctrl+A to Ctrl+Z = 0x01 to 0x1A
Ctrl+[ = 0x1B = <Esc>
Ctrl+\ = 0x1C
Ctrl+] = 0x1D
Ctrl+^ = 0x1E
Ctrl+_ = 0x1F
Ctrl+? = 0x7F
Ctrl+a to Ctrl+z = same as Ctrl+uppercase

However, most of them are already bound to something useful.

Ctrl+_non_-printable keys may or may not get passed to Vim depending on your OS, your keyboard interface, and, for Console Vim, the specific terminal you're running in. You may have to experiment with the help of the Ctrl-V (or Ctrl-Q) prefix in Insert mode, see ":help i_CTRL-V", ":help i_CTRL-Q" and ":help Ctrl-V-alternative".

2) My favourite keys to assign to the {lhs} of _any_ mapping are <F2> to <F12> (with the exception of <F10> if it is used to trigger the System menu), and <S-F1> to <S-F12>. If you don't have enough with those 22 keys, use a few of them as prefixes for longer {lhs}es for mappings which you won't need too often. AFAIK those F keys (other than unshifted F1 = Help and sometimes unshifted F10 = Menu) aren't used for anything else, and, when used with no modifier or with only Shift, they are reliably passed to Vim on all platforms and all terminals.

Specifically for :tabnext and :tabprev, however, you might take advantage of the fact that Ctrl+PgDn and Ctrl+PgUp have the same function, in both Normal and Insert mode, see

        :help :tabnext
        :help :tabprevious

and notice that the tag anchors on the right hand apply to Ctrl-PageUp and Ctrl-PageDown in both Normal and Insert mode.

On most "desktop-type" keyboards the PageUp and PageDown keys can quite easily be depressed with the right index finger while holding the right Ctrl key down with the right thumb. Unless of course (like some Vim users :-P if I may believe some of the comments I've seen) you use (real or virtual) manacles to prevent your wrists from moving away from the SDF JKL "home position" when typing.

Laptop keyboards may vary in this respect.


Best regards,
Tony.
--
"I'd love to go out with you, but the last time I went out, I never
came back."

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

Reply via email to