Vim, reopen last closed window, that was in split
Solution 1:
:vs#
will split current window vertically and open the alternate file.
It's so simple that you don't need to bind it to key.
Solution 2:
Nice question! I was thinking to something like the following:
nmap <c-s-t> :vs<bar>:b#<CR>
It should work as you want.
Solution 3:
No need for SHIFT:
nmap <c-t> :vs<bar>:b#<CR>
In conjunction with CTRL the characters are handled equally by vim, capitalized or not.
Actually also in the answer before, CTRLn and CTRLSHIFTN should both work.
Solution 4:
I've gotten this to work by using bufmru.vim
!
The following command, :ReopenLastTab
, will re-split the last-open buffer:
command ReopenLastTab execute "vsplit" bufname(g:bufmru_bnrs[1])
I installed bufmru using Vundle
, as below, but of course you can install it any way you like.
#.vimrc
" Install bufmru with Vundle
Plugin 'vim-scripts/bufmru.vim'
let g:bufmru_switchkey = "<c-t>" " I never use this: the default is Space, but I don't need to use it so set it to something I don't care about.