- Go to last opened file
Ctrl-^
:help ...
:checkhealth
-
:LspInstallInfo
-
:LspInstall python
-
:LspInfo
- to show currently active LSP for file
-
Go to line with error:
gl
-
Hover over code piece and get info on in
Shift+K
-
Show all references of code under cursor
gr
- https://github.com/nanotee/nvim-lua-guide
:help lua-guide
- Duplicate lines matching a pattern
:g/pattern/copy .
- Indent all lines matching a pattern
:g/pattern/>
- Add new line after all lines matchin a pattern
and insert text on that line
:g/pattern|copy .|s/.*/text to insert
- Indent lines containing multiple patterns
:g/patter1\|pattern2/>
- Check keymaps.lua
:Telescope keymaps
- Go into visual block mode (Ctrl + v) or visual line (Shift + v)
- j/k to select lines
- Shift + j/k: move selected lines up/down
- line:
gcc
orCtrl + /
- multi-line:
gc
orCtrl + /
- "~/.local/share/nvim/site/pack/packer/start/"
:Glow
:messages
:MarkdownPreview
:s/hello/world/g
: replace all instances ofhello
withworld
on current line:%s/hello/world
: replace all instances ofhello
withworld
:%s/\s+-->.*/
: delete<whitespace>--><everything>
on all lines%
: apply to all lines\s+
: one or more whitespace characters-->
: matches-->
.*
: matches every character
q<where to store the macro>
, exampleqj
@<where the macro was stored>
, example@j
:Gitsigns diffthis
: show git diff
Ctrl+]
: make current folder root
Ctrl+v
: right/left splitCtrl+x
: top/bottom split
Tab
: next insertionShift-Tab
: previous insertion
Ctrl + up/down
add cursors
D
: delete from cursor position to end of line; without copying the newline charp
set foldmethod=indent
za
to fold/unfold
keymap is set in handlers.lua: gl
echo "Hi" | vim -
- Example: different tabstop for
cpp
files:- https://www.reddit.com/r/neovim/comments/vwsm89/different_tab_sizes_for_each_language/
- Add file
nvim/ftplugin/cpp.lua
Hover over function and press Shift-k
twice.
To exit: press Ctrl-k
:noh
turn off highlighting until next search
gww