diff options
| author | Michal Hanus <mikehanus@protonmail.com> | 2025-12-29 19:02:55 +0100 |
|---|---|---|
| committer | Michal Hanus <mikehanus@protonmail.com> | 2025-12-29 19:02:55 +0100 |
| commit | 5eda7770be54f222e27e87190a95847e6d0e2c8c (patch) | |
| tree | 6974ac951d1f955f1a05144f1504a41fcf990251 /.config/nvim/lua/config/indent-blankline.lua | |
| parent | 688a636a43e70da5337c8dd671d4269621fae80b (diff) | |
nvim setup
Diffstat (limited to '.config/nvim/lua/config/indent-blankline.lua')
| -rw-r--r-- | .config/nvim/lua/config/indent-blankline.lua | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/.config/nvim/lua/config/indent-blankline.lua b/.config/nvim/lua/config/indent-blankline.lua new file mode 100644 index 0000000..9b210d7 --- /dev/null +++ b/.config/nvim/lua/config/indent-blankline.lua @@ -0,0 +1,36 @@ +local api = vim.api + +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, + }, + 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 = "IBLDisable", +}) + +api.nvim_create_autocmd("InsertLeave", { + pattern = "*", + group = gid, + callback = function() + if not vim.tbl_contains(exclude_ft, vim.bo.filetype) then + vim.cmd([[IBLEnable]]) + end + end, +}) |
