# Nvim config. TODO: preserve default shortcuts, only add new ones when adding new functionality. TODO: Generate all this similar to the bash `doc_bash`. ## General info. * Run `:Update` to update everything. * File tree shows everything by default, telescope ingores git-ignored files. ## Keymaps. ### Common. TODO: separate visual and others from common. Mode|Key|Action ---|---|--- Normal, Visual|`5dd`|Repeat following command N (5) times. Normal|`.`|Repeat input on selected line. Normal, Visual|`.`|Repeat command on selected line(s). Normal|`zz`|Save all files. Normal|`ZZ`, `z`|Save all and quit. Normal|`ZQ`|Quit without saving. Normal|`v`, `v`|Visual selection (cursor). Normal|`V`|Visual selection (lines). Normal|``|Visual selection (block). Normal|`gh`|Go to the start of the line. Normal|`gl`|Go to the end of the line. Normal|`gj`|Go to the end of the file. Normal|`gk`|Go to the top of the file. Normal|`u`|Undo action. Normal|`U`|Redo action (*remaps*: undo whole line), (*default*: ``). Visual|`u`|Convert selection to lowercase. Visual|`U`|Convert selection to uppercase. Visual|`~`|Toggle case. Normal, Visual|`;`|Enter command mode (*default*: `:`). Normal|`0`|Open shortcuts help. ### Align. Mode|Key|Action ---|---|--- Visual|`A`|Align selection from the right. Visual|`a`|Align selection from the left. ### Autocomplete. Mode|Key|Action ---|---|--- Input|``|Autocomplete. Normal|``|LSP autocomplete. ### Comments. Mode|Key|Action ---|---|--- Normal, Visual|`/`|Toggle selected line(s) comment. ### File tree. Mode|Key|Action ---|---|--- Normal|`1`|Toggle file tree. Normal|``|Toggle directory or open file for preview. Normal|`a`|Create file/directory. Normal|`x`|Cut file/directory. Normal|`p`|Paste file/directory. Normal|`f`|Filter. Normal|`F`|Reset filter. Normal|`d`|Delete file/directory. Normal|`r`|Rename file. Normal|`R`|Refresh. Normal|`s`|Open in system app. Normal|`S`|Search. Normal|`I`|Toggle gitignore filter. Normal|`y`|Copy name. Normal|`Y`|Copy relative path. ### Fold. Mode|Key|Action ---|---|--- Normal|`o`|Toggle fold. Normal|`O`|Fold everything. ### Git. Mode|Key|Action ---|---|--- Normal|`g`|Toggle git inspection mode. ### Macros. Mode|Key|Action ---|---|--- Visual|`mwx`|Unwrap selection (select the stuff inside wraps). Visual|`mw"`|Wrap selection in ". Visual|`mw3"`|Wrap selection in 3x ". Visual|`mw'`|Wrap selection in '. Visual|`mw(`|Wrap selection in (). Visual|`mw{`|Wrap selection in {}. Visual|`mw[`|Wrap selection in []. Visual|`` mw` ``|Wrap selection in \`. Visual|`` mw3` ``|Wrap selection in 3x \`. Visual|`mw*`|Wrap selection in *. Visual|`mw2*`|Wrap selection in 2x *. Visual|`mw3*`|Wrap selection in 3x *. Visual|`mw `|Wrap selection in spaces. Normal, Visual|`mmx`|Markdown: set - [ ] as completed. Normal, Visual|`mm `|Markdown: set - [x] as not completed. Normal|`mmp`|Markdown: insert paragrapg (2x non-breakable spaces). Visual|`mmb`|Markdown: make selection bold. Visual|`mmi`|Markdown: make selection italic. Visual|`mms`|Markdown: make selection strikethrough. Visual|`mmr`|Markdown: make selection a reference. Visual|`mmc`|Markdown: make selection a code block. Normal|`mi`|Copy and increment selected line. Normal|`ma`|Select all. ### Navigation. Mode|Key|Action ---|---|--- Normal|`w`|Switch to the split above. Normal|`a`|Switch to the split left. Normal|`s`|Switch to the split below. Normal|`d`|Switch to the split right. Normal|`q`|Swtich to the buffer left. Normal|`e`|Swtich to the buffer right. Normal|`Q`|Move the buffer left. Normal|`E`|Move the buffer right. Normal|`x`|Close the buffer. Normal|`X`|Close all invisible buffers. Normal|`m`|Move split. Normal|`\|`|Split vertically. Normal|`-`|Split horizontally. Normal|`c`|Close split. Input|``|Move left. Input|``|Move right. Input|``|Move down. Input|``|Move up. ### Telescope. Mode|Key|Action ---|---|--- Normal|`ff`|Find files. Normal|`fg`|Find grep (find text within files). Normal|`fb`|Find buffer. Normal|`fh`|Find help. Normal|`ft`|Find treesitter (vars, functions etc). Normal|`fa`|Find all (default treesitter window). ### Terminal. Mode|Key|Action ---|---|--- Normal|`4`|Open terminal. Terminal|``|Detach from terminal. ### To-do. Write `TODO:` or `NOTE:` to make it searchable. Mode|Key|Action ---|---|--- Normal|`3`|Open to-do list. ### Trouble. Mode|Key|Action ---|---|--- Normal|`2`|Open LSP trouble list. ### Which key. Mode|Key|Action ---|---|--- Normal|`0`|Show context hotkey help. ### Window management. Mode|Key|Action ---|---|--- Normal|`-`|Decrease split size vertically. Normal|`_`|Increase split size vertically. Normal|`\`|Decrease split size horizontally. Normal|`\|`|Increase split size horizontally. Normal|`=`|Equalize split sizes.