While there’s probably an efficient, pithy, three-character, way to accomplish this, this works for me:
- If arguments are passed, take in the first.
- Coerce it to a number and set
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 endfunction command! -nargs=? CC call RightRuler(