-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwin.txt
139 lines (119 loc) · 5.51 KB
/
win.txt
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
*win.txt* Plugin for managing windows
*vim-win*
Author: Daniel Steinberg - https://www.dannyadam.com
Web: https://github.com/dstein64/vim-win
1. Requirements |win-requirements|
2. Installation |win-installation|
3. Usage |win-usage|
4. Configuration |win-configuration|
|vim-win| is a Vim plugin for managing windows. Built-in functionality includes
window selection, window buffer swapping, and window resizing. The plugin is
extensible, allowing additional functionality to be added (see
|win-configuration| below).
============================================================================
1. Requirements *win-requirements*
* Full functionality
- `vim>=8.2.4052` or `nvim>=0.7.0`
============================================================================
2. Installation *win-installation*
Use |packages| or one of the various package managers.
============================================================================
3. Usage *win-usage*
*:Win*
Enter |vim-win| with <leader>w or |:Win|.
These can be customized (see |win-configuration| below).
* Arrows or `hjkl` keys are used for movement.
* There are various ways to change the active window.
- Use movement keys to move to neighboring windows.
- Enter a window number (where applicable, press <enter> to submit).
- Use `w` or `W` to sequentially move to the next or previous window.
- Press `g` to start letter mode, followed by entering a window letter.
* Hold <shift> and use movement keys to resize the active window.
- Left and right movements shift the right border.
- Down and up movements shift the bottom border.
- For `vim<8.2.4052` and `nvim<0.7.0`:
* Left movements decrease width and right movements increase width.
* Down movements decrease height and up movements increase height.
* Hold <control> and use movement keys to resize the active window.
- Left and right movements shift the left border.
- Down and up movements shift the top border.
- Not available for `vim<8.2.4052` and `nvim<0.7.0`.
* Press `s` or `S` followed by a movement key or window number, to swap buffers.
- The active window changes with `s` and is retained with `S`.
- Rather than using a movement key or window number for swapping, a window
letter can be used by entering letter mode with `g`, after pressing `s` or `S`.
* Press `?` to show a help message.
* Press <esc> to leave |vim-win| (or go back, where applicable).
============================================================================
4. Configuration *win-configuration*
By default, |vim-win| is started with <leader>w or |:Win|. These will not be
clobbered in case they are already used. The |:Win| command takes an optional
argument specifying how many |vim-win| commands to run (e.g., `:Win 1` would
exit |vim-win| after the first command). If the optional argument is `0`, which
is the default, |vim-win| runs until exit.
>
" The following defaults can be customized in your .vimrc
map <leader>w <plug>WinWin
command Win :call win#Win()
The following variables can be used to customize the behavior of |vim-win|.
`Variable`
Description `Default`
------------- -------
*g:win_disable_version_warning* |v:false|
Set to |v:true| to disable the
version warning
*g:win_ext_command_map* `{}`
A dictionary for extending
|vim-win|
*g:win_resize_height* `2`
Number of rows to shift when
resizing
*g:win_resize_width* `2`
Number of columns to shift when
resizing
The |g:win_ext_command_map| maps |vim-win| command keys to `vim` command
strings. The *Win#exit* string can be used as a command string for exiting
|vim-win|.
The variables can be customized in your `.vimrc`, as shown in the following
example.
>
let g:win_resize_height = 3
let g:win_resize_width = 4
let g:win_disable_version_warning = 1
let g:win_ext_command_map = {
\ 'c': 'wincmd c',
\ 'C': 'close!',
\ 'q': 'quit',
\ 'Q': 'quit!',
\ '!': 'qall!',
\ 'V': 'wincmd v',
\ 'S': 'wincmd s',
\ 'n': 'bnext',
\ 'N': 'bnext!',
\ 'p': 'bprevious',
\ 'P': 'bprevious!',
\ "\<c-n>": 'tabnext',
\ "\<c-p>": 'tabprevious',
\ '=': 'wincmd =',
\ 't': 'tabnew',
\ 'x': 'Win#exit'
\ }
Color Customization ~
*win-color-customization*
The following highlight groups can be configured to change |vim-win|'s colors.
Name Default Description
---- ------- -----------
`WinActive` `DiffAdd` Color for the active window label
`WinInactive` `Todo` Color for inactive window labels
`WinNeighbor` `Todo` Color for neighbor window labels
`WinStar` `StatusLine` Color for the command line star (asterisk)
`WinPrompt` `ModeMsg` Color for the command line prompt
The highlight groups can be customized in your |.vimrc|, as shown in the
following example.
>
" Link WinActive highlight to Error highlight
highlight link WinActive Error
" Specify custom highlighting for WinInactive
highlight WinInactive term=bold ctermfg=12 ctermbg=159 guifg=Blue guibg=LightCyan
============================================================================
vim:tw=78:ts=4:ft=help:norl: