Skip to content
This repository has been archived by the owner on Jul 29, 2023. It is now read-only.

indentLine not appearing #59

Open
leebrooks0 opened this issue Oct 25, 2013 · 31 comments
Open

indentLine not appearing #59

leebrooks0 opened this issue Oct 25, 2013 · 31 comments
Labels

Comments

@leebrooks0
Copy link

I am using Vim 7.4 and have this in my .vimrc

Bundle 'Yggdroot/indentLine'

When I :BundleInstall and restart I see nothing?

@Yggdroot
Copy link
Owner

do you indent code with spaces or tabs?

@leebrooks0
Copy link
Author

spaces

On Fri, Oct 25, 2013 at 4:36 PM, Yggdroot notifications@github.com wrote:

do you indent code with spaces or tabs?


Reply to this email directly or view it on GitHubhttps://github.com//issues/59#issuecomment-27097321
.

@leebrooks0
Copy link
Author

If I add additional code then the indent lines display

On Sat, Oct 26, 2013 at 12:31 AM, Lee Brooks leebrooks0@gmail.com wrote:

spaces

On Fri, Oct 25, 2013 at 4:36 PM, Yggdroot notifications@github.comwrote:

do you indent code with spaces or tabs?


Reply to this email directly or view it on GitHubhttps://github.com//issues/59#issuecomment-27097321
.

@nickdesaulniers
Copy link

Same issue, I have:

set expandtab
set tabstop=2
set shiftwidth=2

let g:indentLine_color_term = 239
let g:indentLine_char = 'c'

set in my .vimrc, no beans

@seemuth
Copy link

seemuth commented Feb 18, 2014

I was having the same issue in vim 7.4, but then I set g:indentLine_color_term to a different value, reloaded, and boom! Happy indent lines again!

@rantrix
Copy link

rantrix commented Apr 24, 2014

I'm also experiencing this problem. My vim version is 7.3. I'm indenting with spaces and not tabs. I tried changing the g:indentLine_color_term to many different values but nothing shows up.

@leTel
Copy link

leTel commented Jun 4, 2014

Same issue here. I'm using MacVim 7.4.
The indent only appears for new tab, not the existing.
I tried to change 'g:indentLine_color_term' without result.

@cursivecode
Copy link

I was having the same issue, but selecting the text and aligning (equal sign) showed the indent lines. Subsequent edits worked fine.

@Yggdroot
Copy link
Owner

@cursivecode I guess the code is indented with tabs before aligning.

@dvinothkumar
Copy link

Using Vim 7.4 . I see the same issue. I work around this issue by having the following in my .vimrc

au BufRead,BufEnter,BufNewFile * IndentLinesReset "Workaround for issue #59

@jl4347
Copy link

jl4347 commented May 20, 2015

@dvinothkumar I was having the same issue with the plugin, and I tried you line of code, but it doesn't work, are you sure you are listing your right code here:
au BufRead,BufEnter,BufNewFile * IndentLinesReset

@dvinothkumar
Copy link

Instead of putting this in vimrc, first try if executing IndentLinesReset
in your buffer fixes this issue. If it does, then the only need to figure
out why au is not taking effect. If it doesn't, then I'm not sure where to
go from here.

On Wed, May 20, 2015 at 9:43 AM, Jialun Liu notifications@github.com
wrote:

@dvinothkumar https://github.com/dvinothkumar I was having the same
issue with the plugin, and I tried you line of code, but it doesn't work,
are you sure you are listing your right code here:
au BufRead,BufEnter,BufNewFile * IndentLinesReset


Reply to this email directly or view it on GitHub
#59 (comment).

@counterbeing
Copy link

jl4347's fix seems to have worked for me... also running vim 7.4

thanks!


Very strange, it worked for a moment, and on my next reload of Vim it no longer appears to work.

@counterbeing
Copy link

