Hacker News new | ask | show | jobs
by PaulJulius 4045 days ago
Being able to open up multiple files and arrange them precisely how I want (with the keyboard!) is my absolute favorite part of vim. I use the following shortcuts for opening a file to the right/left or above/below:

    nnoremap <Leader>or :set splitright<CR>:vs
    nnoremap <Leader>ol :set nosplitright<CR>:vs
    nnoremap <Leader>oa :set nosplitbelow<CR>:sp
    nnoremap <Leader>ob :set splitbelow<CR>:sp
    " Don't let vim change the setup when closing windows
    set noequalalways
So I can simply type ',or ' and then the name of a file to get a vertical split.

You can then use <C-w>w<number>+/- to increase/decrease the height of a window and <C-w>w<number>'<'/'>' to change the width.