Updated: 23 May 2023
function ToggleWrap()
if (&wrap == 1)
set nowrap nolinebreak
else
set wrap linebreak
endif
endfunction
map <leader>w :call ToggleWrap()<CR>
Freelance software engineer United Kingdom
Updated: 23 May 2023
function ToggleWrap()
if (&wrap == 1)
set nowrap nolinebreak
else
set wrap linebreak
endif
endfunction
map <leader>w :call ToggleWrap()<CR>
Updated: 21 May 2023
Remove all text from line, remain in normal mode
nmap <Leader>S S<Esc>
nmap <Leader>cc cc<Esc>
Add blank line above or below current line
nmap <Leader>O O<Esc>j
nmap <Leader>o o<Esc>k
Scroll left and right without moving cursor
map <C-L> 5zl
map <C-H> 5zh
Updated: 15 May 2023
) Sentence forwards.
( Sentence backwards.
} Paragraph forwards.
{ Paragraph backwards.
S Delete contents of a line, go to start, stay in Insert mode.
C Delete to end of line and enter INSERT mode.
0 Start of line, stay in NORMAL mode.
$ End of line, stay in NORMAL mode.
#cc Change # lines.
ciw Change in word.
Updated: 28 October 2025
:digraphs show all digraphs.
Digraph table hosted by University of Aukland.
Insert or Command mode, enter digraph
CTRL-K {char1} {char2}
| digraph | official name | char |
|---|---|---|
| Eu | Euro sign | € |
| XX | Ballot x | ✗ |
| /- | Dagger | † |
| oC | Degree celcius | ℃ |
| :3 | Vertical ellipsis | ⋮ |
| .3 | Midline horizontal ellipsis | ⋯ |
| .M | Middle dot | · |
| .: | Therefore | ∴ |
Updated: 18 September 2025
:checkhealth and look for the tree sitter section.Install one or more treesitter parsers
:TSInstall <language_to_install>
Get a list of all available languages and their installation status
:TSInstallInfo
If required, install the tree sitter CLI
npm install -g tree-sitter
npm install -g tree-sitter-cli
Updated: 16 March 2024
Given the following
one foo one
one bar one
this substitution :s/one\(.*\)one/two\1two/ yields
two foo two
two bar two
Given the following
phpdoc_separation, blank_line_before_statement, ordered_imports
class_attributes_separation, phpdoc_summary, phpdoc_separation
this substitution :s/, /\r/g yields
phpdoc_separation
blank_line_before_statement
ordered_imports
class_attributes_separation
phpdoc_summary
phpdoc_separation
Use I. The following will replace stays but not Stays
:%s/stays/country/gI
Updated: 15 May 2023
Select lines then
:sort
Reverse sort
:sort!
Updated: 14 May 2023
[c move to previous hunk.
]c move to next hunk.
<leader>hp preview hunk.
<leader>hs stage hunk.
<leader>hu undo hunk.
Updated: 17 May 2023
Surround a single character with square brackets, no additional space
ysl]
Surround a visual selection with backticks. Make the selection then
S`
For “Hello world!”, change double quotes to single quotes
cs"'
For <em>foo</em>, change tags to double quotes
cst"
Updated: 01 January 2023
Use !, for example to tidy text into tabulated columns
notes.txt 101 KB root a-longer-filename.sh 2 KB chris 1.jpg 16.37 MB www-data
Type command
:!column -t
Result
notes.txt 101 KB root a-longer-filename.sh 2 KB chris 1.jpg 16.37 MB www-data