Another update. I use brew to install vim. I just unlinked vim, and built it from source using brew install vim --HEAD. Once again, everything worked, but once I quit vim, and reopened it, indentLine failed to load again. The commands to turn it on or off don't appear in the buffer's autocomplete at all, either... It makes it seem to me like it's not loading.

I'm not too familiar with the inner workings of vim, but I did try to :vs ~/.vim/bundle/indentLine/after/plugin/indentLine.vim, thinking maybe I could manually source the plugin and it would work, but still no luck with that either.

@counterbeing
Copy link

Aha. Another update. I had a big mixup. I've been typing vi and vim as i thought they linked to the same place, but they do not! So, forget everything I mentioned before, and be sure that you're actually using the version of vim you think you are if you're running into this issue. Everything is working great for me with Vi IMproved 7.4 (2013 Aug 10, compiled Jun 12 2015 10:56:07) Included patches: 1-712

@noscripter
Copy link

This is related to the conceal behaviour of vim, please make sure you have let g:indentLine_conceallevel set to bigger than 0, and check your current buffer's conceallevel option is set to bigger than 0.

Solution:

  1. Edit ~/.vimrc file: :e $MYVIMRC;
  2. Add the following two lines to the end of the file:
set conceallevel=1
let g:indentLine_conceallevel=1

@IvRRimum
Copy link

Vim 7.3 Tryed all above, still not working...

@IvRRimum
Copy link

When i call :IndentLinesToggle It shows command not found. And Yes I ran :BundleInstall

Heres my vimrc:

`1 set nocompatible

2 filetype off

3

4 set rtp+=~/.vim/bundle/vundle/

5
6 call vundle#rc()
7
8 Bundle 'gmarik/vundle'
9
10 Bundle 'altercation/vim-colors-solarized'
11
12 Bundle 'rking/ag.vim'
13
14 Bundle 'fatih/vim-go'
15
16 Bundle 'davidhalter/jedi-vim'
17
18 Bundle 'Yggdroot/indentLine'
19
20 filetype plugin indent on
21
22 set runtimepath^=/.vim/bundle/ctrlp.vim
23
24 set tabstop=2
25 set expandtab
26 set shiftwidth=2
27
28 set number
29 syntax enable
30
31 set background=dark
32
33 let g:solarized_termcolors = 256
34
35 colorscheme solarized
36
37 if fnamemodify(getcwd(), ':t') == "portal"
38 set shiftwidth=2
39 set softtabstop=2
40
41 autocmd BufWritePost * !
/pushpor.sh
42 endif
43
44 if fnamemodify(getcwd(), ':t') == "bpo_crm"
45 set expandtab
46 set shiftwidth=2
47 set softtabstop=2
48
49 autocmd BufWritePost * !~/pushbpo.sh
50 endif
51
52 function! RestoreRegister()
53 let @" = s:restore_reg
54 return ''
55 endfunction
56
57 function! s:Repl()
58 let s:restore_reg = @"
59 return "p@=RestoreRegister()"
60 endfunction
61
62 vnoremap p Repl()`

@kedashoe
Copy link

Vim 7.3 Tryed all above, still not working...

I also had Vim 7.3 and this plugin was not working. Try running

:echo has("conceal")

If you get back a 0, I think you are in trouble. Probably earlier minor versions of 7.3 did not have conceal yet? I installed Vim 7.4 and this plugin immediately started working.

@babasbot
Copy link

babasbot commented Dec 1, 2016

I just recompiled vim from source with: brew install --build-from-source vim and it works.

