You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.markdown
+39-19
Original file line number
Diff line number
Diff line change
@@ -22,63 +22,83 @@ To install the plugin copy `autoload`, `plugin`, `doc` directories into your `.v
22
22
### Pathogen
23
23
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:
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):
30
32
31
-
Plugin 'nathanaelkane/vim-indent-guides'
33
+
```vim
34
+
Plugin 'nathanaelkane/vim-indent-guides'
35
+
```
32
36
33
37
and then run the following command from inside Vim:
34
38
35
-
:PluginInstall
39
+
```vim
40
+
:PluginInstall
41
+
```
36
42
37
43
## Usage
38
44
The default mapping to toggle the plugin is `<Leader>ig`.
39
45
40
46
You can also use the following commands inside Vim:
41
47
42
-
:IndentGuidesEnable
43
-
:IndentGuidesDisable
44
-
:IndentGuidesToggle
48
+
```vim
49
+
:IndentGuidesEnable
50
+
:IndentGuidesDisable
51
+
:IndentGuidesToggle
52
+
```
45
53
46
54
If you would like to have indent guides enabled by default, you can add the following to your `~/.vimrc`:
47
55
48
-
let g:indent_guides_enable_on_vim_startup = 1
56
+
```vim
57
+
let g:indent_guides_enable_on_vim_startup = 1
58
+
```
49
59
50
60
### gVim
51
61
**This plugin should work with gVim out of the box, no configuration needed.** It will automatically inspect your colorscheme and pick appropriate colors.
52
62
53
63
### Setting custom indent colors
54
64
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:
Alternatively you can add the following lines to your colorscheme file.
61
73
62
-
hi IndentGuidesOdd guibg=red ctermbg=3
63
-
hi IndentGuidesEven guibg=green ctermbg=4
74
+
```vim
75
+
hi IndentGuidesOdd guibg=red ctermbg=3
76
+
hi IndentGuidesEven guibg=green ctermbg=4
77
+
```
64
78
65
79
### Terminal Vim
66
80
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`.
67
81
68
82
When `set background=dark` is used, the following highlight colors will be defined:
69
83
70
-
hi IndentGuidesOdd ctermbg=black
71
-
hi IndentGuidesEven ctermbg=darkgrey
84
+
```vim
85
+
hi IndentGuidesOdd ctermbg=black
86
+
hi IndentGuidesEven ctermbg=darkgrey
87
+
```
72
88
73
89
Alternatively, when `set background=light` is used, the following highlight colors will be defined:
74
90
75
-
hi IndentGuidesOdd ctermbg=white
76
-
hi IndentGuidesEven ctermbg=lightgrey
91
+
```vim
92
+
hi IndentGuidesOdd ctermbg=white
93
+
hi IndentGuidesEven ctermbg=lightgrey
94
+
```
77
95
78
96
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:
79
97
80
-
colorscheme desert256
81
-
set background=dark
98
+
```vim
99
+
colorscheme desert256
100
+
set background=dark
101
+
```
82
102
83
103
Alternatively you can manually setup the highlight colors yourself, see `:help indent_guides_auto_colors` for an example.
0 commit comments