aboutsummaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorjdhao <jdhao@hotmail.com>2023-09-28 23:37:35 +0200
committerjdhao <jdhao@hotmail.com>2023-09-28 23:41:42 +0200
commit4d8ef868ad0ef7f6433d91332aa6649186d9a2fb (patch)
tree0f0079632a0b88d4da690a631333394b507c6d14 /lua
parent3137850db67b1b45111656e8749b60eb936dfa7d (diff)
upgrade indent-blankline to v3
Diffstat (limited to 'lua')
-rw-r--r--lua/config/indent-blankline.lua28
-rw-r--r--lua/plugins.lua1
2 files changed, 19 insertions, 10 deletions
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,
})
diff --git a/lua/plugins.lua b/lua/plugins.lua
index 054ec92..1edbe04 100644
--- a/lua/plugins.lua
+++ b/lua/plugins.lua
@@ -170,6 +170,7 @@ local plugin_specs = {
{
"lukas-reineke/indent-blankline.nvim",
event = "VeryLazy",
+ main = 'ibl',
config = function()
require("config.indent-blankline")
end,