From 4d8ef868ad0ef7f6433d91332aa6649186d9a2fb Mon Sep 17 00:00:00 2001 From: jdhao Date: Thu, 28 Sep 2023 23:37:35 +0200 Subject: upgrade indent-blankline to v3 --- lua/config/indent-blankline.lua | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'lua/config/indent-blankline.lua') diff --git a/lua/config/indent-blankline.lua b/lua/config/indent-blankline.lua index 3c4a33d..3ddadbe 100644 --- a/lua/config/indent-blankline.lua +++ b/lua/config/indent-blankline.lua @@ -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, }) -- cgit v1.2.3