:tabnew file
Opens up a new tab, :tabn
Goes to the next tab, and :tabp
Goes to the previous tab. Works great in both gui and non-gui mode. :tabnew file
Opens up a new tab, :tabn
Goes to the next tab, and :tabp
Goes to the previous tab. Works great in both gui and non-gui mode. set bufhidden
nmap <C-h> :bp
nmap <C-l> :bn
If you put this in your .vimrc file, you'll need to put a '^M' at the end of the nmap lines. You do this by doing <C-v><C-m> and it puts in a special character that means newline. Then you can switch between open buffers with ctrl+l and ctrl+h even if you have unsaved changes. it will end up looking like this: set bufhidden
nmap <C-h> :bp^M
nmap <C-l> :bn^M
Unfortunately if you have many files open and don't touch them all it prevents you from quitting with a message 'E173: 17 more files to edit'. I haven't worked out how to obliterate this without damaging features I want (e.g. not quitting when there's unsaved data in those other files).The default vim that ships with linux distributions is often a pile of junk that has been hacked by the distribution, is missing features like these. You want to get vim-extended under redhat-like distributions (they've significantly improved the quality if their junk vim in recent releases), and vim-nox or vim-full in debian-like distributions.
And I think you mean "set hidden".
And regarding E173: You can :qa, which won't lose any unsaved changes.
And the proper vim package for Debian or Ubuntu is "vim". "vim-full" is the old name and it just installs "vim".
Open up a file, :split a new one, and then try these:
map <C-j> <C-w>j80<C-w>+ " up one window, maximized map <C-k> <C-w>k80<C-w>+ " down one window, maximized map <C-h> 80<C-w>+ " maximize current window map <C-i> <C-w>= " all windows equal height
Open up a file, :split a new one, and then try these:
map <C-j> <C-w>j80<C-w>+ " up one window, maximized map <C-k> <C-w>k80<C-w>+ " down one window, maximized map <C-h> 80<C-w>+ " maximize current window map <C-i> <C-w>= " all windows equal height
Maybe that's just me, though.
" tab navigation
map <A-1> 1gt
map <A-2> 2gt
map <A-3> 3gt
map <A-4> 4gt
map <A-5> 5gt
map <A-6> 6gt
map <A-7> 7gt
map <A-8> 8gt
map <A-9> 9gt
map <A-0> 10gt set guitablabel=(%N%M)\ %f :help setting-tabline