Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've just added the Git Gutter plugin for Vim which shows lines added/modified/deleted according to git diff. It uses the Sign Column to show characters next to each line.

At the moment the column appears on save, which is quite jarring. I'd prefer the column to always show, even if empty.

How can I make Sign Column always visible?

share|improve this question
up vote 24 down vote accepted

You have to define a dummy sign and place it into the current buffer:

:sign define dummy
:execute 'sign place 9999 line=1 name=dummy buffer=' . bufnr('')
share|improve this answer
Spot on, thank you :) – jordelver Feb 28 '13 at 17:50
To make it work in every new buffer you open, put both autocmd BufEnter * sign define dummy and autocmd BufEnter * execute 'sign place 9999 line=1 name=dummy buffer=' . bufnr('') in your vimrc. – akent Mar 7 '13 at 1:40

For vim-gitgutter specifically, you can also set the following variable in your ~/.vimrc:

let g:gitgutter_sign_column_always = 1
share|improve this answer
Thanks, that option must of been added after this question was posted. Useful to know though. – jordelver Mar 14 '14 at 11:57
Indeed, it seems that the commit which added it was made on 14 March 2013 — exactly two weeks after your question! – wjv Mar 14 '14 at 19:05
While working on something else I recently poked around inside the GitGutter source, and I noticed that setting this variable forces the display of the sign column in exactly the same way as the accepted answer to this question — by setting a dummy sign. – wjv Apr 11 at 6:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .