Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ibl): support indent-blankline v3 #1011

Merged
merged 5 commits into from
Oct 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
4 changes: 2 additions & 2 deletions lua/modules/configs/ui/catppuccin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ return function()
MasonNormal = { link = "NormalFloat" },

-- For indent-blankline
IndentBlanklineChar = { fg = cp.surface0 },
IndentBlanklineContextChar = { fg = cp.surface2, style = { "bold" } },
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 @@ -29,7 +29,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