Skip to content

Commit 05e4cc0

Browse files
authored
Update README.markdown
added syntax highlight to make easier to read the options
1 parent b406871 commit 05e4cc0

File tree

1 file changed

+39
-23
lines changed

1 file changed

+39
-23
lines changed

README.markdown

Lines changed: 39 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,63 +22,79 @@ To install the plugin copy `autoload`, `plugin`, `doc` directories into your `.v
2222
### Pathogen
2323
If you have [Pathogen](http://www.vim.org/scripts/script.php?script_id=2332) installed, clone this repo into a subdirectory of your `.vim/bundle` directory like so:
2424

25-
cd ~/.vim/bundle
26-
git clone git://github.com/nathanaelkane/vim-indent-guides.git
25+
```
26+
cd ~/.vim/bundle
27+
git clone git://github.com/nathanaelkane/vim-indent-guides.git
28+
```
2729

2830
### Vundle
2931
If you have [Vundle](https://github.com/VundleVim/Vundle.vim) installed, add the following line to your `~/.vimrc` in the appropriate spot (see the Vundle.vim README for help):
3032

31-
Plugin 'nathanaelkane/vim-indent-guides'
33+
```vim
34+
Plugin 'nathanaelkane/vim-indent-guides'
35+
```
3236

3337
and then run the following command from inside Vim:
3438

35-
:PluginInstall
36-
39+
```vim
40+
:PluginInstall
41+
```
3742
## Usage
3843
The default mapping to toggle the plugin is `<Leader>ig`.
3944

4045
You can also use the following commands inside Vim:
4146

42-
:IndentGuidesEnable
43-
:IndentGuidesDisable
44-
:IndentGuidesToggle
47+
```vim
48+
:IndentGuidesEnable
49+
:IndentGuidesDisable
50+
:IndentGuidesToggle
51+
```
4552

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

48-
let g:indent_guides_enable_on_vim_startup = 1
49-
55+
```vim
56+
let g:indent_guides_enable_on_vim_startup = 1
57+
```
5058
### gVim
5159
**This plugin should work with gVim out of the box, no configuration needed.** It will automatically inspect your colorscheme and pick appropriate colors.
5260

5361
### Setting custom indent colors
5462
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:
5563

56-
let g:indent_guides_auto_colors = 0
57-
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=red ctermbg=3
58-
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=green ctermbg=4
59-
64+
```vim
65+
let g:indent_guides_auto_colors = 0
66+
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=red ctermbg=3
67+
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=green ctermbg=4
68+
```
6069
Alternatively you can add the following lines to your colorscheme file.
6170

62-
hi IndentGuidesOdd guibg=red ctermbg=3
63-
hi IndentGuidesEven guibg=green ctermbg=4
64-
71+
```vim
72+
hi IndentGuidesOdd guibg=red ctermbg=3
73+
hi IndentGuidesEven guibg=green ctermbg=4
74+
```
6575
### Terminal Vim
6676
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`.
6777

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

70-
hi IndentGuidesOdd ctermbg=black
71-
hi IndentGuidesEven ctermbg=darkgrey
80+
```vim
81+
hi IndentGuidesOdd ctermbg=black
82+
hi IndentGuidesEven ctermbg=darkgrey
83+
```
7284

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

75-
hi IndentGuidesOdd ctermbg=white
76-
hi IndentGuidesEven ctermbg=lightgrey
87+
```vim
88+
hi IndentGuidesOdd ctermbg=white
89+
hi IndentGuidesEven ctermbg=lightgrey
90+
```
7791

7892
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:
7993

80-
colorscheme desert256
81-
set background=dark
94+
```vim
95+
colorscheme desert256
96+
set background=dark
97+
```
8298

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

0 commit comments

Comments
 (0)