How do I make wrapped lines preserve their indentation level?
:set breakindent
When wrap is enabled, long lines wrap to the next screen row starting at column 1 by default, which makes indented code look messy.
61 results for "indent visual"
:set breakindent
When wrap is enabled, long lines wrap to the next screen row starting at column 1 by default, which makes indented code look messy.
:%!
The ! operator pipes text through a shell command, replacing the selected lines with the command's output.
:set showbreak=+++
When wrap is enabled, Vim wraps long lines at the screen edge, but there is no built-in visual marker to distinguish a wrapped continuation from a brand-new lin
:'<,'>norm! A;
The :normal Ex command lets you execute any Normal mode keystrokes on a range of lines simultaneously, turning a single-line operation into a multi-line batch e
editing #editing #normal-mode #ex-commands #visual-mode #text-manipulation
:ce
Vim has three built-in ex commands for text alignment that most users never discover: :ce (center), :ri (right-justify), and :le (left-justify).
:set foldcolumn=1
Setting foldcolumn to a non-zero value adds a narrow column on the left side of each window that visually represents the fold structure of your file.
: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.
:'<,'>normal {command}
After making a visual selection, :'normal {command} runs any normal-mode command on each selected line individually.
:packadd justify | :'<,'>Justify 72
Vim can wrap text, but full left-and-right justification is a different task.
plugins #plugins #formatting #visual-mode #text-manipulation
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
gcc
The vim-commentary plugin by Tim Pope provides a minimal yet powerful way to toggle comments in any programming language.
plugins #plugins #commentary #commenting #editing #normal-mode
:center, :right, :left
Vim includes three built-in Ex commands for text alignment that most users never discover: :center, :right, and :left.
<C-v>
The (Ctrl+v) command enters visual block mode, which lets you select a rectangular column of text across multiple lines.
:'<,'>normal A;
The :normal command executes normal-mode keystrokes on every line in a range.
command-line #command-line #ex-commands #editing #normal-mode #batch-editing
:'a,'b s/old/new/g
Marks can be used as range specifiers in any Ex command.
command-line #marks #command-line #ex-commands #ranges #editing
{count}{motion}
Almost every Vim motion and operator accepts a numeric count prefix that repeats or amplifies the action.
:[range]center {width}
Vim has a built-in :center command that pads lines with leading spaces to visually center them within a given column width.
command-line #formatting #text-alignment #ex-commands #editing
:set noexpandtab | retab!
When you inherit space-indented code and need to switch to tabs, :retab! (with the bang) converts groups of spaces into tabs throughout the file.
ci" / ci( / ci{ / ci[ / ci` / ci'
The ci{delimiter} family of commands changes the text inside any matching pair of delimiters.
editing #editing #text-objects #change #delimiters #normal-mode
zj
When your file uses folds, zj and zk let you navigate directly to fold boundaries — jumping to the start of the next fold below or the end of the previous fol