/
window.vim
60 lines (41 loc) · 1.97 KB
/
window.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
set splitright " focus new window after vertical splitting
set splitbelow " focus new window after horizontal splitting
Shortcut split window above
\ nnoremap <silent> <Space>Ow :aboveleft split<CR>
Shortcut split window below
\ nnoremap <silent> <Space>ow :belowright split<CR>
Shortcut split window left
\ nnoremap <silent> <Space>iw :aboveleft vsplit<CR>
Shortcut split window right
\ nnoremap <silent> <Space>aw :belowright vsplit<CR>
Shortcut close window
\ nnoremap <silent> <Space>dw :close<CR>
Shortcut close other windows
\ nnoremap <silent> <Space>Dw :only<CR>
Shortcut minimum window size
\ nnoremap <silent> <Space>0w :resize 1<Bar>vertical resize 1<CR>
Shortcut maximum window size
\ nnoremap <silent> <Space>1w :resize<Bar>vertical resize<CR>
" max out before equalizing to accomodate changes in screen resolution
Shortcut equal window sizes
\ nnoremap <silent> <Space>=w :resize<Bar>vertical resize<Bar>wincmd =<CR>
Shortcut minimum window height
\ nnoremap <silent> <Leader><S-Down> :resize 1<CR>
Shortcut minimum window width
\ nnoremap <silent> <Leader><S-Left> :vertical resize 1<CR>
Shortcut decrease window size
\ nnoremap <silent> <Space>-w :<C-U>execute join(repeat(['resize -1', 'vertical resize -1'], v:count1), '<Bar>')<CR>
Shortcut decrease window height
\ nnoremap <silent> <S-Down> :resize -1<CR>
Shortcut decrease window width
\ nnoremap <silent> <S-Left> :vertical resize -1<CR>
Shortcut increase window size
\ nnoremap <silent> <Space>+w :<C-U>execute join(repeat(['resize +1', 'vertical resize +1'], v:count1), '<Bar>')<CR>
Shortcut increase window height
\ nnoremap <silent> <S-Up> :resize +1<CR>
Shortcut increase window width
\ nnoremap <silent> <S-Right> :vertical resize +1<CR>
Shortcut maximum window height
\ nnoremap <silent> <Leader><S-Up> :resize<CR>
Shortcut maximum window width
\ nnoremap <silent> <Leader><S-Right> :vertical resize<CR>