~
All configs are in my dotfiles.
Search current word: *
Search multiple words:
:/\vword1|word2|word3
Replace word:
:%s/word1/word2/g
Delete all lines contain word:
:g/word/d
Delete all lines not contain word:
:g!/word/d
:v/word/d
Play macro a (after selecting lines):
:norm! @a
Sort lines (after selecting lines):
:sort -u
Reverse lines (after selecting lines):
:!tail -r
Column-ize lines:
:!column -t
Basic:
gg: first lineG: last line0: first character of line$: last character of linew, b: word forward/backwarde, ge: end of word current/beforeW, B: WORD (word with special char)
forward/backward
E, gE: end of WORD current/beforef{char}, F{char}: find forward/backward
character
%: jump between matching pair of (),
[], {}
Advance:
CTRL-O, CTRL-I: cursor position
backward/forward
{, }: paragraph backward/forwardUse both \ and ; as leader key:
vim.keymap.set("n", ";", "<Leader>", { remap = true })
vim.keymap.set("n", "'", "<Leader>", { remap = true })
Ground rules:
<Leader> prefix: prefer global keymap
<Space> prefix: prefer lsp keymap, for coding of
course :D
Native neovim:
gcc: comment/uncomment current linegc: comment/uncomment selected linesgx: open file/url under cursorQ, @: execute last macro]d, [d: next/previous diagnosticK: hoverBlack hole register:
<Leader>d: d without yank<Leader>c: c without yank<Leader>x: x without yankWith folke/snacks.nvim:
<Leader>f: find files<Leader>l: find lines<Leader>rg: grep files<Space>s: list lsp symbols<Space>r, gr: list references
<Space>i: list implementationWith saghen/blink.cmp:
<C-Space>: trigger completion:A: open alternate fileib, ab: inside, outside brackets
iq, aq: inside, outside quotes<C-n>: toggle<Leader>n: locate file]H, [H, ]h,
[h: next/previous hunk git change
sa: add surroundsd: delete surroundsr: replace surroundWith stevearc/conform.nvim:
<Space>f: format codeWith neovim/nvim-lspconfig:
<Space>e: current diagnostic<Space>ca: list code actiongd: go to definition<Space>k, gk: hover<F2>: renameWith ggml-org/llama.vim or zbirenbaum/copilot.lua:
<M-Right>: completion, to not conflict with
Tab