4

I'm using vim 8.

In the attached picture you see yellow vertical lines that indicate the indentations of a code.

enter image description here

Is it possible to color depending on their indentation level? E.g.

all vertical indentation lines on indentation level 1 should be red

all vertical indentation lines on indentation level 2 should be yellow

all vertical indentation lines on indentation level 3 should be green

etc.

PS: If it is of any relevance: I'm using https://github.com/Yggdroot/indentLine That plugin doesn't have an option to color the vertical indentation lines dependent on the indentation level

6
  • 1
    no it is not possible. Feb 10, 2018 at 18:32
  • @ChristianBrabandt Why not? Feb 10, 2018 at 18:53
  • 2
    Because it is not possible? Feb 10, 2018 at 18:56
  • but you could use different line styles for different levels with let g:indentLine_char_list = ['|', '¦', '┆', '┊'] if this helps.
    – Wolfson
    Dec 2, 2020 at 11:09
  • You may also like the vim-indent-guides plugin. It does not color the lines, but visualizes indentation levels based on alternating colors of white spaces.
    – Wolfson
    Dec 2, 2020 at 11:42

1 Answer 1

0

here is how

use this plugin and follow the instructions in the README.md

https://github.com/lukas-reineke/indent-blankline.nvim

2
  • 1
    Hi @Kalindu, it would be more helpful if you provide the answer or specific context your answer. Often times, README files can be detailed and cover many topics.
    – Vinn
    Oct 26, 2022 at 1:29
  • 1
    This only works for Neovim, not Vim.
    – Breno
    Mar 27, 2023 at 12:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.