How do I let h/l and arrow keys wrap to adjacent lines at line boundaries?
:set whichwrap+=<,>,h,l
By default, h and l stop at line boundaries.
:set whichwrap+=<,>,h,l
By default, h and l stop at line boundaries.
:set sessionoptions+=globals,localoptions
If you rely on sessions for context switching, default :mksession can feel incomplete because some state does not come back.
:set viewoptions=folds,cursor,slash,unix
mkview and loadview are great for restoring editing context, but the default viewoptions can bring back more state than you actually want.
:set mousemodel=extend
If you use the mouse occasionally in Vim, mousemodel=extend makes selection behavior much more predictable.
:set undodir^=$HOME/.vim/undo//
If you already have an undodir configured by a distro config or plugin, replacing it outright can remove fallback paths you still want.
:set jumpoptions+=stack,view
When you jump around large files with and , the default behavior can feel disorienting because your cursor position may return but your viewport context does no
:set nrformats-=octal\<CR>
If you work with IDs, ticket numbers, or zero-padded counters, Vim's default octal behavior can be surprising.
:set jumpoptions+=stack
By default, Vim's jumplist can feel surprising: if you jump backward and then make a new jump, the old forward path is not always discarded like a browser histo
:set completefunc=syntaxcomplete#Complete
If omnifunc is unavailable for a filetype, Vim can still offer meaningful completion by using syntax groups.
:set timeout timeoutlen=400 ttimeoutlen=30
If custom mappings feel laggy, the issue is often timeout tuning rather than mapping design.
config #config #mappings #performance #command-line #insert-mode
:set nrformats-=octal<CR>
By default, Vim may treat numbers with leading zeros as octal when you use and for increment/decrement.
:set inccommand=nosplit
When you are crafting a risky :substitute command, the expensive part is usually confidence, not typing.
:set diffopt+=algorithm:histogram,indent-heuristic
Default diff behavior can produce noisy hunks when code is moved or indentation changes significantly.
:let s:u=&l:undolevels | setlocal undolevels=-1 | execute "normal! a\<BS>\<Esc>" | let &l:undolevels=s:u
Sometimes you finish a risky refactor and want a clean undo boundary before handing the buffer off or continuing with unrelated edits.
:set complete=.,w,b,t
Default keyword completion can feel noisy in large projects because Vim may scan extra sources you do not care about in the moment.
:set backupcopy=yes
When Vim saves a file, it may use a rename-style write strategy that can replace the original inode.
:set foldcolumn=auto:3
If you use folds heavily, a fixed fold column is a tradeoff: foldcolumn=0 hides useful fold cues, while a constant width wastes horizontal space in files that b
:set diffopt+=internal,algorithm:histogram,indent-heuristic
Default diff settings are fine for small edits, but they can produce noisy hunks when code is moved or indentation shifts.
:set diffopt+=vertical,algorithm:patience,indent-heuristic
Default diff behavior can look noisy on refactors where blocks move or indentation shifts.
:set virtualedit=block,onemore
virtualedit controls whether the cursor can move to positions that do not yet contain text.