neovimneovim-plugin

Nvim indent-blankline dashed line


I use for Nvim 0.10.2 the plugin indent-blankline.

I try to get a solid coloured indent guide for the active block where my cursor is on but it turns to a shade dashed line instead. I tried :

opts = {
  char = '▏',
  show_trailing_blankline_indent = false,
},

but no success

enter image description here

Here we can see the dashed line.


Solution

  • You are not sharing the full indent-blankline config spec, which makes providing a complete answer difficult.

    First, check the config spec of the plugin. The char field must go inside the indent table and the documentation doesn't mention anything about show_trailing_blankline_indent. The closest option is remove_blankline_trail which is set to true by default.

    Assuming you are using lazy.nvim, if you define the opts field and overwrite the default config function, you should use the opts argument passed internally by lazy in the config function and pass it into the plugin's setup call:

    {
      "lukas-reineke/indent-blankline.nvim",
      opts = {
        indent = {
          char = '▏',
        },
      },
      config = function(_, opts)
        local highlights = {...}
        vim.tbl_extend("force", opts, {
          -- options that for some reason you couldn't add in the opts field table
        })
    
        require("ibl").setup(opts)
      end,
    }
    

    You can also omit completely the opts field and define that table directly into the config function:

    {
      "lukas-reineke/indent-blankline.nvim",
      config = function()
        local highlights = {...}
        local opts = {...}
        require("ibl").setup(opts)
      end,
    }
    

    If you don't need to add anything special to the opts, you can define everything directly in the table and omit the config field entirely. Lazy resolves the content of the opts field, and if it is not nil, it automatically executes a require("plugin-module").setup(opts) call. For most plugin configurations, defining the opts field is sufficient, since Lazy can automatically determine the require module name of the plugin. However, because the indent-blankline module is not indent-blankline but ibl, you need to specify that in the main field of the spec for this automatic behavior to work:

    {
      "lukas-reineke/indent-blankline.nvim",
      main = "ibl",
      opts = {
        indent = {
          char = '▏',
        },
      },
    }
    

    All this info is in the Lazy spec and in the indent-blankline README.

    Edit: If the above configs are taking effect but you still notice a "render issue," try using a different character, such as . Also, check that no other plugin, such as mini.indentscope, is adding its own indent character.