vim colourcolumn shorthand function

in code

While there’s probably an efficient, pithy, three-character, way to accomplish this, this works for me:

  1. If arguments are passed, take in the first.
  2. Coerce it to a number and set colorcolumn with it.

There are some things I want to try (like ranges), but that’s for the future.

function! RightRuler(...)
  let &l:colorcolumn = a:0 > 0 ? 0 + a:1 : 0

command! -nargs=? CC call RightRuler()

A Summer of Running

in running

Achill Half Marathon

in running

Your email address will not be published. Required fields are marked *