From 864818059c2aa79a95664ff37b1e2789a53357cb Mon Sep 17 00:00:00 2001 From: juan Date: Sat, 28 May 2022 23:54:46 +0800 Subject: [PATCH] Various optimizations --- lua/core.lua | 3 +++ lua/pluginList.lua | 3 ++- lua/plugins/indent-blankline.lua | 2 +- lua/plugins/nvim-tree.lua | 9 ++------- lua/plugins/treesitter.lua | 2 +- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/lua/core.lua b/lua/core.lua index 17c8825..b30abe8 100644 --- a/lua/core.lua +++ b/lua/core.lua @@ -32,3 +32,6 @@ global.glow_border = "rounded" -- leader settings global.mapleader = ' ' + +-- indent blankline settings +global.indent_blankline_char = '▏' diff --git a/lua/pluginList.lua b/lua/pluginList.lua index d5d03df..8d7931a 100644 --- a/lua/pluginList.lua +++ b/lua/pluginList.lua @@ -146,7 +146,8 @@ return require('packer').startup(function(use) } use { "lukas-reineke/indent-blankline.nvim", - after = {"nvim-treesitter"}, + after = {"nvim-treesitter", "nvim-treesitter-context"}, + event = "UIEnter", config = function() require "plugins.indent-blankline" end } use { diff --git a/lua/plugins/indent-blankline.lua b/lua/plugins/indent-blankline.lua index 4222157..92e638d 100644 --- a/lua/plugins/indent-blankline.lua +++ b/lua/plugins/indent-blankline.lua @@ -1,6 +1,6 @@ require("indent_blankline").setup { buftype_exclude = {"terminal", "help", "packer", "NvimTree", "tagbar"}, - char = "▏", + char = "▏", -- also set as global env space_char_blankline = ' ', max_indent_increase = 2, show_first_indent_level = false, diff --git a/lua/plugins/nvim-tree.lua b/lua/plugins/nvim-tree.lua index e317b1b..cf946de 100644 --- a/lua/plugins/nvim-tree.lua +++ b/lua/plugins/nvim-tree.lua @@ -5,25 +5,20 @@ require'nvim-tree'.setup { hijack_netrw = true, open_on_setup = false, ignore_ft_on_setup = {}, - auto_close = false, - open_on_tab = false, + open_on_tab = true, hijack_cursor = true, - update_cwd = false, + update_cwd = true, update_to_buf_dir = {enable = true, auto_open = true}, diagnostics = { enable = true, icons = {hint = "", info = "", warning = "", error = ""} }, - update_focused_file = {enable = false, update_cwd = false, ignore_list = {}}, system_open = {cmd = nil, args = {}}, - filters = {dotfiles = false, custom = {}}, view = { width = 30, height = 30, hide_root_folder = false, side = 'left', - auto_resize = false, - mappings = {custom_only = false, list = {}} } } diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 0b5e2a7..a9f5a77 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -6,7 +6,7 @@ require'nvim-treesitter.configs'.setup { -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). -- Using this option may slow down your editor, and you may see some duplicate highlights. -- Instead of true it can also be a list of languages - additional_vim_regex_highlighting = false, + additional_vim_regex_highlighting = true, use_languagetree = true }, indent = {enable = true}