diff --git a/configs/nvim/lua/plugin/visualization/indent-blankline.lua b/configs/nvim/lua/plugin/visualization/indent-blankline.lua index 2cc1998..8358611 100644 --- a/configs/nvim/lua/plugin/visualization/indent-blankline.lua +++ b/configs/nvim/lua/plugin/visualization/indent-blankline.lua @@ -3,21 +3,57 @@ local registry = require('lib.registry') registry.install { 'lukas-reineke/indent-blankline.nvim', config = function () - require('indent_blankline').setup { - char = '▏', - use_treesitter = true, - show_current_context = true, - filetype_exclude = { - 'text', 'help', 'startify', 'alpha', 'packer', 'lazy', 'mason' + require('ibl').setup { + indent = { + char = '▏', }, - buftype_exclude = { 'terminal' }, - -- better context scope highlight (https://github.com/lukas-reineke/indent-blankline.nvim/issues/61#issuecomment-803613439) - context_patterns = { - 'class', 'function', 'method', '^if', '^while', - '^for', '^object', '^table', 'block', 'arguments' + scope = { + show_start = false, + show_end = false, + include = { + node_type = { + -- better scope highlight + -- https://github.com/lukas-reineke/indent-blankline.nvim/issues/632#issuecomment-1732366788 + lua = { + 'chunk', + 'do_statement', + 'while_statement', + 'repeat_statement', + 'if_statement', + 'for_statement', + 'function_declaration', + 'function_definition', + 'table_constructor', + 'assignment_statement', + }, + typescript = { + 'statement_block', + 'function', + 'arrow_function', + 'function_declaration', + 'method_definition', + 'for_statement', + 'for_in_statement', + 'catch_clause', + 'object_pattern', + 'arguments', + 'switch_case', + 'switch_statement', + 'switch_default', + 'object', + 'object_type', + 'ternary_expression', + }, + } + } }, - space_char = ' ', - space_char_blankline = ' ' + exclude = { + filetypes = { + 'lspinfo', 'packer', 'lazy', 'checkhealth', 'help', 'man', + 'TelescopePrompt', 'TelescopeResults', 'text', + 'startify', 'alpha', 'mason' + }, + } } end }