1
0
mirror of https://github.com/jdhao/nvim-config.git synced 2025-06-08 14:14:33 +02:00
jdhao-nvim-config/lua/config/indent-blankline.lua
jdhao 62b6226520 fix indent-blankline activation bug
When InsertLeave is triggered, we should check if we need to start
indent-blankline before enabling it.
2021-11-06 23:10:24 +08:00

24 lines
678 B
Lua

require("indent_blankline").setup({
-- U+2502 may also be a good choice, it will be on the middle of cursor.
-- U+250A is also a good choice
char = "",
show_end_of_line = false,
disable_with_nolist = true,
buftype_exclude = { "terminal" },
filetype_exclude = { "help", "git", "markdown", "snippets","text", "gitconfig" },
})
vim.cmd([[
function! Should_activate_indentblankline() abort
if index(g:indent_blankline_filetype_exclude, &filetype) == -1
IndentBlanklineEnable
endif
endfunction
augroup indent_blankline
autocmd!
autocmd InsertEnter * IndentBlanklineDisable
autocmd InsertLeave * call Should_activate_indentblankline()
augroup END
]])