How do I change the filename associated with the current buffer in Vim without saving to disk?
:file {newname}
:file {newname} (short form: :f {newname}) changes the filename Vim associates with the current buffer.
2277 results for "@a"
:file {newname}
:file {newname} (short form: :f {newname}) changes the filename Vim associates with the current buffer.
vim.lsp.status()
vim.
<Leader>hs / <Leader>hu
The vim-gitgutter plugin shows Git diff markers in the sign column and provides powerful commands to stage, undo, and preview individual hunks directly from Vim
<C-r>/
Vim stores your last search pattern in the / register.
"+y and "+p
The "+ register is linked to the system clipboard.
<C-^>
Pressing (Ctrl-6 on most keyboards) instantly toggles between the current buffer and the alternate file — the last file you were editing.
buffers-windows #navigation #buffers #normal-mode #productivity #windows
gcc (toggle line), gc{motion} (toggle range)
vim-commentary by Tim Pope provides a simple way to toggle comments.
:set shada
Neovim's ShaDa (Shared Data) file replaces Vim's viminfo and persists session state across restarts — marks, registers, command history, search history, jump
:vertical diffsplit {file}
Vim has a built-in diff mode that highlights added, removed, and changed lines between two (or more) buffers.
searchcount()
The searchcount() function returns a dictionary containing the current search state: which match the cursor is on, how many total matches exist, and whether the
:%s/\V<C-r>//gc
When your last search pattern contains punctuation, slashes, or regex atoms, retyping it inside :substitute is error-prone.
gi
The gi command moves the cursor to the position where you last exited insert mode and immediately enters insert mode again.
navigation #navigation #insert-mode #marks #normal-mode #productivity
:set signcolumn=number
Setting signcolumn=number tells Neovim to display signs (diagnostics, git hunks, breakpoints) inside the line number column instead of adding a dedicated extra
:cexpr system('grep -rn pattern .')
While :make and :grep populate the quickfix list, they are limited to their configured programs.
iabbrev
:iabbrev defines insert-mode abbreviations that expand automatically when you type a non-keyword character (space, punctuation, ) after the abbreviation.
qQ (or any uppercase register letter)
When recording a macro with qq, you can append additional keystrokes to the existing macro by recording into the uppercase version of the same register.
gm
The gm command moves the cursor horizontally to the middle of the current screen width on the current line.
:lcd
:cd changes the global working directory, affecting every window and tab in the session.
"-
Vim silently stores every deletion of less than one line in the special "- register (the "small delete" register).
autocmd TextYankPost
The TextYankPost event fires immediately after any yank operation completes — including y, Y, dd, dw, and any other command that writes to a register.