Reputation: 447
I currently map my F2 and F3 as following:
map <F2> :tabn <CR>
map <F3> :tabp <CR>
imap <Esc> :tabn <CR>
imap <Esc> :tabp <CR>
I try to figure out how to map the normal/insert mode at the same time. I spent some times on googling around without any luck.
Any suggestion would be appreciated.
Upvotes: 1
Views: 185
Reputation: 45177
Honestly in my opinion, these mappings are probably not worth it.
gt
/gT
already exist to move between tabs. See :h gt
Your mappings suggest a heavy tab centric workflow. I know it might sound weird but maybe try and use less tab panes together with a more buffers centric workflow. Here are some nice posts about it:
Upvotes: 0
Reputation: 85897
The best I've found so far is:
nnoremap <F2> :tabn<CR>
imap <F2> <C-O><F2>
nnoremap <F3> :tabp<CR>
imap <F3> <C-O><F3>
Still an extra line for each key, but at least the actual command (:tabn
, :tabp
) is only mentioned once (and only needs to be changed in one place if you want to change it).
Upvotes: 1