Skip to content

Commit

Permalink
migrate(ibl): draft v3 config
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlesChiuGit committed Sep 28, 2023
1 parent bdc7b52 commit 3e98cdb
Showing 1 changed file with 75 additions and 45 deletions.
120 changes: 75 additions & 45 deletions lua/modules/configs/ui/indent-blankline.lua
Original file line number Diff line number Diff line change
@@ -1,50 +1,80 @@
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,
viewport_buffer = {
min = 30,
max = 500,
},
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",
indent = {
char = "",
tab_char = "",
highlight = { "Function", "Label" }, -- hl-IblIndent
smart_indent_cap = false,
priority = 2,
-- whitespace = {},
},
whitespace = {
highlight = { "Whitespace", "NonText" }, -- hl-IblWhitespace
remove_blankline_trail = true,
},
-- Note: Scope requires treesitter to be set up
scope = {
enabled = true,
char = "",
show_start = true,
show_end = true,
injected_languages = true,
highlight = { "Function", "Label" }, -- hl-IblScope
priority = 500,
include = {
node_type = {
"^if",
"^table",
"block",
"class",
"for",
"function",
"if_statement",
"import",
"list_literal",
"method",
"selector",
"type",
"var",
"while",
},
},
-- exclude = {
-- language = { "rust" },
-- node_type = { lua = { "block", "chunk" } },
-- }, -- nodes or langs
},
exclude = {
filetypes = {
"", -- for all buffers without a file type
"dashboard",
"dotooagenda",
"flutterToolsOutline",
"fugitive",
"git",
"gitcommit",
"help",
"json",
"log",
"markdown",
"NvimTree",
"peekaboo",
"startify",
"TelescopePrompt",
"todoist",
"txt",
"undotree",
"text",
"vimwiki",
"vista",
},
buftypes = { "terminal", "nofile", "quickfix", "prompt" },
},
space_char_blankline = " ",
})
end

0 comments on commit 3e98cdb

Please sign in to comment.