Simple - use the key combination Ctrl-K followed by the two-letter digraph code directly in insert mode.
For example, Ctrl-K DE generates ∆ and Ctrl-K 23 generates ⅔.
For a list of all the available digraphs and their key codes, use the command ":dig".
Sample Digraph Codes |
" Show tabs and trailing spaces.
" Ctrl-K >> for »
" Ctrl-K .M for ·
" (use :dig for list of digraphs)
set list listchars=tab:»»,trail:·
Here's what it looks like:
Using Digraphs to see Whitespace Characters |
Just a quick note to hopefully save other people a few minutes of googling -- there have to be two characters for the tab. You can't use just one.
ReplyDelete@Jason indeed but the second character is used to fill up space depending on the tab's width and it doesn't need to be the same char.
ReplyDeletealso it's good to know that these characters tend to be problematic on misconfigured or non-unicode terminals.
most common case for this is PuTTY on Windows, here's some info to deal with that: http://www.linux.com/community/blogs/improving-putty-settings-on-windows.html
or just be Editor-neutral and use XCompose; however, you are now dependent on X.
ReplyDelete