TextMate like Show Invisibles in Vim

I recently made the switch from TextMate to Vim and spent a good amount of time trying to find the Vim equivalent for some of the TextMate features that I had gotten so used to. One of these features is TextMate’s Show Invisible Characters.

Accessible via the View menu, enabling this feature will show special characters to represent end of line, tab characters etc.

You can see the feature in action in this screenshot below.

textmate show invisibles

Notice the ¬ symbol representing the end of line and the character representing tab.

In order to achieve the same effect in VIM, add the following lines to your .vimrc

set list                                               
set listchars=tab:▸\ ,eol:¬

As a bonus, in VIM you can assign a character specifically for trailing white space.

set listchars=tab:▸\ ,eol:¬,trail:▫

Here is what it looks like with those changes applied in VIM

vim show invisibles equivalent

As you can see, the way these special characters are displayed is not as subtle as in TextMate. If you figure out a way to tweak that, do let me know.

TextMate allows customization of the invisible characters using a variable called invisiblesMap in the .tm_properties file. Here is an example: invisiblesMap = "~ \t▸\n¬"

Sep 2014

రామ్ . राम . Rām