$ vim --version # before
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Nov 27 2016 08:43:27)
MacOS X (unix) version
Included patches: 1-104
Compiled by Homebrew
Huge version without GUI.  Features included (+) or not (-):
+acl             +file_in_path    +mouse_sgr       +tag_old_static
+arabic          +find_in_path    -mouse_sysmouse  -tag_any_white
+autocmd         +float           +mouse_urxvt     -tcl
-balloon_eval    +folding         +mouse_xterm     +termguicolors
-browse          -footer          +multi_byte      +terminfo
++builtin_terms  +fork()          +multi_lang      +termresponse
+byte_offset     -gettext         -mzscheme        +textobjects
+channel         -hangul_input    +netbeans_intg   +timers
+cindent         +iconv           +num64           +title
-clientserver    +insert_expand   +packages        -toolbar
+clipboard       +job             +path_extra      +user_commands
+cmdline_compl   +jumplist        +perl            +vertsplit
+cmdline_hist    +keymap          +persistent_undo +virtualedit
+cmdline_info    +lambda          +postscript      +visual
+comments        +langmap         +printer         +visualextra
+conceal         +libcall         +profile         +viminfo
+cryptv          +linebreak       +python          +vreplace
+cscope          +lispindent      -python3         +wildignore
+cursorbind      +listcmds        +quickfix        +wildmenu
+cursorshape     +localmap        +reltime         +windows
+dialog_con      -lua             +rightleft       +writebackup
+diff            +menu            +ruby            -X11
+digraphs        +mksession       +scrollbind      -xfontset
-dnd             +modify_fname    +signs           -xim
-ebcdic          +mouse           +smartindent     -xpm
+emacs_tags      -mouseshape      +startuptime     -xsmp
+eval            +mouse_dec       +statusline      -xterm_clipboard
+ex_extra        -mouse_gpm       -sun_workshop    -xterm_save
+extra_search    -mouse_jsbterm   +syntax
+farsi           +mouse_netterm   +tag_binary
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X_UNIX  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang   -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib  -L/usr/local/lib -o vim        -lncurses -liconv -framework Cocoa   -mmacosx-version-min=10.12 -fstack-protector-strong -L/usr/local/lib  -L/usr/local/Cellar/perl/5.24.0_1/lib/perl5/5.24.0/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc -F/usr/local/opt/python/Frameworks -framework Python   -lruby.2.3.0 -lobjc -L/usr/local/Cellar/ruby/2.3.3/lib
$ vim --version # after
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Dec  1 2016 12:43:54)
MacOS X (unix) version
Included patches: 1-106
Compiled by Homebrew
Huge version without GUI.  Features included (+) or not (-):
+acl             +file_in_path    +mouse_sgr       +tag_old_static
+arabic          +find_in_path    -mouse_sysmouse  -tag_any_white
+autocmd         +float           +mouse_urxvt     -tcl
-balloon_eval    +folding         +mouse_xterm     +termguicolors
-browse          -footer          +multi_byte      +terminfo
++builtin_terms  +fork()          +multi_lang      +termresponse
+byte_offset     -gettext         -mzscheme        +textobjects
+channel         -hangul_input    +netbeans_intg   +timers
+cindent         +iconv           +num64           +title
-clientserver    +insert_expand   +packages        -toolbar
+clipboard       +job             +path_extra      +user_commands
+cmdline_compl   +jumplist        +perl            +vertsplit
+cmdline_hist    +keymap          +persistent_undo +virtualedit
+cmdline_info    +lambda          +postscript      +visual
+comments        +langmap         +printer         +visualextra
+conceal         +libcall         +profile         +viminfo
+cryptv          +linebreak       +python          +vreplace
+cscope          +lispindent      -python3         +wildignore
+cursorbind      +listcmds        +quickfix        +wildmenu
+cursorshape     +localmap        +reltime         +windows
+dialog_con      -lua             +rightleft       +writebackup
+diff            +menu            +ruby            -X11
+digraphs        +mksession       +scrollbind      -xfontset
-dnd             +modify_fname    +signs           -xim
-ebcdic          +mouse           +smartindent     -xpm
+emacs_tags      -mouseshape      +startuptime     -xsmp
+eval            +mouse_dec       +statusline      -xterm_clipboard
+ex_extra        -mouse_gpm       -sun_workshop    -xterm_save
+extra_search    -mouse_jsbterm   +syntax
+farsi           +mouse_netterm   +tag_binary
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X_UNIX  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang   -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib  -L/usr/local/lib -o vim        -lncurses -liconv -framework Cocoa   -mmacosx-version-min=10.12 -fstack-protector-strong -L/usr/local/lib  -L/usr/local/Cellar/perl/5.24.0_1/lib/perl5/5.24.0/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc -F/usr/local/opt/python/Frameworks -framework Python   -lruby.2.3.0 -lobjc -L/usr/local/Cellar/ruby/2.3.3/lib
$ diff diff before.txt after.txt
1c1
< VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Nov 27 2016 08:43:27)
---
> VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Dec  1 2016 12:43:54)
3c3
< Included patches: 1-104
---
> Included patches: 1-106

