vim-indent-guides/README.markdown

60 lines
2.8 KiB
Markdown
Raw Normal View History

2010-12-07 08:35:02 -05:00
# Indent Guides
2010-12-20 07:32:35 -05:00
Indent Guides is a plugin for visually displaying indent levels in vim.
2010-12-07 08:35:02 -05:00
2010-12-11 09:14:56 -05:00
## Features:
* Can detect both tab and space indent styles.
2010-12-29 06:15:52 -05:00
* Automatically inspects your colorscheme and picks appropriate colors (gvim only).
2010-12-11 09:14:56 -05:00
* Will highlight indent levels with alternating colors.
2010-12-29 06:15:52 -05:00
* Full support for gvim and basic support for terminal vim.
2010-12-07 08:47:48 -05:00
2010-12-12 04:33:16 -05:00
## Requirements
2010-12-20 07:32:35 -05:00
* vim 7.2+
2010-12-12 04:33:16 -05:00
2010-12-07 08:45:07 -05:00
## Installation
2010-12-11 09:14:56 -05:00
To install the plugin just copy `autoload`, `plugin`, `doc` directories into your .vim directory.
2010-12-07 08:35:02 -05:00
2010-12-11 09:14:56 -05:00
Alternatively if you have [Pathogen](http://www.vim.org/scripts/script.php?script_id=2332) installed, just clone this repo into a subdirectory of your .vim/bundle directory like so:
cd ~/.vim/bundle
git clone git://github.com/nathanaelkane/vim-indent-guides.git
2010-12-07 08:45:07 -05:00
## Usage
The default mapping to toggle the plugin is `<Leader>ig`
2010-12-07 08:35:02 -05:00
2010-12-29 06:23:35 -05:00
### Setting custom indent colors
Here's an example of how to use custom colors instead of 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
2010-12-29 06:15:52 -05:00
### 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 `set background=` is set to `dark` or `light`.
When `set background=dark` is used, the following highlight colors will be defined:
hi IndentGuidesEven ctermbg=darkgrey
hi IndentGuidesOdd ctermbg=black
When `set background=light` is used, the following highlight colors will be defined:
hi IndentGuidesEven ctermbg=lightgrey
hi IndentGuidesOdd ctermbg=white
2010-12-29 06:23:35 -05:00
If for some reason it's defining light highlight colors instead of dark ones or vice versa, the first thing you should check is that `set background=` is being set correctly for your colorscheme. Sometimes it's best to manually set the `background` value in your `.vimrc`, for example:
2010-12-29 06:15:52 -05:00
colorscheme desert256
set background=dark
Alternatively you can manually setup the highlight colors yourself, see `:help indent_guides_auto_colors` for an example.
2010-12-07 08:45:07 -05:00
## Help
`:help indent-guides`
2010-12-11 09:14:56 -05:00
## Screenshots
<img src="https://dl.dropbox.com/u/1019520/vim-indent-guides/rdark.png" width="400" height="400" alt="Indent Guides screenshot: rdark" />
<img src="https://dl.dropbox.com/u/1019520/vim-indent-guides/bclear.png" width="400" height="400" alt="Indent Guides screenshot: bclear" />
<img src="https://dl.dropbox.com/u/1019520/vim-indent-guides/clarity.png" width="400" height="400" alt="Indent Guides screenshot: clarity" />
<img src="https://dl.dropbox.com/u/1019520/vim-indent-guides/moss.png" width="400" height="400" alt="Indent Guides screenshot: moss" />
2010-12-07 08:35:02 -05:00