Skip to content

Commit

Permalink
feat(ibl): support indent-blankline v3 (ayamir#1011)
Browse files Browse the repository at this point in the history
* migrate(ibl): `indent-blankline` to v3

* migrate(ibl): draft v3 config

* feat(ibl): plugins support & misc updates

* fix merge conflicts

---------

Co-authored-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com>
  • Loading branch information
2 people authored and singlemancombat committed Oct 1, 2023
1 parent cb50973 commit 8943ca9
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 50 deletions.
1 change: 0 additions & 1 deletion lua/modules/configs/editor/bigfile.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ return function()
filesize = 1, -- size of the file in MiB
pattern = { "*" }, -- autocmd pattern
features = { -- features to disable
"indent_blankline",
"lsp",
"illuminate",
"treesitter",
Expand Down
6 changes: 3 additions & 3 deletions lua/modules/configs/ui/catppuccin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ return function()
-- For mason.nvim
MasonNormal = { link = "NormalFloat" },

-- For indent-blankline
IndentBlanklineChar = { fg = cp.surface0 },
IndentBlanklineContextChar = { fg = cp.surface2, style = { "bold" } },
-- For indent-blankline
IblIndent = { fg = cp.surface0 },
IblScope = { fg = cp.surface2, style = { "bold" } },

-- For nvim-cmp and wilder.nvim
Pmenu = { fg = cp.overlay2, bg = transparent_background and cp.none or cp.base },
Expand Down
135 changes: 90 additions & 45 deletions lua/modules/configs/ui/indent-blankline.lua
Original file line number Diff line number Diff line change
@@ -1,50 +1,95 @@
return function()
require("modules.utils").load_plugin("indent_blankline", {
char = "",
context_char = "",
show_first_indent_level = true,
filetype_exclude = {
"", -- for all buffers without a file type
"alpha",
"dashboard",
"dotooagenda",
"flutterToolsOutline",
"fugitive",
"git",
"gitcommit",
"help",
"json",
"log",
"markdown",
"NvimTree",
"peekaboo",
"startify",
"TelescopePrompt",
"todoist",
"txt",
"undotree",
"vimwiki",
"vista",
require("modules.utils").load_plugin("ibl", {
enabled = true,
debounce = 200,
indent = {
char = "",
tab_char = "",
smart_indent_cap = true,
priority = 2,
},
buftype_exclude = { "terminal", "nofile" },
show_trailing_blankline_indent = false,
show_current_context = true,
context_patterns = {
"^if",
"^table",
"block",
"class",
"for",
"function",
"if_statement",
"import",
"list_literal",
"method",
"selector",
"type",
"var",
"while",
whitespace = { remove_blankline_trail = true },
-- Note: The `scope` field requires treesitter to be set up
scope = {
enabled = true,
char = "",
show_start = false,
show_end = false,
injected_languages = true,
priority = 1000,
include = {
node_type = {
["*"] = {
"argument_list",
"arguments",
"assignment_statement",
"Block",
"chunk",
"class",
"ContainerDecl",
"dictionary",
"do_block",
"do_statement",
"element",
"except",
"FnCallArguments",
"for",
"for_statement",
"function",
"function_declaration",
"function_definition",
"if_statement",
"IfExpr",
"IfStatement",
"import",
"InitList",
"list_literal",
"method",
"object",
"ParamDeclList",
"repeat_statement",
"selector",
"SwitchExpr",
"table",
"table_constructor",
"try",
"tuple",
"type",
"var",
"while",
"while_statement",
"with",
},
},
},
},
exclude = {
filetypes = {
"", -- for all buffers without a file type
"alpha",
"big_file_disabled_ft",
"dashboard",
"dotooagenda",
"flutterToolsOutline",
"fugitive",
"git",
"gitcommit",
"help",
"json",
"log",
"markdown",
"NvimTree",
"Outline",
"peekaboo",
"startify",
"TelescopePrompt",
"todoist",
"txt",
"undotree",
"vimwiki",
"vista",
},
buftypes = { "terminal", "nofile", "quickfix", "prompt" },
},
space_char_blankline = " ",
})
end
1 change: 0 additions & 1 deletion lua/modules/plugins/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ ui["lewis6991/gitsigns.nvim"] = {
}
ui["lukas-reineke/indent-blankline.nvim"] = {
lazy = true,
commit = "9637670",
event = { "CursorHold", "CursorHoldI" },
config = require("ui.indent-blankline"),
}
Expand Down

0 comments on commit 8943ca9

Please sign in to comment.