vim-indent-guides
vim-indent-guides copied to clipboard
No effect for desert colorscheme
After I run :IndentGuidesEnable, there is no effect. But for the default colorscheme, everything works fine.
I had sent you an email when Indent-guides was just born. At that time, you give me the following 3 lines. I added them to vimrc, then everything would work, but for the current version it won't work.
let g:indent_guides_auto_colors = 0
hi IndentGuidesOdd guibg=#212121
hi IndentGuidesEven guibg=#404040
I am using gvim on Linux. I'm using vim 7.3.
Thanks!
Can you please run the command :hi Normal and give me the output.
It's
Normal xxx guifg=White guibg=grey20 font=Monospace 11
Is there any chance to get this fixed?
Same here for desert colorscheme.
:hi Normal
Normal xxx guifg=White guibg=grey20
Same on vim 7.3.429.
:hi Normal
Normal xxx guifg=White guibg=grey20
Bit if I do:
:colo default
:colo desert
everything works fine.
Question for everyone: are you using Terminal or GUI Vim?
Workaround with switching color schemes is working only for gui vim, but not for terminal.
I can't seem to replicate this problem in Terminal or GUI Vim (MacVim 7.3.754).
Can you please run the following commands when it's not working and post the output:
:hi IndentGuidesOdd:hi IndentGuidesEven:echo getmatches()
Also, it'd be helpful to post any custom plugin settings you're using.
Edit: I'm using the following version of desert: https://github.com/vim-scripts/desert.vim
Here is the output. I've tried clean vim installation with only "pathogen" and "indent-guides" plugins.
:hi IndentGuidesOdd
IndentGuidesOdd xxx cleared
:hi IndentGuidesEven
IndentGuidesEven xxx cleared
:echo getmatches()
Expression ValueTable::create_extractvalue_expression(ExtractValueInst *EI) {
[{'group': 'IndentGuidesOdd', 'pattern': '^\s*\%1v\zs\s*\%3v\ze', 'priority': 10, 'id': 4}, {'group': 'IndentGuidesOdd', 'pattern': '^\t*\%1v\zs\t*\%3v\ze', 'p
riority': 10, 'id': 5}, {'group': 'IndentGuidesEven', 'pattern': '^\s*\%3v\zs\s*\%5v\ze', 'priority': 10, 'id': 6}, {'group': 'IndentGuidesEven', 'pattern': '^
\t*\%3v\zs\t*\%5v\ze', 'priority': 10, 'id': 7}, {'group': 'IndentGuidesOdd', 'pattern': '^\s*\%5v\zs\s*\%7v\ze', 'priority': 10, 'id': 8}, {'group': 'IndentGu
idesOdd', 'pattern': '^\t*\%5v\zs\t*\%7v\ze', 'priority': 10, 'id': 9}, {'group': 'IndentGuidesEven', 'pattern': '^\s*\%7v\zs\s*\%9v\ze', 'priority': 10, 'id':
10}, {'group': 'IndentGuidesEven', 'pattern': '^\t*\%7v\zs\t*\%9v\ze', 'priority': 10, 'id': 11}, {'group': 'IndentGuidesOdd', 'pattern': '^\s*\%9v\zs\s*\%11v
\ze', 'priority': 10, 'id': 12}, {'group': 'IndentGuidesOdd', 'pattern': '^\t*\%9v\zs\t*\%11v\ze', 'priority': 10, 'id': 13}, {'group': 'IndentGuidesEven', 'pa
ttern': '^\s*\%11v\zs\s*\%13v\ze', 'priority': 10, 'id': 14}, {'group': 'IndentGuidesEven', 'pattern': '^\t*\%11v\zs\t*\%13v\ze', 'priority': 10, 'id': 15}, {'
group': 'IndentGuidesOdd', 'pattern': '^\s*\%13v\zs\s*\%15v\ze', 'priority': 10, 'id': 16}, {'group': 'IndentGuidesOdd', 'pattern': '^\t*\%13v\zs\t*\%15v\ze',
'priority': 10, 'id': 17}, {'group': 'IndentGuidesEven', 'pattern': '^\s*\%15v\zs\s*\%17v\ze', 'priority': 10, 'id': 18}, {'group': 'IndentGuidesEven', 'patter
n': '^\t*\%15v\zs\t*\%17v\ze', 'priority': 10, 'id': 19}, {'group': 'IndentGuidesOdd', 'pattern': '^\s*\%17v\zs\s*\%19v\ze', 'priority': 10, 'id': 20}, {'group
': 'IndentGuidesOdd', 'pattern': '^\t*\%17v\zs\t*\%19v\ze', 'priority': 10, 'id': 21}, {'group': 'IndentGuidesEven', 'pattern': '^\s*\%19v\zs\s*\%21v\ze', 'pri
ority': 10, 'id': 22}, {'group': 'IndentGuidesEven', 'pattern': '^\t*\%19v\zs\t*\%21v\ze', 'priority': 10, 'id': 23}, {'group': 'IndentGuidesOdd', 'pattern': '
^\s*\%21v\zs\s*\%23v\ze', 'priority': 10, 'id': 24}, {'group': 'IndentGuidesOdd', 'pattern': '^\t*\%21v\zs\t*\%23v\ze', 'priority': 10, 'id': 25}, {'group': 'I
ndentGuidesEven', 'pattern': '^\s*\%23v\zs\s*\%25v\ze', 'priority': 10, 'id': 26}, {'group': 'IndentGuidesEven', 'pattern': '^\t*\%23v\zs\t*\%25v\ze', 'priorit
y': 10, 'id': 27}, {'group': 'IndentGuidesOdd', 'pattern': '^\s*\%25v\zs\s*\%27v\ze', 'priority': 10, 'id': 28}, {'group': 'IndentGuidesOdd', 'pattern': '^\t*\
%25v\zs\t*\%27v\ze', 'priority': 10, 'id': 29}, {'group': 'IndentGuidesEven', 'pattern': '^\s*\%27v\zs\s*\%29v\ze', 'priority': 10, 'id': 30}, {'group': 'Inden
tGuidesEven', 'pattern': '^\t*\%27v\zs\t*\%29v\ze', 'priority': 10, 'id': 31}, {'group': 'IndentGuidesOdd', 'pattern': '^\s*\%29v\zs\s*\%31v\ze', 'priority': 1
0, 'id': 32}, {'group': 'IndentGuidesOdd', 'pattern': '^\t*\%29v\zs\t*\%31v\ze', 'priority': 10, 'id': 33}, {'group': 'IndentGuidesEven', 'pattern': '^\s*\%31v
\zs\s*\%33v\ze', 'priority': 10, 'id': 34}, {'group': 'IndentGuidesEven', 'pattern': '^\t*\%31v\zs\t*\%33v\ze', 'priority': 10, 'id': 35}, {'group': 'IndentGui
desOdd', 'pattern': '^\s*\%33v\zs\s*\%35v\ze', 'priority': 10, 'id': 36}, {'group': 'IndentGuidesOdd', 'pattern': '^\t*\%33v\zs\t*\%35v\ze', 'priority': 10, 'i
d': 37}, {'group': 'IndentGuidesEven', 'pattern': '^\s*\%35v\zs\s*\%37v\ze', 'priority': 10, 'id': 38}, {'group': 'IndentGuidesEven', 'pattern': '^\t*\%35v\zs\
t*\%37v\ze', 'priority': 10, 'id': 39}, {'group': 'IndentGuidesOdd', 'pattern': '^\s*\%37v\zs\s*\%39v\ze', 'priority': 10, 'id': 40}, {'group': 'IndentGuidesOd
d', 'pattern': '^\t*\%37v\zs\t*\%39v\ze', 'priority': 10, 'id': 41}, {'group': 'IndentGuidesEven', 'pattern': '^\s*\%39v\zs\s*\%41v\ze', 'priority': 10, 'id':
42}, {'group': 'IndentGuidesEven', 'pattern': '^\t*\%39v\zs\t*\%41v\ze', 'priority': 10, 'id': 43}, {'group': 'IndentGuidesOdd', 'pattern': '^\s*\%41v\zs\s*\%4
3v\ze', 'priority': 10, 'id': 44}, {'group': 'IndentGuidesOdd', 'pattern': '^\t*\%41v\zs\t*\%43v\ze', 'priority': 10, 'id': 45}, {'group': 'IndentGuidesEven',
'pattern': '^\s*\%43v\zs\s*\%45v\ze', 'priority': 10, 'id': 46}, {'group': 'IndentGuidesEven', 'pattern': '^\t*\%43v\zs\t*\%45v\ze', 'priority': 10, 'id': 47},
{'group': 'IndentGuidesOdd', 'pattern': '^\s*\%45v\zs\s*\%47v\ze', 'priority': 10, 'id': 48}, {'group': 'IndentGuidesOdd', 'pattern': '^\t*\%45v\zs\t*\%47v\ze
', 'priority': 10, 'id': 49}, {'group': 'IndentGuidesEven', 'pattern': '^\s*\%47v\zs\s*\%49v\ze', 'priority': 10, 'id': 50}, {'group': 'IndentGuidesEven', 'pat
tern': '^\t*\%47v\zs\t*\%49v\ze', 'priority': 10, 'id': 51}, {'group': 'IndentGuidesOdd', 'pattern': '^\s*\%49v\zs\s*\%51v\ze', 'priority': 10, 'id': 52}, {'gr
oup': 'IndentGuidesOdd', 'pattern': '^\t*\%49v\zs\t*\%51v\ze', 'priority': 10, 'id': 53}, {'group': 'IndentGuidesEven', 'pattern': '^\s*\%51v\zs\s*\%53v\ze', '
priority': 10, 'id': 54}, {'group': 'IndentGuidesEven', 'pattern': '^\t*\%51v\zs\t*\%53v\ze', 'priority': 10, 'id': 55}, {'group': 'IndentGuidesOdd', 'pattern'
: '^\s*\%53v\zs\s*\%55v\ze', 'priority': 10, 'id': 56}, {'group': 'IndentGuidesOdd', 'pattern': '^\t*\%53v\zs\t*\%55v\ze', 'priority': 10, 'id': 57}, {'group':
'IndentGuidesEven', 'pattern': '^\s*\%55v\zs\s*\%57v\ze', 'priority': 10, 'id': 58}, {'group': 'IndentGuidesEven', 'pattern': '^\t*\%55v\zs\t*\%57v\ze', 'prio
rity': 10, 'id': 59}, {'group': 'IndentGuidesOdd', 'pattern': '^\s*\%57v\zs\s*\%59v\ze', 'priority': 10, 'id': 60}, {'group': 'IndentGuidesOdd', 'pattern': '^\
t*\%57v\zs\t*\%59v\ze', 'priority': 10, 'id': 61}, {'group': 'IndentGuidesEven', 'pattern': '^\s*\%59v\zs\s*\%61v\ze', 'priority': 10, 'id': 62}, {'group': 'In
dentGuidesEven', 'pattern': '^\t*\%59v\zs\t*\%61v\ze', 'priority': 10, 'id': 63}]
It doesn't seem to be defining the highlight groups correctly - I'm not sure why at this point. Let's try to work-around the problem by defining the highlight groups manually.
Try adding the following into your vimrc:
let g:indent_guides_auto_colors = 0
hi IndentGuidesOdd guibg=red ctermbg=3
hi IndentGuidesEven guibg=green ctermbg=4
If that fails, try this more aggressive approach:
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
The less aggressive variant works for me, thanks!
@nathanaelkane
Having similar problem : indents not highlighted (at first) in gvim, only if I use certain colorscheme.
( vim in terminal works fine )
I am using vundle , vim-indent-guides @ commit a57000 , ir_black colorscheme on gvim7.3 of archlinux. My vimrc is like
Bundle 'twerth/ir_black'
Bundle 'nathanaelkane/vim-indent-guides.git'
let g:indent_guides_enable_on_vim_startup = 1
colorscheme ir_black
Indent-guides starts to works if
- I
:colorscheme ANYTHINGagain in file, even switching to ir_black again will do - or use other colorscheme, even another black-background one .
ir_blackis the only case I found incompatible.
a few tests:
( after start gvim, indent not highlighted )
:hi Normal
Normal xxx guifg=#f6f3e8 guibg=black font=Droid Sans Mono 13
:colorscheme ir_black
( indent got highlighted )
:hi Normal
Normal xxx guifg=#f6f3e8 guibg=black
Can I have it work without specify colors myself?
@nathanaelkane I'm now using MacVim and everything works properly. So I believe this is an issue in other Vims only.
Hi, has this been solved? I am having a similar problem. This is what I get when I start gvim:
:hi IndentGuidesEven
IndentGuidesEven xxx cleared
ans the same for Odd. If I reload the color theme (:colorscheme vivichalk, no need to load a different one before) everything is ok:
:hi IndentGuidesEven
IndentGuidesEven xxx guifg=#191919 guibg=#303030
Confirm this problem! I am using desert theme in gvim 7.4 + Mint 15
Not the same thing be found in console vim.
I have the same problem. I guess the reason is ":hi normal" returns current font size at the end of the result string:
:hi normal
Normal xxx guifg=White guibg=grey20 font=Monospace 10
But in function init_script_vars, only the font name is removed,font size remains in s:hi_normal
" remove 'font=<value>' from the s:hi_normal string (only seems to happen on Vim startup in Windows)
let s:hi_normal = substitute(s:hi_normal, ' font=[A-Za-z0-9:]\+', "", "")
This makes the second if in the function gui_highlight_colors fails,so IndentGuidesOdd and IndentGuidesEven are not assigned a value. I changed the function init_script_vars and then it worked fine.
" let s:hi_normal = substitute(s:hi_normal, ' font=[A-Za-z0-9:]\+', "", "")
let s:hi_normal = substitute(s:hi_normal, ' font=[A-Za-z0-9:]\+[ 0-9]*', "", "")