Toggling invisibles makes your code more readable. Here’s why.

Consistency is the king!

According to Idiomatic Style Manifesto, you will benefit from showing invisible characters, because:

  • It enforces consistency
  • Eliminates end of line whitespace
  • Eliminates blank line whitespace
  • Commits and diffs that are easier to read

Atom-like invisibles

A team member of mine has inspired me how Atom displays the invisible characters. Here’s some example.

I googled for a while and discovered that in Vim invisibles can be turned on with:

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

The above snippet comes from a Show invisible Vimcast.

I kind of liked it, and wanted to find some config for atom. This is what I found on Github searching for config.cson eol:

{"eol":"¬","space":"·","tab":"»","cr":"¤"}

Vim config

set listchars=tab:-,space:·,eol:¬,trail:·,nbsp:_

" Toggle invisibles
nmap <leader>ti :set list!<CR>

Other helpful resources

EditorConfig

Will help your team to adhere to consistent coding style. I know that Vim is superior to other editors like… ;) For the unconvertible, use EditorConfig.

Read Use EditorConfig to Manage Coding Styles on Team Projects for more.

jshint + pre-commit

JavaScript with linting tools isn’t that bad, so don’t be afraid to let CoffeeScript go.

Start with these resources:

Last but not least

By the way, writing this short blog post took me less then 1 hour. It’s far from perfect. It’s far from complete (no project is complete). This is not supposed to be a brag, but an encouragement for you to share what you know.