Column Highlighting

3.8
(206)

Whether writing prose or writing software, sometimes it can be handy to see how text is aligned vertically inside your file. This is useful when trying to track matching indents in a software project, especially for languages like python or haml where blocks are are opened and closed with indentation level alone.

Vim has a feature for this called cursorcolumn. You can enable and disable it with a command:

  • :set cursorcolumn – Enable column highlighting
    :set cuc – Alias for the same
  • :set nocursorcolumn – Disable column highlighting
    :set nocuc – Alias for the same
  • :hi CursorColumn ctermbg=3 – Change the color to yellow
    Try different numbers for different colors

Check out the brief gif showing some of these in action:

How useful was this post?

Average rating 3.8 / 5. Vote count: 206

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Written by

Andy Libby

28 Posts

Rider of bicycles. Writer of code. User of Vim.
View all posts

Leave a reply

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