-
Notifications
You must be signed in to change notification settings - Fork 0
Neovim
shyun3 edited this page Oct 14, 2025
·
6 revisions
Useful Neovim stuff I keep forgetting about.
Listed in order of occurrence.
-
BufNewFile: only triggered if file given as argument doesn't exist -
BufReadPre: only triggered if file was specified as argument -
FileType: only triggered if the opened file has a type BufWinEnterBufEnterVimEnterUIEnterVeryLazyLspAttach
Unless otherwise pointed out above, it does not seem worth lazily loading plugins based on events that occur earlier than UIEnter since those will be always be triggered.
-
CmdlineEnter: also triggered with searches orinput()calls -
ModeChanged: useful for lazily loading text object plugins
LSP client configurations can be specified in dedicated Lua files, see docs.
An example is available here.
-
g<C-g>: Display word count (among other info)
-
Q: Repeats the last recorded register (not necessarily the last executed register)
-
<C-w><C-v>: Split current window vertically
-
<C-\><C-n>: Return to normal mode
-
g<C-a>: Add to numbers in highlighted text, creating an incrementing sequence if several lines are highlighted
-
\C: Force match case