forked from NeoVintageous/NeoVintageous
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNeoVintageous.help.kdl
316 lines (303 loc) · 22.6 KB
/
NeoVintageous.help.kdl
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
/-kdl-version 2
/* Below is a sample of ‘NeoVintageous.kdl’ config file
(run ‘NeoVintageous: Open new config file example (KDL)’ in Command Palette to open)
(run ‘Preferences: NeoVintageous New Settings (KDL)’ in Command Palette to open it along with your config)
For an example of how to configure keybinds see:
↓ defined within the plugin's Python code
Default: ‘NeoVintageous.key-def.kdl’ (run ‘NeoVintageous: Dump default key bindings as KDL’)
User : ‘NeoVintageous.key-user.kdl’ (run ‘NeoVintageous: Dump old config key bindings as KDL’)
↑ converted from your existing ‘.neovintageousrc’, where same command/key combinations in different modes are grouped into one
For for the line-by-line converted version of ‘.neovintageousrc’, including settings and comments:
see ‘NeoVintageous.rc.kdl’ (run ‘NeoVintageous: Dump old config as KDL’) (not 100% complete)
‘NeoVintageous.kdl’ is loaded after ‘.neovintageousrc’, so you can transition gradually
To reload run ‘NeoVintageous: Reload config’
Install ‘KDL’ package for syntax highlighting
// Comment /*block/inline comment*/ /-node comment to disable the whole section
Node names are CaSe, ␠whitespace⭾, and _.separator- insensitive: keymap = key-map = key_map = "key map"
(except for ‘keybind’ and ‘event’ where such characters matter for keys/cli commands)
*/
v 0.1 // config format version to hopefully allow updates without breaking existing configs
import (keybind)NeoVintageous.key.kdl
/*↑import file name ↑ relative to this main config file or an absolute '/'-prefixed path since this calls pathlib's 'Path(main_config_folder, import_value)' docs.python.org/3/library/pathlib.html
group ↑ values in ‘keybind{}’, so the file itself can include only top-level ‘key command’ lines
*/
keybind { // or add keybinds in the main config file
// moves back in a .KDL file, but forward elsewhere (2nd keybind doesn't overwrite the 1st's file types)
(Ⓝ_)q (⋅2)MoveByBigWordsBackward file=kdl
(Ⓝ_)q (⋅2)MoveByBigWords
// execute two Sublime Text commands without any "chain" intermediary
(Ⓝ)w #":"command":"move","args":{"by":"words","forward":true,"extend":false}<CR>"# #":"command":"move","args":{"by":"words","forward":true,"extend":false}<CR>"#
// execute multiple commands with a "chain" intermediary
// helpful when a chained command needs to have dedicated properties (not shown in the example below)
// childrens' node names are ignored, so use ‘-’ or whatever
(Ⓝ)e #":"command":"move","args":{"by":"words","forward":true,"extend":false}<CR>"# "chain" {
↓/*node names are ignored*/ "MoveByBigWords"
- #":"command":"move","args":{"by":"words","forward":true,"extend":false}<CR>"#
- #":"command":"move","args":{"by":"words","forward":true,"extend":true}<CR>"#
}
// group normal-mode keybinds without having to specify Normal mode for each keybind
// can add more modes to a keybind, but NOT remove the group mode(s)
(Ⓝ)my_normal_group { // should move only once in normal mode since 2nd command switches to visual mode
a MoveByBigWordsBackward #":"command":"move","args":{"by":"words","forward":false,"extend":true }<CR>"#
s MoveByBigWords #":"command":"move","args":{"by":"words","forward":true ,"extend":true }<CR>"#
}
// execute Sublime Text commands by writing arguments in a prop=value format
(Ⓝ)r (subl)move by=words forward=#true extend=#false
// - #":"command":"move","args":{"by":"words","forward":true,"extend":false}<CR>"#
// ! but this is NOT suitable for chains since prop=val in KDL do not maintain position vs. arguments, so to execute multiple Sublime Text commands with arguments you'd still need to "chain them"
(Ⓝ)t {
- (⋅5subl)move by=words forward=#true extend=#false
- (⋅5subl)move by=words forward=#true extend=#true
}
// ! also, this doesn't work for nested arguments, those still require pasting the full json snippet
// Import the same group of keybinds twice to make a slight tweak via variables
// [ toggle relative lines in Normal mode
// Ctrl+[ Insert
// Content of NeoVintageous.keyB.kdl: (‘m’)"‘ipre’[‘ipos’" ":set invrnu<CR>"
import NeoVintageous.keyB.kdl m=(var)Ⓝ ipre=(var)"" ipos=(var)"" // (Ⓝ)[
import NeoVintageous.keyB.kdl m=(var)ⓘ ipre=(var)<C- ipos=(var)> // (ⓘ)<C-[>
import NeoVintageous.keyB.kdl m=(varpass)"" // or use the mode variable passed to this config through to the next one
// or ($) instead of (var); ($→) instead of (varpass)
}
rc { // Literal Ex commands
#":set relativenumber?"# // must have no arguments/properties, only a single node (use #"raw"# strings to avoid any escapes
}
general { // General options //≝Default
let mapleader=<space>
set relativenumber=#true relativenumber=inv relativenumber? // support for vim "noargument" format and a more explicit config=value
default_mode normal //"" default mode when activating or switching views (Visual selections are retained when the window loses focus)
reset_mode_when_switching_tabs #false //true reset to Normal when a view is activated
highlighted_yank #true //true github.com/machakann/vim-highlightedyank
highlighted_yank_duration 1000 //1000 ms
highlighted_yank_style fill //fill ¦outline¦underline¦squiggly_underline¦stippled_underline¦
search_cur_style fill //fill ¦↑¦ current search style
search_inc_style fill //fill ¦↑¦ incremental search style
search_occ_style fill //fill ¦↑¦ occurrences search style
bell blink //blink ¦view¦views¦ Visual bell style type
bell_color_scheme dark //dark ¦light¦path/to/scheme¦ Visual bell color-scheme
auto_nohlsearch_on_normal_enter #true //true Clear search highlighting when entering Normal (usually occurs on ⎋)
// :noh[lsearch] // clear search highlighting directly
// noremap <C-l> :nohlsearch<CR> // map a key combination to clear search highlighting
// NeoVintageous Plugins
enable_abolish #true //true github.com/tpope/vim-abolish
enable_commentary #true //true github.com/tpope/vim-commentary
enable_multiple_cursors #true //true github.com/terryma/vim-multiple-cursors
enable_sneak #true //false github.com/justinmk/vim-sneak
enable_sublime #true //true Sublime Text tweaks
enable_surround #true //true github.com/tpope/vim-surround
enable_targets #true //true github.com/wellle/targets.vim
enable_unimpaired #true //true github.com/tpope/vim-unimpaired
use_ctrl_keys #true //true Enable key bindings prefaced by ⎈
use_super_keys #true //true Enable key bindings prefaced by ◆ (⌘ Mac, ❖ Windows)
/-handle_keys \ //{} ignore keys (handled by ST)
<C-q>=#false <C-w>=#false <C-e>=#false <C-r>=#false <C-t>=#false <C-y>=#false <C-u>=#true <C-i>=#false <C-o>=#false \
<C-a>=#false <C-s>=#false <C-f>=#false <C-g>=#false <C-h>=#false <C-j>=#false <C-k>=#false <C-l>=#false \
<C-z>=#false <C-x>=#false <C-c>=#false <C-v>=#false <C-b>=#true <C-m>=#false \
<C-Q>=#false <C-W>=#false <C-E>=#false <C-R>=#false <C-T>=#false <C-Y>=#false <C-U>=#true <C-I>=#false <C-O>=#false <C-P>=#false \
<C-A>=#false <C-S>=#false <C-F>=#false <C-G>=#false <C-H>=#false <C-J>=#false <C-K>=#false <C-L>=#false \
<C-Z>=#false <C-X>=#false <C-C>=#false <C-V>=#false <C-B>=#true <C-N>=#false <C-M>=#false \
"<C-[>"=#true "<C-]>"=#true "<C-;>"=#false <C-.>=#false "<C-/>"=#false <C-0>=#true \
"<C-{>"=#false "<C-}>"=#false "<C-=>"=#false <C-<>=#false <C->>=#false <C-?>=#false \
<C-'>=#false <C-|>=#false \
"<C-\">"=#false "<C-\\>"=#false
// ignore ⎈f `{<C-f>:false}` or `{i_<C-f>: #false}` in insert
// `n_`orm `i_`ns `v_`is `V_`visLine `b_`visBlock `s_`el
// i_escape_jj #true //false Map insert mode jj to ⎋
// i_escape_jk #true //false Map insert mode jk to ⎋
nvⓘ_⎋←ii #false //false Map insert mode ii to ⎋
"nvⓘ_⎋←;i" #true //false Map insert mode ;i to ⎋
use_sys_clipboard #true //false Propagate copy actions to the system clipboard
clear_auto_indent_on_esc #true //true delete indent if you type nothing after  (⎋ after O)
auto_complete_exit_from_insert_mode #true //true ⎋ to exit to Normal mode (always closes auto complete)
multi_cursor_exit_from_visual_mode #false //false #false: quit key ⎋¦J in Visual mode will delete existing cursors (can operate on all the cursors)
lsp_save #false //false Override native save to handle LSP Code-Actions-On-Save. See https://github.com/sublimelsp/LSP/issues/1725
shell_silent #false //false Show output panel from shell commands
show_marks_in_gutter #true //true Show marks in the gutter
sneak_use_ic_scs 1 //0 0=Always case-sensitive 1=Case sensitivity is determined by `ignorecase` and `smartcase`
exit_when_quitting_last_window #true //true Behavior of commands like ZZ, :quit, :wq, etc.
// #true exit ST on closing the last view
// #false keep ST on closing the last view
// unless_sidebar_visible exit ST only if the sidebar is hidden
source #null // Read Ex commands from a resource before the NeoVintageous.kdl is loaded, so you can still override these Ex commands in your config file, for example:
// Packages/NeoVintageousDvorak/dvorak.neovintageous // See github.com/gerardroche/NeoVintageousDvorak
// Packages/NeoVintageousColemak/colemak.neovintageous // See github.com/gerardroche/NeoVintageousColemak
auto_switch_input_method #false //false Enable automatic switching of input methods.
auto_switch_input_method_default "" // Configure the default input method to be used. Examples: "xkb:us::eng", "us", "0", "1", "2", "com.apple.keylayout.US", "1033"
auto_switch_input_method_get_cmd "" ///path/to/im-select Specify the complete command path for retrieving the current input method key. Examples: "/usr/bin/ibus engine", "/usr/local/bin/xkb-switch", "/usr/bin/fcitx-remote", "/path/to/im-get", "/usr/bin/qdbus org.kde.keyboard /Layouts getLayout", "/usr/local/bin/im-select", "D:\\bin\\im-select.exe"
auto_switch_input_method_set_cmd "" ///path/to/im-select {im} Provide the complete command path for switching input methods, using {im} as a placeholder for the input method key. Examples: "/usr/bin/ibus engine {im}", "/usr/local/bin/xkb-switch -s {im}", "/usr/bin/fcitx-remote -t {im}", "/path/to/im-set {im}", "/usr/bin/qdbus org.kde.keyboard /Layouts setLayout {im}", "/usr/local/bin/im-select {im}", "D:\\bin\\im-select.exe {im}"
}
keymap { // Use custom keymaps (non-QWERTY/non-Latin) in command mode
// 1. add "lower"/"upper" keymaps below that match the position of QWERTY symbols
// 2. Run command "NeoVintageous: Generate non-QWERTY key bindings"
// (doesn't work for key combinations pending resolution of https://github.com/sublimehq/sublime_text/issues/5980)
/-qwerty #"`12 34567890-=\ qwertyuiop[] asdfghjkl;' zxcvbnm,./"#
lower #"ё12 34567890-=\ йцукенгшщзхъ фывапролджэ ячсмитьбю."#
upper #"Ё!@ #$%^&*()_+| ЙЦУКЕНГШЩЗХЪ ФЫВАПРОЛДЖЭ ЯЧСМИТЬБЮ?"#
/-qwerty #"~!@ #$%^&*()_+| QWERTYUIOP{} ASDFGHJKL:" ZXCVBNM<>?"#
/-upper #"Ё!\"№;%:?*()_+/ ЙЦУКЕНГШЩЗХЪ ФЫВАПРОЛДЖЭ ЯЧСМИТЬБЮ,"# // remap some symbols to same to avoid issues with losing them in regular latin keybinds like ; being remapped to $ since ⇧4 is translated to ; in Ru
alias #true // 3. allows using `map й w` in .neovintageous to map non-latin keys separately from latin ones
// assigns to each command an extra keybind in alt layout so that said key can be used in the TO sublime-keymap field
}
edit { // Edit behavior ≝default
move_left_on_insert_exit #false //true move cursor left on ⓘ→Ⓝ to be consistent with line-end editing vimhelp.org/vim_faq.txt.html#faq-10.2
ignore_nl_on_char_move #false //true `nv_vi_move_char_right` will not stop at  unlike ST's `move args:{by:characters,forward:true}}`
decolonize_ex #true //false don't add `:` to the EX command line panel (and don't close the panel if it becomes empty)
}
event { /* Run cli commands on entering/leaving a mode by adding
(mode)Event {(os)cmd arg1 arg2;}
Mode : Normal Insert Replace Select Visual VisualBlock VisualLine (see ‘status’ for abbreviations)
Event : in enter out exit leave
OS : ⌘ 🍏 m mac osx macos 🐧 l lin linux 🪟 🗔 ⊞ w win windows
*/ //↓ CaSe, ␠whitespace⭾, and _.separator- sensitive
(ⓘ)in (mac)"~/.local/bin/karabiner_cli" --set-variables #"{"isNVⓘ":1}"#
(ⓘ)out {(mac)"~/.local/bin/karabiner_cli" --set-variables #"{"isNVⓘ":0}"#;} //child node format also works
/-post_mode_message class=AutoHotkey name=AutoHotkey.ahk mid=nv_a61171a06fc94216a3433cf83cd16e35; // Post messages to a window of this class and with this text in its name with this unique ID (target app must use the same id to receive the message)
/-(ⓘ)in (win)send_mode_message internal=#true; // run internal command
/-(ⓘ)out {(win)send mode message internal=#true;}
/-(n)in {(mac)"~/.local/bin/karabiner_cli" --set-variables #"{"isNVⓃ":1}"#;}
/-(n)out {(mac)"~/.local/bin/karabiner_cli" --set-variables #"{"isNVⓃ":0}"#;}
}
status { // Set values/reorder the status bar mode indicator, indicator format is '<prefix><Mode><suffix>', where Mode's name can be either of the space-separated values:
/*normal Ⓝ N visual Ⓥ V
insert ⓘ I visualblock ▋ VB
command Ⓒ C visualline ━ VL
select Ⓢ S terminal Ⓣ T
operator Ⓞ O replace Ⓡ R
map Ⓜ M Ⓛ L
map! Ⓧ X
so ‘insert ⓘ’ would set Insert's mode indicator to ⓘ, but so would ‘I "ⓘ"’
*/
prefix ""; suffix ""
insert ⓘ
normal " " // space roughly the width of an indicator to avoid jitter on mode change
id_mode "00_nv_mode" // '00_mode' number defines order priority of custom status bar statuses, so 00 should be left-most
id_seq vim-seq
}; /-status insert=ⓘ // prop=val format also works
indicator { // Set various indicator format //≝Default
ls { // Set values for ‘ls’ command indicators
current • //% The buffer in the current window
modified 🖉 //+ Modified buffer
alternate ⎌ //# Alternate buffer
read_only 👓 //= Readonly buffer
active 👁 //a Active buffer: loaded and visible
hidden " " //h Hidden buffer: loaded but invisible
line ━ //line Line prefix
no_name "" //[NO NAME] Name for a tab without a file
file_qleft "" //" File name left quote
file_qright "" //" File name right quote
}; /-ls current=• // prop=val format also works
registers { // Set values for ‘registers’ command indicators
char c // Characterwise text
line ━ // Linewise text
}; /-registers char=c line=━━ // prop=val format also works
count { // Set values for command ‘count’ popup indicator
enable #true //true Show a popup at cursor location with a command repeat count
prefix "" //"" Prefix label shown before count number (e.g., ⌗3)
max_width 80 //80 max popup width
max_height 30 //30 max popup height
template #"<body id="nv_motion_count"><span>{prefix}{count}</span></body>"# //<body id="nv_motion_count"><span>{prefix}{count}</span></body> Full HTML popup template replacement that will receive two variables: prefix and count
}; /-count prefix="⌗" // prop=val format is also allowed
key_help { // Set values for partial command's help popup indicator
enable #true //true Show a popup at cursor location with a keybind/command table
delay 1 //1 seconds before showing help (cancelled if another key is pressed before)
max_width 1280 //1280 max popup width
max_height 960 //960 max popup height
table #"""
<body id="nv_help_key">
<div>K⃣ 🅃 Command\t \tℹ</div>
{rows}
</body>
"""#
row #"<div>{key} {icon} {type} ¦ {cmd} ¦ {info}</div>"# //{x} are variable names (can't be changed) that get passed from the keymap
}; /-key_help enable=#true // prop=val format is also allowed
}
mark { // Set various marks options
back ' ` // marks that signal to go back to the previous selection
}
text_object { // Set various text object options
steady_cursor #true/*←apply to all functions*/ /*override for a function→*/caselowerchar=#true caselowerline=#true
// Don't move ⎀cursor to the text object borders when a given command acts on it, e.g., "lower case within a word" command in ‘LOWER⎀case’ will result in:
// ⎀lowercase if true
// lower⎀case if false
// only 2 commands are currently supported
seek_forward #false // search for text objects outside of current selection, e.g., "lower case within (parentheses)" command in ‘⎀a(B)’ results in:
// ‘a(B)’ if false (default)
// ‘a(b)’ if true
// Use custom text object list/labels (only within existing groups listed below), format:
//↓GroupName label="Add pair" "Add pair" label_remove=#null or "" "clear" //clear all group defaults (NO tag)
Quote g=‘’ ‘=‘’ ’=‘’ y="`' '" \ // def '"`#$&*+-./:;=_|~\
/**/ ‘’ /*←↑ ↑ are the same: unlabeled pairs parsed using self*/\ //
/**/ y="`' '" /*separate a pair by space ↓ if it's > 2 symbols*/ //
Bracket clear/*clear all Bracket defaults*/ \ // def b() [] B{} <>
/**/ d="()" f="[]" j="{}" n=【】 // ...any symbol↑ is a label
Sentence x /*← new label */ s=#null //s
Tag c /*← empty "" value since there are not Tag delimiters*/ "t" //t
Word s w="" /*← Remove the default label for Word */ //w
BigWord e W="" //W
Paragraph b p="" //p
Indent w i="" //i
BigIndent q I="" //I
Line a l="" //l
}
plugin {
abolish { // Use custom aliases in Abolish plugin
steady_cursor #true // don't 'move' ⎀cursor to the word's beginning on case changes
alias clear/*clear all default aliases*/ { // ._-␠ and CaSe are ignored in alias names
m MiXedCase ; p MiXedCase
c camelCase ; //
_ snake_case ; s snake_case
u UPPER_CASE ; U SNAKE_UPPER_CASE // same as uppercase
- dash-case ; k kebab-case // same as dash-case
" " "space case" ; "<space>" "space case"
. dot.case
t "Title Case"
}; /-alias m=mixedcase // prop=val format is also allowed
}
unimpaired { // Use custom aliases in UnImpaired plugin
option clear/*clear all default aliases*/ { // ._-␠ and CaSe are ignored in alias names
v #null;//clear a specific alias
a menu; t sidebar; m minimap; e statusbar;
w wrap ; //word_wrap
l list ; //draw_white_space
h hlsearch ; //highlight found search results
c cursorline ; /-u cursorcolumn;
n number ; r relativenumber; //line_numbers relative_line_numbers
s spell ; //spell_check
i ignorecase ;
/-v virtualedit; /-d diff; /-x crosshairs; /-b background; //not implemented
}; /-option m=menu // prop=val format is also allowed
}
surround { // Use custom brackets in Surround plugin
punctuation_marks\/* add to default (){}[]<>*/
‘=‘’ “=“” ’=‘’ ”=“” \
‹=‹› «=«» ›=‹› »=«» \
〈=〈〉 ⟪=⟪⟫ 〉=〈〉 ⟫=⟪⟫ \
`'="`' '"\/*use space as a separator of the left vs right groups*/
〔=〔〕 〕=〔〕 \
⸨=⸨⸩ ⸩=⸨⸩ \
【=【】 】=【】 \
「=「」 」=「」 \
␌=␌␌; /-punctuation_marks {‘ ‘’; “ “”;} //key val child node format also works
punctuation-alias clear/*clear defaults b) B} r] a>*/\
d="(" f="[" g=‘ h=“ \
j="{" k="\"" l=' \
r=‹ t=« y=`' o=〔 p=␌ \
z=⸨ n=【 m=「 " "="〈" .=⟪; /-punctuation_alias {clear; d "(";} //key val child node format also works
function clear/*clear defaults f F*/\
a (␠)s // tags ␠ ␣ s sp space add spaces between () and arguments
"append space to chars" ")}]" // "({["
steady_cursor add=#true delete=#true replace=#true // don't 'move' ⎀cursor to the changed punctuation:
// surround-word add of ‘(’ in ‘text_⎀surr’ results in ‘(text_⎀surr)’
// not ‘⎀(text_surr)’
// surround delete of ‘(’ in ‘(text_⎀surr)’ results in ‘text_⎀surr’
// not ‘⎀text_surr’
// surround replace of ‘(’ in ‘(text_⎀surr)’ results in ‘[text_⎀surr]’
// with ‘[’ not ‘⎀[text_surr]’
/-steady_cursor {add #true; replace #true; delete #true;} //key val child node format also works
seek_forward #false /* When looking for brackets, if the current text is NOT enclosed in them, but Targets plugin is enabled, seek the next pair of brackets, for example (⎀ is cursor position):
⎀a(b) with surround delete of ( will result in:
⎀ab if SEEK_FORWARD is true : the next pair of () after ⎀ found and deleted
⎀a(b) if SEEK_FORWARD is false: the next pair of () is ignored
*/
}
}