3 ms·
map <C-j> <C-W>j<C-w>_ map <C-k> <C-W>k<C-w>_ map <C-h> <C-w>h<C-w>_ map <C-l> <C-w>l<C-w>_ Try these. They expand the window they move into. You'l
by crazydiamond 16y ago
map <C-j> <C-W>j<C-w>_
map <C-k> <C-W>k<C-w>_
map <C-h> <C-w>h<C-w>_
map <C-l> <C-w>l<C-w>_
Try these. They expand the window they move into. You'll love them.
- samstokes 16y agoNice - I can imagine a workflow where you keep two vertical panes open, the left one with the main file you're working with, the right one with a whole bunch of auxiliary files; then you can use these mappings to easily jump between the right-hand files, while keeping them all visibly accessible. Gonna try this!
- crazydiamond 16y agoI usually have never found vertical splits to be helpful, though others may disagree. I prefer to keep several horizontal splits (in your case above). Just use C-j or C-k, your current file is maximized. Remember, you have other options too, such as tabs, and just opening aux files as buffers and C-n or C-p to get to them.
- mhansen 16y agoWow! That's amazing. Turns vim into a kind of cardfile. I like this (compared to a buffer explorer) - the visual indication of where the file is is nice.
- deleted 16y ago[deleted]
- graywh 16y agoIt's easier to "map <C-?> <C-w>?" for ? in [j,k,h,l] and do "autocmd WinEnter * resize" separately. Especially since it's easier to disable.
- deleted 16y ago[deleted]
- xtho 16y agoI personally like to use tinymode[1] for such things in order to reduce map pollution (if such a term exists). [1] http://www.vim.org/scripts/script.php?script_id=2223 http://www.vim.org/scripts/script.php?script_id=2223
- IgorPartola 16y agoI usually just do map <Tab> ^W^W I only have one split at a time (very rarely going up to three).
- crazydiamond 16y agoomg, most of us have TAB mapped to insert-completion -- i've now got it mapped to snipMate.vim plugin. In any case, ^w^w is quite easy to press twice without mapping, although that's entirely your call. It's fine if you have 2 equal splits and only want to jump to the other without resizing. When you have > 3, you definitely want to maximize the current split.