diff --git a/lua/.luarc.json b/lua/.luarc.json new file mode 100644 index 0000000..0d7584e --- /dev/null +++ b/lua/.luarc.json @@ -0,0 +1,5 @@ +{ + "diagnostics.disable": [ + "undefined-global" + ] +} \ No newline at end of file diff --git a/lua/lazy-plugins.lua b/lua/lazy-plugins.lua index 53729ec..7bf35c3 100644 --- a/lua/lazy-plugins.lua +++ b/lua/lazy-plugins.lua @@ -60,9 +60,7 @@ local plugins = { -- TODO: check the cmp sources "hrsh7th/cmp-buffer", "hrsh7th/cmp-cmdline", - "hrsh7th/cmp-nvim-lsp-document-symbol", "FelipeLema/cmp-async-path", - "petertriho/cmp-git", "ray-x/cmp-treesitter", { "saadparwaiz1/cmp_luasnip", @@ -75,13 +73,18 @@ local plugins = { config = function() require("plugins.nvim-autopairs") end - } + }, }, event = { "InsertEnter", "CmdlineEnter" }, config = function() require("plugins/cmp") end }, + { + "Dynge/gitmoji.nvim", + ft = "gitcommit", + dependencies = "hrsh7th/nvim-cmp" + }, { "hrsh7th/cmp-nvim-lsp", dependencies = { @@ -110,7 +113,6 @@ local plugins = { "jose-elias-alvarez/null-ls.nvim" } }, - -- Code editing { "machakann/vim-sandwich", @@ -134,8 +136,21 @@ local plugins = { require("plugins.telescope") end }, + { + "tpope/vim-fugitive", + event = "CmdlineEnter" + }, -- Eye candy UI + { + "NvChad/nvim-colorizer.lua", + cmd = { "ColorizerAttachToBuffer", + "ColorizerToggle" + }, + config = function() + require("colorizer").setup() + end + }, { "winston0410/range-highlight.nvim", event = "CmdlineEnter" @@ -151,9 +166,15 @@ local plugins = { { "lewis6991/gitsigns.nvim", event = "BufEnter", - config = function() - require('gitsigns').setup() - end + opts = { + signcolumn = false, + numhl = true, + current_line_blame_opts = { + delay = 300, + ignore_whitespace = false, + virt_text_priority = 100, + }, + }, } } @@ -166,6 +187,7 @@ local vscode_plugins = { require("Comment").setup() end }, + "tpope/vim-fugitive" } if vim.g.vscode then diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 1564e4a..5070181 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -70,11 +70,12 @@ cmp.setup.cmdline({ '/', '?' }, { -- Set configuration for specific filetype. cmp.setup.filetype('gitcommit', { - sources = cmp.config.sources({ - { name = 'git' }, -- You can specify the `cmp_git` source if you were installed it. - }, { - { name = 'buffer' }, - }) + sources = cmp.config.sources( + { + { name = 'buffer' }, + }, { + { name = 'gitmoji' } + }) }) -- `:` cmdline setup. @@ -91,5 +92,3 @@ cmp.setup.cmdline(':', { } }) }) - -require("cmp_git").setup() diff --git a/lua/plugins/lsp-signature.lua b/lua/plugins/lsp-signature.lua deleted file mode 100644 index 0c27826..0000000 --- a/lua/plugins/lsp-signature.lua +++ /dev/null @@ -1,4 +0,0 @@ -require"lsp_signature".setup({ - hint_enable = false, - zindex = 50, -}) diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index a3f0d29..1f200c1 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -3,7 +3,7 @@ vim.keymap.set('n', 'e', vim.diagnostic.open_float) vim.keymap.set('n', '[d', vim.diagnostic.goto_prev) vim.keymap.set('n', ']d', vim.diagnostic.goto_next) -vim.keymap.set('n', 'q', vim.diagnostic.setloclist) +vim.keymap.set('n', 'qf', vim.diagnostic.setloclist) -- Use LspAttach autocommand to only map the following keys -- after the language server attaches to the current buffer @@ -50,3 +50,10 @@ require("mason-lspconfig").setup_handlers { -- For example, a handler override for the `rust_analyzer`: ["rust_analyzer"] = function() require("rust-tools").setup {} end } + +-- customize lsp symbols +local signs = { Error = "󰅚 ", Warn = "󰀪 ", Hint = "󰌶 ", Info = " " } +for type, icon in pairs(signs) do + local hl = "DiagnosticSign" .. type + vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = nil }) +end diff --git a/lua/plugins/matchup.lua b/lua/plugins/matchup.lua deleted file mode 100644 index e93e7cd..0000000 --- a/lua/plugins/matchup.lua +++ /dev/null @@ -1,5 +0,0 @@ -require'nvim-treesitter.configs'.setup { - matchup = { - enable = true -- mandatory, false will disable the whole extension - } -}