Vim Tips - yszheda/wiki GitHub Wiki

References

Set off auto indentation

Reload

cursor

copy a block

lazyredraw

remove tailing blank/empty chars

:%s/\s\+$//e

highlight space errors

repeat last substitution

:&&

YouCompleteMe (YCM)

YCM: python crash

undefined symbol: PyUnicode_FromFormat

.ycm_extra_conf.py

Format json

:%!python -m json.tool

HTML

binary file

:%!xxd

show color console

:terminal in vim8

reload config

" open .vimrc in vim
:so %

search visual selection

xnoremap * :<C-u>call <SID>VSetSearch()<CR>/<C-R>=@/<CR><CR>
xnoremap # :<C-u>call <SID>VSetSearch()<CR>?<C-R>=@/<CR><CR>
function! s:VSetSearch()
let temp = @s
norm! gv"sy
let @/ = '\V' . substitute(escape(@s, '/\'), '\n', '\\n', 'g')
let @s = temp
endfunction

search without escaping

newline eof

:set binary
:set noeof

Trouble shooting

not highlight in visual mode (tmux)

~/.tmux.conf:

set -g default-terminal "xterm"
⚠️ **GitHub.com Fallback** ⚠️