Yggdroot / indentLine

A vim plugin to display the indention levels with thin vertical lines
MIT License
4.14k stars 227 forks source link

Request for an addition to the documentation - plugin is not compatible with... And #231

Open EdmundsEcho opened 6 years ago

EdmundsEcho commented 6 years ago

First of all, thank you for this plugin that greatly improves my workflow. I have a tall screen; the visual queue helps a lot.

While obvious in hindsight, it took me a while to figure out why my Haskell operators (ligatures) were barely visible. What I want to be subtle in indentLine needs to be visually distinctive in vim-haskellConcealPlus (and similar plugins). It would be great if you had a list of plugins that also rely on the conceal setting and highlight group to remind users what to consider when installing the plugin.

The AND in the title: Is there a way to create a separate highlight group for the visual markers the indentLine inserts into the buffer? Right now it uses Conceal. If the name were ConcealIndentLine, I could use both plugins. As of now, I have to disable indentLine in my Haskell work where the visual queue for alignment is less a priority when compared to the code proper.

Update with a solution

Adjust indentLine's color settings to change the display when the objective changes. For instance, going from indentLine used in JS to another file format that uses Conceal to display ligatures. In other words, use indentLine to control the hi color scheme for Conceal for indentLine and any other plugin that also use Conceal. Do not attempt to set hi for Conceal directly to "dynamically" change Conceal - it just does not work if you are using indentLine.

Default configuration Note how I disable indentLine BUT continue to use indentLine settings to control Conceal's behavior (e.g., below for Haskell).

let g:indentLine_fileTypeExclude = ['haskell','json','yaml','markdown','text','sh','vim']
let g:indentLine_conceallevel=1    " may or may not be required
let g:indentLine_setConceal=1

" color - subtle low contrast display
" Note: I also include hi Conceal =NONE near the end of my config
let g:indentLine_color_term=236
let g:indentLine_bgcolor_term='NONE'

" required if termguicolors is set
let g:indentLine_color_gui='#1E1E1E'  " #303030
let g:indentLine_bgcolor_gui='NONE'

Haskell specific settings for indentLine Note: I use ConcealPlus to display ligatures for my Haskell work. I use indentLine to control how ligatures are displayed despite what seems like disabling the plugin for haskell (see indentLine_fileTypeExclude).

  "... within an augroup
  au FileType haskell let g:indentLine_color_term=192
  au FileType haskell let g:indentLine_color_gui='#CAE982'

- E

Yggdroot commented 6 years ago

First, I don't know what plugins have used conceal. Second, there is only one way to customize the color, i.e., hi Conceal.

EdmundsEcho commented 6 years ago

Good point. How about collecting a list from users, and/or giving examples of a few plugins that might conflict? Generally, it's a plugin that relies on Conceal. There is a perfect setting to exclude certain files types and thus provide a way to help us figure out which ones to exclude e.g., json if you want to see quotes, haskellConcealPlus to show -> as a single looking char without changing the underlying code.

ahmedelgabri commented 6 years ago

Second, there is only one way to customize the color, i.e., hi Conceal.

@Yggdroot Any reason why is hi Conceal the only way & not create a custom group for the plugin only as @EdmundsEcho something like hi ConcealIndentLine or hi IndentLine?

Because I'm also having the same issue but with https://github.com/pangloss/vim-javascript#concealing-characters I like to conceal the function keyword.

Yggdroot commented 6 years ago

@ahmedelgabri It's vim's ability.

ahmedelgabri commented 6 years ago

@Yggdroot that's because the plugin depends on conceal right? is there is anyway else?

Yggdroot commented 6 years ago

yes. no.

ferrwan commented 6 years ago

Having same issue with vim-javascript's conceal. vim-indentline override vim-javascript's conceal, but if I use this version (it's the version before @Yggdroot refactor the code) they both went well.

Saul-Mirone commented 5 years ago

same as @ferrwan

ygrek commented 5 years ago

ref https://github.com/Yggdroot/indentLine/issues/155