How do I complete keywords using only the current buffer as the source?
<C-x><C-n>
triggers keyword completion that searches only the current buffer for matches, scanning forward from the cursor.
170 results for ":help"
<C-x><C-n>
triggers keyword completion that searches only the current buffer for matches, scanning forward from the cursor.
:set wildmode=longest:full,full
The wildmode option controls what happens when you press in the command line.
vim.lsp.completion.enable()
Neovim 0.
:set winheight=999 winminheight=5
Setting winheight to a very large number forces Vim to always try to make the focused window as tall as possible.
:set wildcharm=<C-z>
The wildchar option (default ) triggers wildcard completion interactively on the command line.
<Cmd>
The pseudo-key in Neovim allows a mapping to execute an Ex command directly, without going through command-line mode.
:packadd justify | :'<,'>Justify 72
Vim can wrap text, but full left-and-right justification is a different task.
plugins #plugins #formatting #visual-mode #text-manipulation
:set switchbuf+=uselast
When jumps open the target buffer in an unexpected split, context switching gets expensive.
:verbose map <key> or :verbose set option?
The :verbose prefix shows where a mapping, setting, command, or function was defined — which file and line number.
command-line #command-line #debugging #config #mappings #workflow
grr
Since Neovim 0.
:colder / :cnewer
Vim remembers up to 10 previous quickfix lists.
:s/pattern/\=expr/g
Vim's :s command normally replaces matches with a literal string.
command-line #search #editing #ex-commands #command-line #registers
/pattern/+N or /pattern/-N
Vim's search command accepts an offset that places your cursor on a line relative to the match.
:set operatorfunc=MyFunc<CR>g@{motion}
Vim's operatorfunc and g@ let you define custom operators that accept any motion or text object, just like built-in operators d, c, and y.
% (in netrw)
Vim's built-in file explorer netrw (opened with :Explore or :Ex) is more capable than it looks.
:let g:netrw_liststyle = 3
By default, netrw shows files in a flat listing.
plugins #netrw #file-browser #plugins #configuration #built-in
:filter /pattern/ {command}
:filter /pattern/ {command} runs any Ex command but suppresses every output line that does not match the pattern.
:set splitright splitbelow
By default, :split opens a new window above the current one and :vsplit opens to the left — the opposite of most modern IDEs and editors.
:bufdo {cmd}
:bufdo executes an Ex command in each open buffer in sequence, cycling through every buffer in the buffer list.
:g/pattern/cmd1 | cmd2
The :g (global) command can execute multiple Ex commands per matching line by chaining them with .
command-line #command-line #global #ex-commands #batch-editing #advanced