How do I duplicate the current line and place the copy directly below it?
:t.
The :t (short for :copy) command copies lines from one location to another.
415 results for "n N"
:t.
The :t (short for :copy) command copies lines from one location to another.
:set nowrapscan
By default Vim's wrapscan option is enabled, which causes / and ? searches to wrap silently from the end of the file back to the beginning (and vice versa).
:set option!
For any boolean option, appending ! to :set inverts its current value.
let {var} =<< {marker}
Vim 8.
:set complete-=i
Vim's complete option controls which sources are scanned when you press or to complete a word.
:let @a .= "text"
Vim registers are just strings, and you can read and write them directly using the :let command.
:execute "normal! \<{key}>"
When building dynamic :execute normal! calls in Vimscript, you must use double-quoted strings with the \ notation so Vim interprets the special key codes.
/\V<C-r><C-r>"
When your yanked text includes regex symbols like .
require('telescope.builtin').grep_string()
Telescope's grepstring() function performs a project-wide search for the exact word currently under the cursor, displaying live-previewed results in an interact
:ls!
:ls (or :buffers) shows Vim's buffer list, but it hides unlisted buffers — help files, directory listings (netrw), terminal buffers, and scratch buffers marke
"/p
Vim stores the last search pattern in the search register "/.
:set diffopt+=linematch:60
Neovim's linematch diffopt enables intra-line diff highlighting — instead of marking an entire changed line, Neovim highlights only the specific characters th
:set foldcolumn=3
The foldcolumn option adds a narrow column on the left side of the window that visually represents the fold structure of the file.
:bprev
The :bprev (or :bp for short) command switches to the previous buffer in Vim's buffer list.
:set formatoptions-=cro
By default, Vim continues the current comment leader when you press in insert mode or open a new line with o/O.
winrestcmd()
The winrestcmd() function returns a string of Ex commands that, when executed, restore all window sizes to their state at the time of the call.
<C-x><C-d>
in insert mode triggers defined identifier completion — it searches for identifiers that match the partial word before the cursor by scanning #define statemen
qa<C-a>jq
By recording a one-step macro that increments a number and moves down a line, you can bulk-apply across as many lines as needed with a single count.
<C-x><C-f>
The command triggers filename completion in insert mode.
editing #editing #insert-mode #completion #file-management #productivity
<C-x><C-v>
The key sequence in insert mode triggers Vim command-line completion — the same completion engine used at the : command prompt.