How do I rename, move, or delete the current file from inside Vim using vim-eunuch?
:Rename {newname}
vim-eunuch (by Tim Pope) adds Unix shell operations as first-class Vim commands.
1044 results for "i" a""
:Rename {newname}
vim-eunuch (by Tim Pope) adds Unix shell operations as first-class Vim commands.
=i{ or =ap
The = operator performs smart indentation based on Vim's filetype-aware indent rules.
"_d
The "d command deletes text using the black hole register ("), which discards the deleted content instead of storing it.
cin)
The targets.
:%s/\<word\>/replacement/g
How it works In Vim's regular expressions, \ are word boundary anchors: \ matches the end of a word.
zf{motion}
Vim supports several fold methods, but manual folding with zf gives you precise control over exactly which lines to collapse.
<C-y>,
The emmet-vim plugin brings the full power of Emmet (formerly Zen Coding) to Vim, letting you type a short CSS-like abbreviation and expand it into a complete H
:Gedit HEAD~3:%
The vim-fugitive plugin lets you open any version of any file from your Git history directly in a Vim buffer using the :Gedit command.
G
The G command moves the cursor to the last line of the file.
<C-y>
The command scrolls the window up one line at a time while keeping the cursor position fixed.
vip
The vip command visually selects the inner paragraph — all contiguous non-blank lines surrounding the cursor.
visual-mode #visual-mode #text-objects #editing #normal-mode
\zs and \ze
How it works Vim's \zs (set start) and \ze (set end) atoms let you define which portion of a pattern counts as the actual match, even though the full pattern is
/\v(pattern)@<=match
Vim supports zero-width assertions (lookahead and lookbehind) in its regex engine.
search #search #regex #advanced-search #lookahead #lookbehind
:set iskeyword+=-
By default, Vim treats hyphens, dots, and many punctuation characters as word boundaries.
]m
The ]m command jumps to the start of the next method in Java-style code.
Plug 'tpope/vim-repeat'
vim-repeat by Tim Pope extends the .
w
The w command moves the cursor forward to the beginning of the next word.
:keepalt e {file}
Every time you open a file with :edit, Vim updates the alternate file register (#) to the previous buffer.
buffers-windows #buffers #ex-commands #registers #navigation
:s/\v(pattern1)(pattern2)/\2\1/
Vim's substitute command supports capture groups (also called backreferences), which let you rearrange matched portions of text.
:r filename
The :r filename command reads the contents of filename and inserts them into the current buffer below the cursor line.