How do I enable LSP and treesitter-powered code folding in Neovim with nvim-ufo?
:lua require('ufo').openAllFolds()
nvim-ufo is a Neovim plugin that replaces the built-in fold system with one powered by LSP (textDocument/foldingRange) or treesitter.
Search Vim Tricks
Searching...:lua require('ufo').openAllFolds()
nvim-ufo is a Neovim plugin that replaces the built-in fold system with one powered by LSP (textDocument/foldingRange) or treesitter.
:lua require('flash').jump()
flash.
:lua require('harpoon.mark').add_file()
Harpoon by ThePrimeagen is a Neovim plugin that maintains a small, numbered list of the files you're actively working on.
:s/pattern/\U&/g
Vim's :substitute command supports case-transformation escape sequences in the replacement string.
search #search #substitute #ex-commands #editing #text-objects
:s/pattern/replacement/e
The e flag in Vim's :substitute command silently ignores the "E486: Pattern not found" error when the pattern does not match anything.
<C-@>
Pressing (Ctrl + @, which is the NUL character) in insert mode inserts the same text that was typed during the most recent insert session, then immediately retu
:wundo {file}
The :wundo {file} command writes the current buffer's entire undo history to a file on disk.
<Up>
In Vim's command line, and navigate history in prefix-filtered mode — they only cycle through past commands that begin with whatever you have already typed.
<C-x><C-v>
The key sequence in insert mode triggers Vim command-line completion — the same completion engine used at the : command prompt.
:%center 80
Vim has three built-in Ex formatting commands — :left, :center, and :right — that align text within a specified column width.
:diffget //2
When resolving Git merge conflicts with vim-fugitive, running :Gvdiffsplit! opens a 3-way split: your current branch (left), the working file with conflict mark
ysiwf
vim-surround's f and F surrounds let you wrap any text object inside a function call, prompting you for the function name.
:0Gclog
vim-fugitive's :Gclog command loads the git log into the quickfix list, but when prefixed with the range 0 it restricts the history to only the commits that tou
:let @a = substitute(@a, "old", "new", "g")
When a recorded macro has a typo or wrong command buried inside it, you don't have to re-record the entire thing.
:set cursorlineopt=number
When cursorline is enabled, Vim highlights the entire line the cursor is on.
:g/outer/,/end/g/inner/
The :global command accepts a range, which lets you scope its search to sections of the file rather than the entire buffer.
:xmap
:vmap applies to both visual mode and select mode, which can silently break snippet plugins (like UltiSnips, LuaSnip) that use select mode to position the curso
z.
Vim has two flavors of each screen-repositioning command: one that only moves the view and one that also repositions the cursor.
:put {reg}
The :put Ex command always inserts a register's content as a new line below the current line, regardless of whether the register holds characterwise, linewise,
editing #registers #editing #paste #ex-commands #normal-mode
:set regexpengine=1
Vim ships with two regex engines and lets you control which one is used.