> Date: Thu, 9 Jun 2011 14:21:42 +0200
> From: [email protected]
> To: [email protected]
> Subject: Re: jump between two tabs
>
> Hi Jeroen!
>
> On Do, 09 Jun 2011, Jeroen Budts wrote:
>
> > Hi all,
> >
> > I'm wondering if there is a shortcut in vim to switch between two
> > tabs, similar to CTRL-^ to switch between two buffers.
> > Suppose i'm working in tab 2 and i switch to tab 4 (4gt), then i'd
> > like to be able to use a simple shortcut to switch back to the
> > previous tab (S-CTRL-^ or something similar). Does something like
> > that exist?
>
> I don't think there is. You can however script yourself a solution:
>
> au TabLeave * :let g:last_tab=tabpagenr()
>
> fu! <sid>LastTab()
> if !exists("g:last_tab")
> return
> endif
> exe "tabn" g:last_tab
> endfu
>
> nmap <silent> <F7> :call <sid>LastTab()<cr>
>
> I am not exactly sure, whether <S-C-^> can be mapped. That depends on
> your environment.
>
> regards,
> Christian
>
> --
I had the same problem and created the following mappings. Since my leader
character is the backslash, the '[' and ']' characters are very convenient.
noremap <silent><Leader>[ :tabp<CR>
noremap <silent><Leader>] :tabn<CR>
Hope this helps.
Roy
--
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