@@ -4,7 +4,7 @@
44
55### Movement
66
7−> NOTE: `f`, `F`, `t` and `T` are not confined to the current line.
7+> NOTE: Unlike vim, `f`, `F`, `t` and `T` are not confined to the current line.
88
99| Key | Description | Command |
1010| ----- | ----------- | ------- |
@@ -28,14 +28,14 @@
2828| `PageDown` | Move page down | `page_down` |
2929| `Ctrl-u` | Move half page up | `half_page_up` |
3030| `Ctrl-d` | Move half page down | `half_page_down` |
31−| `Ctrl-i` | Jump forward on the jumplist TODO: conflicts tab | `jump_forward` |
31+| `Ctrl-i` | Jump forward on the jumplist | `jump_forward` |
3232| `Ctrl-o` | Jump backward on the jumplist | `jump_backward` |
3333| `v` | Enter [select (extend) mode](#select--extend-mode) | `select_mode` |
3434| `g` | Enter [goto mode](#goto-mode) | N/A |
3535| `m` | Enter [match mode](#match-mode) | N/A |
3636| `:` | Enter command mode | `command_mode` |
3737| `z` | Enter [view mode](#view-mode) | N/A |
38−| `Ctrl-w` | Enter [window mode](#window-mode) (maybe will be remove for spc w w later) | N/A |
38+| `Ctrl-w` | Enter [window mode](#window-mode) | N/A |
3939| `Space` | Enter [space mode](#space-mode) | N/A |
4040| `K` | Show documentation for the item under the cursor | `hover` |
4141
@@ -66,6 +66,16 @@
6666| `d` | Delete selection | `delete_selection` |
6767| `c` | Change selection (delete and enter insert mode) | `change_selection` |
6868
69+#### Shell
70+
71+| Key | Description | Command |
72+| ------ | ----------- | ------- |
73+| <code>|</code> | Pipe each selection through shell command, replacing with output | `shell_pipe` |
74+| <code>A-|</code> | Pipe each selection into shell command, ignoring output | `shell_pipe_to` |
75+| `!` | Run shell command, inserting output before each selection | `shell_insert_output` |
76+| `A-!` | Run shell command, appending output after each selection | `shell_append_output` |
77+
78+
6979### Selection manipulation
7080
7181| Key | Description | Command |
@@ -87,17 +97,10 @@
8797| | Expand selection to parent syntax node TODO: pick a key | `expand_selection` |
8898| `J` | Join lines inside selection | `join_selections` |
8999| `K` | Keep selections matching the regex TODO: overlapped by hover help | `keep_selections` |
100+| `$` | Pipe each selection into shell command, keep selections where command returned 0 | `shell_keep_pipe` |
90101| `Space` | Keep only the primary selection TODO: overlapped by space mode | `keep_primary_selection` |
91102| `Ctrl-c` | Comment/uncomment the selections | `toggle_comments` |
92103
93−### Insert Mode
94−
95−| Key | Description | Command |
96−| ----- | ----------- | ------- |
97−| `Escape` | Switch to normal mode | `normal_mode` |
98−| `Ctrl-x` | Autocomplete | `completion` |
99−| `Ctrl-w` | Delete previous word | `delete_word_backward` |
100−
101104### Search
102105
103106> TODO: The search implementation isn't ideal yet -- we don't support searching
@@ -110,38 +113,11 @@ in reverse, or searching via smartcase.
110113| `N` | Add next search match to selection | `extend_search_next` |
111114| `*` | Use current selection as the search pattern | `search_selection` |
112115
113−### Unimpaired
114−
115−Mappings in the style of [vim-unimpaired](https://github.com/tpope/vim-unimpaired)
116−
117−| Key | Description | Command |
118−| ----- | ----------- | ------- |
119−| `[d` | Go to previous diagnostic | `goto_prev_diag` |
120−| `]d` | Go to next diagnostic | `goto_next_diag` |
121−| `[D` | Go to first diagnostic in document | `goto_first_diag` |
122−| `]D` | Go to last diagnostic in document | `goto_last_diag` |
123−| `[space` | Add newline above | `add_newline_above` |
124−| `]space` | Add newline below | `add_newline_below` |
125−
126−### Shell
116+### Minor modes
127117
128−| Key | Description | Command |
129−| ------ | ----------- | ------- |
130−| `\|` | Pipe each selection through shell command, replacing with output | `shell_pipe` |
131−| `A-\|` | Pipe each selection into shell command, ignoring output | `shell_pipe_to` |
132−| `!` | Run shell command, inserting output before each selection | `shell_insert_output` |
133−| `A-!` | Run shell command, appending output after each selection | `shell_append_output` |
134−| `$` | Pipe each selection into shell command, keep selections where command returned 0 | `shell_keep_pipe` |
135−
136−## Select / extend mode
137−
138−I'm still pondering whether to keep this mode or not. It changes movement
139−commands to extend the existing selection instead of replacing it.
140−
141−> NOTE: It's a bit confusing at the moment because extend hasn't been
142−> implemented for all movement commands yet.
118+These sub-modes are accessible from normal mode and typically switch back to normal mode after a command.
143119
144−## View mode
120+#### View mode
145121
146122View mode is intended for scrolling and manipulating the view without changing
147123the selection.
@@ -155,7 +131,7 @@ the selection.
155131| `j` | Scroll the view downwards | `scroll_down` |
156132| `k` | Scroll the view upwards | `scroll_up` |
157133
158−## Goto mode
134+#### Goto mode
159135
160136Jumps to various locations.
161137
@@ -177,7 +153,7 @@ Jumps to various locations.
177153| `i` | Go to implementation | `goto_implementation` |
178154| `a` | Go to the last accessed/alternate file | `goto_last_accessed_file` |
179155
180−## Match mode
156+#### Match mode
181157
182158Enter this mode using `m` from normal mode. See the relavant section
183159in [Usage](./usage.md) for an explanation about [surround](./usage.md#surround)
@@ -192,11 +168,9 @@ and [textobject](./usage.md#textobject) usage.
192168| `a` `<object>` | Select around textobject | `select_textobject_around` |
193169| `i` `<object>` | Select inside textobject | `select_textobject_inner` |
194170
195−## Object mode
196−
197171TODO: Mappings for selecting syntax nodes (a superset of `[`).
198172
199−## Window mode
173+#### Window mode
200174
201175This layer is similar to vim keybindings as kakoune does not support window.
202176
@@ -207,9 +181,9 @@ This layer is similar to vim keybindings as kakoune does not support window.
207181| `h`, `Ctrl-h` | Horizontal bottom split | `hsplit` |
208182| `q`, `Ctrl-q` | Close current window | `wclose` |
209183
210−## Space mode
184+#### Space mode
211185
212−This layer is a kludge of mappings I had under leader key in neovim.
186+This layer is a kludge of mappings, mostly pickers.
213187
214188| Key | Description | Command |
215189| ----- | ----------- | ------- |
@@ -226,6 +200,36 @@ This layer is a kludge of mappings I had under leader key in neovim.
226200| `Y` | Yank main selection to clipboard | `yank_main_selection_to_clipboard` |
227201| `R` | Replace selections by clipboard contents | `replace_selections_with_clipboard` |
228202
203+
204+#### Unimpaired
205+
206+Mappings in the style of [vim-unimpaired](https://github.com/tpope/vim-unimpaired).
207+
208+| Key | Description | Command |
209+| ----- | ----------- | ------- |
210+| `[d` | Go to previous diagnostic | `goto_prev_diag` |
211+| `]d` | Go to next diagnostic | `goto_next_diag` |
212+| `[D` | Go to first diagnostic in document | `goto_first_diag` |
213+| `]D` | Go to last diagnostic in document | `goto_last_diag` |
214+| `[space` | Add newline above | `add_newline_above` |
215+| `]space` | Add newline below | `add_newline_below` |
216+
217+## Insert Mode
218+
219+| Key | Description | Command |
220+| ----- | ----------- | ------- |
221+| `Escape` | Switch to normal mode | `normal_mode` |
222+| `Ctrl-x` | Autocomplete | `completion` |
223+| `Ctrl-w` | Delete previous word | `delete_word_backward` |
224+
225+## Select / extend mode
226+
227+I'm still pondering whether to keep this mode or not. It changes movement
228+commands (including goto) to extend the existing selection instead of replacing it.
229+
230+> NOTE: It's a bit confusing at the moment because extend hasn't been
231+> implemented for all movement commands yet.
232+
229233# Picker
230234
231235Keys to use within picker. Remapping currently not supported.