captura de pantalla 2016-12-01 a la s 13 06 33

@PegasusWang
Copy link

PegasusWang commented Jan 13, 2017

I install both python-mode and vim-go plugin, it works when I edit python file ,but not works for go file. I wonder if vim-go has conflicts with indentLine.

@justrajdeep
Copy link

I added the following autocommand in my vimrc

autocmd VimEnter,WinEnter,BufNewFile,BufRead,BufEnter,TabEnter * IndentLinesReset

it gives me IndentLines but when I switch tab, it vanishes. If I run :IndentLinesReset it appears again.

Any clue how I can fix it?

@scifisamurai
Copy link

scifisamurai commented Dec 4, 2017

I recently upgraded to OS X High Sierra and the out of the box Vim 8 that comes with that version of OS X does NOT have the conceal feature included. This can be seen by running /usr/bin/vim --version or using :echo has("conceal") as mentioned by others previously.

Simply doing brew install vim does end up installing vim into /usr/local/bin/ and that version does have conceal which then allows this plugin to work :).

@0x5010
Copy link

0x5010 commented Dec 28, 2017

I install both python-mode and vim-go plugin, it works when I edit python file ,but not works for go file. I wonder if vim-go has conflicts with indentLine. too!!!

@reubinoff
Copy link

reubinoff commented Jan 14, 2018

doesn't work for me either...

Got an error:
screen shot 2018-01-14 at 9 56 43

my vim:
screen shot 2018-01-14 at 9 55 21

@Yggdroot
Copy link
Owner

@reubinoff your vim does not support conceal, see your screenshot: -conceal.

@reubinoff
Copy link

How to enable it?

@Yggdroot
Copy link
Owner

you should compile vim yourself.

@funkyHat
Copy link

The regular homebrew build of vim also has +conceal so compiling from source shouldn't be necessary (@reubinoff your vim is the system vim from Apple, you need to either install from homebrew or, as @Yggdroot said, compile vim yourself)

@reubinoff
Copy link

@funkyHat thanks

brk3 added a commit to brk3/indentLine that referenced this issue Jun 18, 2020
I couldn't figure out why this plugin wouldn't work for me for quite a while, till I read Yggdroot#59.

This adds a note to the README to let users know they need +conceal compiled in.
@neeerp
Copy link

neeerp commented Jan 3, 2021

I was having trouble getting the plugin working. I noticed that if I made a bunch of spaces in a new line in any file, I'd get indent guides, however spaces that were automatically created (e.g. auto indenting in a scope) was not working.

After commenting out various parts of my init.vim in/out, my issue turned out to be related to the foldmethod setting. I had it set to foldmethod=syntax, and this would cause indentLine to stop working properly (even though I had foldlevel=99 forcing my folds open by default, indentLine would still break).

From the looks of it, it looks like folds aren't compatible with indentLine (at least with the current nightly version of nvim)... I disabled all of my configs beside foldmethod=syntax and indentLine (no other plugins being loaded) and still encounter the problem. I managed to get indentLine to work by setting foldmethod=manual (which is the default setting).

For anyone reading this and applying my fix, make sure you're clearing your views folder to get rid of any saved folds if you are using views.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests