How do I query databases directly from Vim without leaving my editor?
:DB
The vim-dadbod plugin by Tim Pope turns Vim into a powerful database client.
432 results for "visual mode"
:DB
The vim-dadbod plugin by Tim Pope turns Vim into a powerful database client.
:%normal command
The :normal command executes normal mode commands programmatically on a range of lines.
}
The } motion moves the cursor forward to the next blank line, effectively jumping to the next paragraph.
V select then :norm A text
Selecting lines and running :norm A text appends the same text to the end of every selected line.
qaI<li><Esc>A</li><Esc>jq
This macro wraps each line in tags by inserting the opening tag at the start and appending the closing tag at the end.
ciw""<Esc>P
Vim doesn't have a built-in "surround" operator, but you can wrap any word in quotes or brackets with a short sequence: ciw""P.
editing #editing #text-objects #normal-mode #productivity #surround
`{mark}
The backtick command ` ` followed by a mark name jumps to the exact line and column of that mark, unlike the single-quote ' which only goes to the line.
:%s/old/new/g
The :%s/old/new/g command replaces all occurrences of old with new across every line in the file.
cx{motion}
The vim-exchange plugin by Tom McDonald provides the cx operator to swap two arbitrary text regions.
plugins #plugins #exchange #editing #text-objects #refactoring
d2i(
Vim text objects accept a count prefix that lets you target outer layers of nested delimiters.
guiw
The guiw command converts the entire word under the cursor to lowercase.
gUiw
The gUiw command converts the entire word under the cursor to uppercase.
J
The J command joins the current line with the line below it, replacing the newline with a space.
gJ
The gJ command joins the current line with the line below it without inserting any space between them.
( ) { } [[ ]]
Vim provides structural navigation motions that move by sentences, paragraphs, and sections.
O
The O (uppercase) command opens a new blank line above the current line and places you in insert mode, ready to type.
{count}{motion}
Almost every Vim motion and operator accepts a numeric count prefix that repeats or amplifies the action.
/pattern<CR>cgnreplacement<Esc>.
The gn text object selects the next search match, and cgn changes it.
:g/^/normal I// <CR>
When you need to comment a whole block quickly, :global combined with :normal is faster than recording a macro or entering Visual Block mode.
:g/./t.\<CR>
The :global command can apply an Ex action to every line that matches a pattern.