How do I reference just the filename without its extension in a Vim command?
%:r
The %:r expression expands to the current filename with its extension removed (the "root" of the filename).
245 results for ""+p"
%:r
The %:r expression expands to the current filename with its extension removed (the "root" of the filename).
:set complete=.,w,b,t
Default keyword completion can feel noisy in large projects because Vim may scan extra sources you do not care about in the moment.
:lua = {expression}
In Neovim, :lua = expr is a shorthand that evaluates a Lua expression and pretty-prints the result using vim.
<C-r><C-o>a
When you paste multiline snippets from a register while in Insert mode, default insertion can trigger indentation and formatting side effects line by line.
registers #registers #insert-mode #formatting #indentation #editing
:'<,'>copy'>
How it works The :copy command (or its abbreviation :t) duplicates lines to a specified destination.
:setlocal statusline=%f\ %m\ %y\ [%l/%L]
The :setlocal statusline command lets you override the global statusline for a specific window.
:lua =expr
In Neovim, prefixing a Lua expression with = on the :lua command line evaluates it and pretty-prints the result using vim.
"/
Vim stores the last search pattern in the special / register.
<C-r><C-r>a
In insert mode, a pastes register a but processes the text as if typed, which can trigger abbreviations and mappings.
"_d{motion}
Vim's black hole register (") acts as a write-only sink: anything sent to it is discarded without affecting any other register, including the unnamed register (
<C-x>s
When spell checking is enabled (:set spell), s in insert mode opens a popup menu of suggested corrections for the most recently flagged misspelled word — with
:cdo normal! @q
When a refactor target spans many files but only specific matches matter, running a macro globally is risky.
:let @a = "value"
The :let @{reg} = expr command lets you assign any string or expression directly into a named register without entering insert mode or performing a yank.
<C-r>/
Vim stores your last search pattern in the / register.
<C-y> / <C-e>
When typing in insert mode, you can pull individual characters from adjacent lines without leaving insert mode.
:g/pattern1/g/pattern2/command
Vim's :g command can be nested — the command part of one :g can itself be another :g.
set completeopt+=fuzzy
Neovim 0.
<C-x><C-o>
The keystroke triggers omni completion, Vim's built-in language-aware completion system.
:let @a = system('cmd')
You can populate any Vim register with the output of an external shell command using :let @{register} = system('{command}').
:set pastetoggle=<F2>
The pastetoggle option assigns a single key to toggle Vim's paste mode on and off without typing :set paste or :set nopaste every time.