## normal mode This is the main mode from where you can interact with the editor. It's probably where you'll be most of the time. From here you can enter any other mode and it's where other modes normally get back to. It's also from where you do most of code navigation and seleciton manipulation. ### navigation | keys | action | | --- | --- | | `h`, `j`, `k`, `l` | move cursors | | `w`, `b` | move cursors forward/back by word | | `e` | move cursors forward to the end of the word | | `n`, `p` | move main cursor to next/previous search match | | `N`, `P` | add cursor to the next/previous search match if inside a search range or make a new one | | ``, `` | go to next/previous cursor position in history | | `gg` | go to line | | `gh`, `gl`, `gi` | move cursors to first/last/first-non-blank columns | | `gk`, `gj` | move cursors to first/last line | | `gm` | move cursors to matching bracket | | `go` | fuzzy pick an opened buffer | | `gb` | open previous buffer (if any) | | `gB`, `GB` | open the buffer that is open in the previously focused client, then that client opens its previous buffer | | `gf` | if the filepath under the cursor exists, open it as a buffer | | `gF`, `GF` | if the filepath under the cursor exists, open it as a buffer, then close the current buffer | | `xx` | toggle breakpoints on all lines covered by cursors | | `xX`, `XX` | remove breakpoints on all lines covered by cursors | | `xB`, `XB` | remove all breakpoints on current buffer | | `xA`, `XA` | remove all breakpoints on all buffers | | `]]`, `[[` | move cursors to next/previous `` (inclusive) | | `][`, `[]` | move cursors to next/previous `` (exclusive) | | `}`, `{` | repeat last find char in forward/backward mode | | ``, `` | move cursors half page down/up | | ``, `` | move cursors to next/previous blank line | | `s` | enter search mode | | `zz`, `zj`, `zk` | scroll to center main cursor or frame the main cursor on the bottom/top of screen | | `q` | begin recording macro to register `` | | `Q` | executes keys recorded in register `` | | `m` | save current buffer and main cursor position as a marker on register `` | | `M` | go to marker on register `` (if it's a valid marker) | | `rn`, `rp` | move to next/previous lint (provided by a plugin) | **NOTE**: the register `a` always contains the last selection+edit keys. | binding | expands to | action | | --- | --- | --- | | `o` | `:-find-file` | fuzzy pick a file | | `f` | `:-find-pattern` | workspace wide search | ### text-object | keys | action | | --- | --- | | `aw`, `aW` | select word object | | `a(`, `a)`, `a[`, `a]`, `a{`, `a}`, `a<`, `a>` | select region inside brackets (exclusive) | | a|, `a"`, `a'`, `` a` `` | select region delimited by a pair of these brackets on the same line (exclusive) | | `Aw`, `AW` | select word object including surrounding whitespace | | `A(`, `A)`, `A[`, `A]`, `A{`, `A}`, `A<`, `A>` | select region inside brackets (inclusive) | | A|, `A"`, `A'`, `` A` `` | select region delimited by a pair of these brackets on the same line (inclusive) | ### selection | keys | action | | --- | --- | | `v` | toggle selection mode | | `V` | expand selections to either start or end of lines depending on their orientation | | `cv` | force enter selection mode | | `cV`, `CV` | force exit selection mode | ### cursor manipulation | keys | action | | --- | --- | | `cc` | swap the anchor and position of all cursors | | `cC`, `CC` | orientate all cursors such that their anchors come before their positions | | `cd` | remove main cursor if there's more than one cursor | | `cD`, `CD` | clear all extra cursors and keep only the main cursor | | `cl` | splits all selection in lines | | `cj`, `ck` | add a new cursor to the line bellow/above the bottom/top cursor | | `cn`, `cp` | set next/previous cursor as main cursor | | `cs` | search inside selections and only keep those ranges | | `cS`, `CS` | search inside selections and remove those ranges | | `cf` | filter selections and keep the ones that contain the search | | `cF`, `CF` | filter selections and keep the ones that do not contain the search | | binding | expands to | action | | --- | --- | --- | | ``, `` | `cdcVs` | keep only main cursor, remove selections, exit selection mode and clears search highlight | | `.` | `Qa` | executes auto recorded macro | ### editing | keys | action | | --- | --- | | `d` | delete selected text | | `i` | delete selected text and enter insert mode | | `<`, `>` | indent/dedent selected lines | | `=` | fix indent on selected lines | | `y` | copy selected text to clipboard | | `Y` | delete selected text and paste from clipboard | | `` | copy selected text to register `` | | `` | delete selected text and paste the contents of register `` | | `u`, `U` | undo/redo | | binding | expands to | action | | --- | --- | --- | | `I`, `` | `dgii`, `dgli` | move cursors to first non-blank/last column and enter insert mode | | `ci` | `cvcCglccgii` | delete all lines touching a selection and enter insert mode | | `o`, `O` | `dgli`, `dgii` | create an empty line bellow/above each cursor and enter insert mode | | `J` | `djgivkgli` | join one line bellow each cursor | | `!` | `:-spawn` | execute a command line (with closed stdin and ignoring its output) | | | | `:-replace-with-output` | pass each selection as stdin to a command line and substitute each for its stdout | ## insert mode Insert new text to the current buffer. | keys | action | | --- | --- | | ``, `` | enter normal mode | | ``, ``, ``, `` | move cursors | | `` | insert `` to the left of every cursor | | ``, `` | insert line break to the left of every cursor | | ``, `` | delete char backward | | `` | delete char forward | | `` | delete word backward | | ``, `` | apply next/previous completion | ## command mode Perform actions not directly related to editing such as: open/save/close buffer, change settings, execute external programs, etc. In order to enter command mode, type `:` while in normal mode. When the input is empty, you can navigate through history with `` and ``. **NOTE**: if a command starts with a space, it will not be recorded to the command history. Also, `` and `` will choose from the autocomplete entries. See the [command reference](command_reference.md).