mirror of
Fork 0
Amir b318c1d0e5 Updated plugins 2023-04-01 22:48:04 +02:00
.github/workflows Updated plugins 2023-04-01 22:48:04 +02:00
autoload Updated plugins 2023-04-01 22:48:04 +02:00
doc Updated plugins 2023-04-01 22:48:04 +02:00
plugin Updated plugins 2023-04-01 22:48:04 +02:00
test-files Feature/vim indent guides (#608) 2021-07-04 23:01:36 +02:00
.gitignore Feature/vim indent guides (#608) 2021-07-04 23:01:36 +02:00
LICENSE Updated plugins 2021-10-28 21:48:21 +02:00
README.markdown Updated plugins 2023-04-01 22:48:04 +02:00


Indent Guides


Indent Guides is a plugin for visually displaying indent levels in Vim.


  • Can detect both tab and space indent styles.
  • Automatically inspects your colorscheme and picks appropriate colors (gVim only).
  • Will highlight indent levels with alternating colors.
  • Full support for gVim and basic support for Terminal Vim.
  • Seems to work on Windows gVim 7.3 (haven't done any extensive tests though).
  • Customizable size for indent guides, eg. skinny guides (soft-tabs only).
  • Customizable start indent level.
  • Highlight support for files with a mixture of tab and space indent styles.


  • Vim 7.2+


To install the plugin copy autoload, plugin, doc directories into your .vim directory.


If you have Pathogen installed, clone this repo into a subdirectory of your .vim/bundle directory like so:

cd ~/.vim/bundle
git clone git://github.com/preservim/vim-indent-guides.git


If you have Vundle installed, add the following line to your ~/.vimrc in the appropriate spot (see the Vundle.vim README for help):

Plugin 'nathanaelkane/vim-indent-guides'

and then run the following command from inside Vim:



The default mapping to toggle the plugin is <Leader>ig.

You can also use the following commands inside Vim:


If you would like to have indent guides enabled by default, you can add the following to your ~/.vimrc:

let g:indent_guides_enable_on_vim_startup = 1


This plugin should work with gVim out of the box, no configuration needed. It will automatically inspect your colorscheme and pick appropriate colors.

Setting custom indent colors

Here's an example of how to define custom colors instead of using the ones the plugin automatically generates for you. Add this to your .vimrc file:

let g:indent_guides_auto_colors = 0
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd  guibg=red   ctermbg=3
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=green ctermbg=4

Alternatively you can add the following lines to your colorscheme file.

hi IndentGuidesOdd  guibg=red   ctermbg=3
hi IndentGuidesEven guibg=green ctermbg=4

Terminal Vim

At the moment Terminal Vim only has basic support. This means is that colors won't be automatically calculated based on your colorscheme. Instead, some preset colors are used depending on whether background is set to dark or light.

When set background=dark is used, the following highlight colors will be defined:

hi IndentGuidesOdd  ctermbg=black
hi IndentGuidesEven ctermbg=darkgrey

Alternatively, when set background=light is used, the following highlight colors will be defined:

hi IndentGuidesOdd  ctermbg=white
hi IndentGuidesEven ctermbg=lightgrey

If for some reason it's incorrectly defining light highlight colors instead of dark ones or vice versa, the first thing you should check is that the background value is being set correctly for your colorscheme. Sometimes it's best to manually set the background value in your .vimrc, for example:

colorscheme desert256
set background=dark

Alternatively you can manually setup the highlight colors yourself, see :help indent_guides_auto_colors for an example.


:help indent-guides