I would like to add some padding between my text and the left edge of the window (or the right edge of the line numbers).

alt text


I set the line number background to match the text background (black in both cases), so this gives a visual buffer between the numbers & the text. I also set the line numbering to be dark grey so they are pretty unobtrusive.

Setting the line number background to match the text is simply a matter of removing the "bg" definitions from your LineNr definition entirely. The relevant section of my colorscheme, including the current line highlighting, is this:

hi CursorLine   guibg=#333333
hi LineNr       guifg=#555555

So the end result looks like this:

enter image description here

(note I use relative line numbers via set relativenumber).


:help foldcolumn

the foldcolumn is used normally to display fold-markers .. but that gives you space as well.

  • 1
    Unfortunately 'foldcolumn' doesn't appear between the number column and the buffer text. – Heptite Oct 31 '10 at 22:34
  • @Heptite: good point. – akira Nov 1 '10 at 6:35

You can run the following commands in the Terminal to add some spacing around the MacVim window (the left spacing is inserted to the left of the line numbers, though):

defaults write org.vim.MacVim MMTextInsetTop '10'
defaults write org.vim.MacVim MMTextInsetLeft '10'
defaults write org.vim.MacVim MMTextInsetBottom '10'
defaults write org.vim.MacVim MMTextInsetRight '10'

Source: https://gist.github.com/meleyal/1902879

  • This is really cool – smallwat3r Jul 25 '19 at 17:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.