From 284511be86971556306c1422ac99fe174c28fa0e Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 11 Nov 2023 11:45:14 +0800 Subject: [PATCH] Update UI --- lua/lazy-plugins.lua | 55 ++++++++++++++++++++++---------- lua/mappings.lua | 17 +++------- lua/plugins/emmet.lua | 1 - lua/plugins/gitsigns.lua | 33 ------------------- lua/plugins/indent-blankline.lua | 9 ------ lua/plugins/lsp.lua | 2 +- lua/plugins/symbols-outline.lua | 1 + lua/plugins/treesitter.lua | 14 -------- 8 files changed, 44 insertions(+), 88 deletions(-) delete mode 100644 lua/plugins/emmet.lua delete mode 100644 lua/plugins/gitsigns.lua delete mode 100644 lua/plugins/indent-blankline.lua create mode 100644 lua/plugins/symbols-outline.lua diff --git a/lua/lazy-plugins.lua b/lua/lazy-plugins.lua index be9f92b..53729ec 100644 --- a/lua/lazy-plugins.lua +++ b/lua/lazy-plugins.lua @@ -18,6 +18,7 @@ local opts = { } local plugins = { + -- main UI { "ellisonleao/gruvbox.nvim", lazy = false, @@ -33,22 +34,21 @@ local plugins = { require("plugins.statusline") end }, + -- TS, LSP, Completion { "williamboman/mason.nvim" }, { - "nvim-treesitter/nvim-treesitter-context", - dependencies = { - "nvim-treesitter/nvim-treesitter" - }, + + "nvim-treesitter/nvim-treesitter", + config = function() + require("plugins.treesitter") + end }, { - "HiPhish/nvim-ts-rainbow2", + "nvim-treesitter/nvim-treesitter-context", dependencies = { "nvim-treesitter/nvim-treesitter", - config = function() - require("plugins.treesitter") - end }, }, { @@ -110,15 +110,23 @@ local plugins = { "jose-elias-alvarez/null-ls.nvim" } }, - "machakann/vim-sandwich", + + -- Code editing + { + "machakann/vim-sandwich", + keys = "s" + }, { "numToStr/Comment.nvim", - event = "BufEnter", - config = function () + keys = "g", + config = function() require("Comment").setup() end }, - "andymass/vim-matchup", + { + "andymass/vim-matchup", + event = "BufEnter" + }, { "nvim-telescope/telescope.nvim", dependencies = { 'nvim-lua/plenary.nvim' }, @@ -126,13 +134,26 @@ local plugins = { require("plugins.telescope") end }, - { - "preservim/tagbar", - cmd = "TagbarToggle" - }, + + -- Eye candy UI { "winston0410/range-highlight.nvim", event = "CmdlineEnter" + }, + { + 'simrat39/symbols-outline.nvim', + cmd = { 'SymbolsOutline', 'SymbolsOutlineOpen' }, + opts = { autofold_depth = 12 } + }, + { + 'stevearc/dressing.nvim' + }, + { + "lewis6991/gitsigns.nvim", + event = "BufEnter", + config = function() + require('gitsigns').setup() + end } } @@ -141,7 +162,7 @@ local vscode_plugins = { { "numToStr/Comment.nvim", event = "BufEnter", - config = function () + config = function() require("Comment").setup() end }, diff --git a/lua/mappings.lua b/lua/mappings.lua index 17c0b7a..b93b7d8 100644 --- a/lua/mappings.lua +++ b/lua/mappings.lua @@ -35,18 +35,9 @@ map('i', ',', ',u', { noremap = true }) map('i', '.', '.u', { noremap = true }) map('i', '!', '!u', { noremap = true }) map('i', '?', '?u', { noremap = true }) - -- plugin mappings --- gitsigns -map('', 'gs', ':Gitsigns toggle_signs', { silent = true }) --- toggle tagbar -map('', 'tt', ':TagbarToggle', { silent = true }) - --- toggle Hop -map('', 'b', ':HopWordBC', { silent = true }) -map('', 'w', ':HopWordAC', { silent = true }) -map('', 'l', ':HopWordCurrentLine', { silent = true }) - --- telescope stuff +-- symbols outline +map('n', 'o', ':SymbolsOutline', { silent = true }) +-- telescope map('', 'fd', ':Telescope fd', { silent = true }) -map('', 'tb', ':Telescope buffers', { silent = true }) +map('', 'bf', ':Telescope buffers', { silent = true }) diff --git a/lua/plugins/emmet.lua b/lua/plugins/emmet.lua deleted file mode 100644 index dc936cf..0000000 --- a/lua/plugins/emmet.lua +++ /dev/null @@ -1 +0,0 @@ -vim.g.emmet_html5 = 1 diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua deleted file mode 100644 index 75d71d2..0000000 --- a/lua/plugins/gitsigns.lua +++ /dev/null @@ -1,33 +0,0 @@ -require('gitsigns').setup { - -- signs - status_formatter = nil, -- Use default - numhl = false, - sign_priority = 10, - attach_to_untracked = false, -- fix gitsigns with yadm in ~ - signs = { - add = {hl = "DiffAdd", text = "+", numhl = "GitSignsAddNr"}, - change = {hl = "DiffChange", text = ">", numhl = "GitSignsChangeNr"}, - changedelete = { - hl = "DiffChange", - text = "~", - numhl = "GitSignsChangeNr" - }, - delete = {hl = "DiffDelete", text = "_", numhl = "GitSignsDeleteNr"}, - topdelete = { - hl = "DiffDelete", - text = "‾", - numhl = "GitSignsDeleteNr" - } - }, - -- yadm = {enable = true}, - - -- Current line blame - current_line_blame = true, -- Toggle with `:Gitsigns toggle_current_line_blame` - current_line_blame_opts = { - virt_text = true, - virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' - delay = 250, - ignore_whitespace = false - }, - current_line_blame_formatter = ', - ' -} diff --git a/lua/plugins/indent-blankline.lua b/lua/plugins/indent-blankline.lua deleted file mode 100644 index 6c82961..0000000 --- a/lua/plugins/indent-blankline.lua +++ /dev/null @@ -1,9 +0,0 @@ -require("indent_blankline").setup { - buftype_exclude = {"terminal", "help", "packer", "NvimTree", "tagbar"}, - char = "▏", -- also set as global env - space_char_blankline = ' ', - max_indent_increase = 2, - show_first_indent_level = false, - show_trailing_blankline_indent = false, - use_treesitter = true -} diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 17b54a3..a3f0d29 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -30,7 +30,7 @@ vim.api.nvim_create_autocmd('LspAttach', { vim.keymap.set('n', 'rn', vim.lsp.buf.rename, opts) vim.keymap.set({ 'n', 'v' }, 'ca', vim.lsp.buf.code_action, opts) vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts) - vim.keymap.set('n', 'f', function() + vim.keymap.set('n', 'fm', function() vim.lsp.buf.format { async = true } end, opts) end, diff --git a/lua/plugins/symbols-outline.lua b/lua/plugins/symbols-outline.lua new file mode 100644 index 0000000..d9f99c4 --- /dev/null +++ b/lua/plugins/symbols-outline.lua @@ -0,0 +1 @@ +require("symbols-outline").setup(opts) diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index d0e6773..c78c603 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -1,4 +1,3 @@ -local rainbow = require("ts-rainbow") require("nvim-treesitter.configs").setup({ ensure_installed = { "lua" }, -- one of "all", "maintained" (parsers with maintainers), or a list of languages highlight = { @@ -11,17 +10,4 @@ require("nvim-treesitter.configs").setup({ use_languagetree = true, }, indent = { enable = true }, - rainbow = { - enable = true, - strategy = rainbow.strategy['local'], - hlgroups = { - "TSRainbowYellow", - "TSRainbowBlue", - "TSRainbowOrange", - "TSRainbowGreen", - "TSRainbowViolet", - "TSRainbowCyan", - "TSRainbowRed", - }, - }, })