1
0
mirror of https://github.com/jdhao/nvim-config.git synced 2025-06-08 14:14:33 +02:00

upgrade indent-blankline to v3

This commit is contained in:
jdhao
2023-09-28 23:37:35 +02:00
parent 3137850db6
commit 4d8ef868ad
3 changed files with 39 additions and 30 deletions

View File

@@ -1,21 +1,29 @@
local api = vim.api
local exclude_ft = { "help", "git", "markdown", "snippets", "text", "gitconfig", "alpha" }
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,
local exclude_ft = { "help", "git", "markdown", "snippets", "text", "gitconfig", "alpha", "dashboard" }
require("ibl").setup {
indent = {
-- -- U+2502 may also be a good choice, it will be on the middle of cursor.
-- -- U+250A is also a good choice
char = "",
},
scope = {
show_start = false,
show_end = false,
},
disable_with_nolist = true,
buftype_exclude = { "terminal" },
filetype_exclude = exclude_ft,
exclude = {
filetypes = exclude_ft,
buftypes = { "terminal" },
},
}
local gid = api.nvim_create_augroup("indent_blankline", { clear = true })
api.nvim_create_autocmd("InsertEnter", {
pattern = "*",
group = gid,
command = "IndentBlanklineDisable",
command = "IBLDisable",
})
api.nvim_create_autocmd("InsertLeave", {
@@ -23,7 +31,7 @@ api.nvim_create_autocmd("InsertLeave", {
group = gid,
callback = function()
if not vim.tbl_contains(exclude_ft, vim.bo.filetype) then
vim.cmd([[IndentBlanklineEnable]])
vim.cmd([[IBLEnable]])
end
end,
})

View File

@@ -170,6 +170,7 @@ local plugin_specs = {
{
"lukas-reineke/indent-blankline.nvim",
event = "VeryLazy",
main = 'ibl',
config = function()
require("config.indent-blankline")
end,