Is it possible to use some special keys from a ThinkPad
keyboard for mappings? What I am looking for is to map the
back and forward keys (above the<Left>  and<Right>  keys) to
:tabnext and :tabprevious.

The generic answer is "if (g)vim can see them, you can map them". The question then becomes, can (g)vim see them?

The easiest test is to go into insert (or command-line) mode, type control+V (assuming you haven't sourced the mswin.vim abomination), and then press either your Back or Forward button to see what (g)vim inserts. If *nothing* shows up, you'll have to jump through OS-level key-remapping hoops to get vim to see it as a key. On the other hand, if some escape sequence shows up, you can map that escape sequence, something like

  :nnoremap <esc>[123;45;678k :tabnext<cr>

where "<esc>" is 5 literal characters, and the rest is whatever sequence the control+V inserts.

You don't mention what OS you're running (on X systems, you should be able use xev to see what key sequences X sees, and setxkbmap to nudge them around if they aren't already producing something in xev; in other OSes, YMMV), or whether you're running vim or gvim. I have some similar keys on my Lenovo G570, running Debian, and Fluxbox sees them as XF86AudioPrev and XF86AudioNext which I have mapped/intercepted to talk to xmms2 instead of passing them to individual applications. On Win32 or Mac OS X, I can't be of much help.

-tim

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