Skip to content

Instantly share code, notes, and snippets.

@rafaeljesus
Forked from while0pass/listchars.vim
Created June 9, 2020 12:30
Show Gist options
  • Save rafaeljesus/8637de3f8753c4044a921f011f95c92d to your computer and use it in GitHub Desktop.
Save rafaeljesus/8637de3f8753c4044a921f011f95c92d to your computer and use it in GitHub Desktop.
show/hide hidden characters in Vim
" hide hidden chars
:set nolist
" show hidden characters in Vim
:set list
" settings for hidden chars
" what particular chars they are displayed with
:set lcs=tab:▒░,trail:▓,nbsp:░
" or
:set listchars=tab:▒░,trail:▓,nbsp:░
" \u2592\u2591 are used for tab, \u2593 for trailing spaces in line, and \u2591 for nbsp.
" In Vim help they suggest using ">-" for tab and "-" for trail.
" change showbreak when line numbers are on or off.
" show no char when line numbers are on, and \u21aa otherwise.
au OptionSet number :if v:option_new | set showbreak= |
\ else | set showbreak=↪ |
\ endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment