add Pandoc to create PDF cheat sheet

This commit is contained in:
Oliver Ladner 2024-03-05 09:32:10 +01:00
commit 73eea67048
6 changed files with 327 additions and 25 deletions

View file

@ -1,7 +1,5 @@
# Neovim command and keybind cheat sheet
Some of these are plain Vim commands, others are specific to Neovim.
## BASICS
- `Space` leader key
@ -19,8 +17,7 @@ Some of these are plain Vim commands, others are specific to Neovim.
## Tabs
- `Ctrl`+`t` open a file in e.g. a Telescope finder in a new tab
- `gt` or `gT` switch between open tabs (forward/reverse direction)
- `gt` or `gT` switch forward/reverse between tabs
## Windows/splits
@ -39,39 +36,34 @@ Some of these are plain Vim commands, others are specific to Neovim.
- `:bn` go to next buffer
- `:bp` go to previous buffer
## Code
## Text
- `w` move to **start of next word** (ignores punctuation due to remap)
- `e` move to **end of next word** (ignores punctuation due to remap)
- `b` move to **start of previous word** (ignores punctuation due to remap)
- `Ctrl`+`0` start of line
- `Ctrl`+`$` end of line
- `Ctrl`+`d` scroll **down** 1/2 page while keeping the cursor centered
- `Ctrl`+`u` scroll **up** 1/2 page while keeping the cursor centered
- `Ctrl`+`d` scroll down 1/2 page while keeping the cursor centered
- `Ctrl`+`u` scroll up 1/2 page while keeping the cursor centered
- `Ctrl`+`o` jump to location you were before (e.g. after using `gg`)
- `Ctrl`+`i` jump back to location you were before (after using `Ctrl`+`o`)
- `f<char>` jump forward to `<char>`
- `F<char>` jump backwards to `<char>`
- `t<char>` jump forward just before `<char>`
- `T<char>` jump backwards just before `<char>`
- `;` jump to next occurence of <char> (same line only)
- `,` jump to previous occurence of <char> (same line only)
- `;` jump to next occurence of <char> on same line
- `,` jump to previous occurence of <char> onx same line
## LSP
## LSP, Code & Diagnostics
- `Ctrl`+`n/p` scroll down/up through LSP suggestions
- `Ctrl`+`l` accept selected suggestion
- `gd` go to definition
## Diagnostics
- `gd` go to definition
- `leader`+`qq` toggle trouble.nvim quickfix list
- `gr` show references of function
- `leader`+`qq` toggle `trouble.nvim` quickfix list
- `leader`+`da` go to next diagnostic (any severity)
- `leader`+`dw` go to next diagnostic (warning severity)
- `leader`+`de` go to next diagnostic (error severity)
## Telescope windows
## Telescope
- `↓` or `Ctrl`+`n` scroll down (**n**ext) file list
- `↑` or `Ctrl`+`p` scroll up (**p**revious) file list
@ -84,26 +76,35 @@ Some of these are plain Vim commands, others are specific to Neovim.
- `Ctrl`+`q` send all items to quickfix list
- `Alt`+`q` send selected items to quickfix list
## Oil
- `Ctrl`+`d` bottom of file list
- `Ctrl`+`u` top of file list
- `Ctrl`+`p` preview file
- `Ctrl`+`v` open file in **vertical** split
- `Ctrl`+`x` open file in **horizontal** split
- `Ctrl`+`t` open file in new tab
## EDITING
### Code editing
- `leader`+`i` re-indent whole file
- `leader`+`o` re-format whole file or visual with `conform.nvim`
- `leader`+`o` re-format whole file or visual w/ `conform.nvim`
- `i` insert mode at cursor position
- `I` insert mode at the **beginning of the line**
- `a` insert mode **one character after the current** one
- `A` insert mode at the **end of the line**
- `I` insert mode at **beginning of line**
- `a` insert mode **after the current char**
- `A` insert mode at **end of line**
- `o` insert mode a line **below** the cursor
- `O` insert mode a line **above** the cursor
- `s` delete character and replace (substitute) it
- `cw` replace the current word
- `cc` replace whole line
- `C` replace to the end of the line
- `yy` copy (yank) the current line
- `yy` copy the current line
- `p` paste yanked line below
- `P` paste yanked line above
- `"3p` redo (put) e.g. your third last delete [source](https://www.reddit.com/r/neovim/comments/18ri1bm/its_been_like_10_years_and_i_just_learned_that/)
## SELECTING
### Visual mode
@ -111,6 +112,11 @@ Some of these are plain Vim commands, others are specific to Neovim.
- `V` line mode
- `Ctrl`+`v` block mode
### Code selection
- `leader`+`Space` context-sensitive text selection w/ `treesitter`
- `Backspace` reduce context-sensitive selection
## SEARCH/OPEN
- `leader`+`fg` search text in files (also searches for text under cursor)