reformat cheat sheet

This commit is contained in:
Oliver Ladner 2024-01-19 08:14:11 +01:00
commit 9625bb2519

View file

@ -2,20 +2,32 @@
Some of these are plain Vim commands, others are specific to Neovim.
## Basics
## BASICS
- `Space` leader key
### Plugins
- `:so` Source file
- `:checkhealth` check base and all plugins
- `:checkhealth <pluginname>` check for problems of a plugin
- `:Lazy` show package manager UI
- `:Mason` show Mason UI
- `:verbose set expandtab?` check where `expandtab` has been set last
## Navigation
### Lazy
- `:Lazy` show package manager UI
### Mason
- `:Mason` show Mason UI
### Treesitter
- `:TSUpdate` update all parsers
- `:TSModuleInfo` show installed parsers
### LSP
- `:LspInfo` show currently attached LSP client details
## NAVIGATION
## Tabs
@ -32,11 +44,14 @@ Use buffers in situations where
- `Ctrl`+`<h/j/k/l>` move between split windows
- `Ctrl`+`w=` equalize split window width and height
- `Ctrl`+`wr` swap position of two windows
- `Ctrl`+`wT` move active split window to new tab
## Buffer
- `Space`+`Space` shows open buffers (via `Telescope buffers`)
- `Space`+`Space` shows buffers sorted by last used (via `Telescope buffers`)
- `:bd` close current buffer
- `:bn` go to next buffer
- `:bp` go to previous buffer
## Code
@ -46,7 +61,18 @@ Use buffers in situations where
- `Ctrl`+`d` scroll **down** 1/2 page while keeping the cursor centered
- `Ctrl`+`u` scroll **up** 1/2 page while keeping the cursor centered
## Editing
## Telescope windows
- `↓` or `Ctrl`+`n` scroll down (**n**ext) file list
- `↑` or `Ctrl`+`p` scroll up (**p**revious) file list
- `Ctrl`+`d` scroll **d**own in preview pane
- `Ctrl`+`u` scroll **u**p in preview pane
- `Ctrl`+`/` help
- `Ctrl`+`v` open file in **vertical** split
- `Ctrl`+`x` open file in **horizontal** split
- `Ctrl`+`t` open file in new tab
## EDITING
### Code editing
@ -60,6 +86,8 @@ Use buffers in situations where
- `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
- `p` paste yanked line below
- `P` paste yanked line above
@ -71,29 +99,9 @@ Use buffers in situations where
- `V` line mode
- `Ctrl`+`v` block mode
## Search files or text
## SEARCH
- `leader`+`fg` search text in files (also searches for text under cursor)
- `leader`+`ff` search files (respects `.gitignore`)
- `leader`+`e` file browser (disregards `.gitignore`)
- `leader`+`fo` recently opened files
### Navigation in Telescope live_grep, find_files, git_status and file_browser
- `↓` or `Ctrl`+`n` scroll down (**n**ext) file list
- `↑` or `Ctrl`+`p` scroll up (**p**revious) file list
- `Ctrl`+`d` scroll **d**own in preview pane
- `Ctrl`+`u` scroll **u**p in preview pane
- `Ctrl`+`/` help
- `Ctrl`+`v` open file in **vertical** split
- `Ctrl`+`x` open file in **horizontal** split
- `Ctrl`+`t` open file in new tab
### Treesitter
- `:TSUpdate` update all parsers
- `:TSModuleInfo` show installed parsers
### LSP
- `LspInfo` show attached LSP client info