diff options
| author | Teddy Wing | 2014-05-30 23:56:11 -0400 | 
|---|---|---|
| committer | Teddy Wing | 2014-05-30 23:56:11 -0400 | 
| commit | 465b81ea179dc1fd62767ea69fb23432dce50d0c (patch) | |
| tree | bac0210bbe224dac64d06a31636485a264b605ed /vimrc | |
| parent | ecbb2c0a73f284a69f7e1bcb0413ddaea49d9e16 (diff) | |
| download | dotvim-465b81ea179dc1fd62767ea69fb23432dce50d0c.tar.bz2 | |
vimrc: add <leader>tl to go to last active tab
Makes it easier to switch between two tabs when there are a bunch open.
Instead of having to memorize their tab numbers, just use this command.
Taken from
http://stackoverflow.com/questions/2119754/switch-to-last-active-tab-in-vim
Diffstat (limited to 'vimrc')
| -rw-r--r-- | vimrc | 11 | 
1 files changed, 11 insertions, 0 deletions
| @@ -181,6 +181,8 @@  "         than the odd ones). Originally I thought it was distracting but I   "         just caved. Much easier to follow the line when it gets really long   "         if it's a different colour than its neighbors. +"       * Add a leader command to go to the last active tab. Make it easier to  +"         back and forth between tabs.  " @@ -465,6 +467,15 @@ nnoremap <leader>tn :tabnew<cr>  " Delete buffer and go to previous tab  nnoremap <leader>tx :bdelete \| normal! gT<cr> +" Go to last viewed tab +" http://stackoverflow.com/a/2120168 +let g:last_viewed_tab = 1 +augroup last_viewed_tab +	autocmd! +	autocmd TabLeave * let g:last_viewed_tab = tabpagenr() +augroup END +nnoremap <leader>tl :execute "tabnext " . g:last_viewed_tab<cr> +  " Quickfix  nnoremap ]q :cnext<cr>  nnoremap [q :cprevious<cr> | 
