From d871422273e7e1df833aeebc9f4a1f150204c1b2 Mon Sep 17 00:00:00 2001 From: amolinae06 Date: Sat, 25 Jan 2025 00:08:57 -0600 Subject: [PATCH] removed dashboard, added autopairs --- lua/config/plugins/cmp.lua | 5 +++-- lua/config/plugins/dashboard.lua | 16 --------------- lua/config/plugins/lsp.lua | 6 ++++++ lua/config/plugins/mason.lua | 9 ++++++++ lua/config/settings.lua | 2 +- lua/plugins/cmp.lua | 35 ++++++++++++++++++++++++++------ lua/plugins/lspconfig.lua | 19 ++++------------- lua/plugins/treesitter.lua | 2 ++ lua/plugins/ui.lua | 10 --------- 9 files changed, 54 insertions(+), 50 deletions(-) delete mode 100644 lua/config/plugins/dashboard.lua create mode 100644 lua/config/plugins/lsp.lua create mode 100644 lua/config/plugins/mason.lua diff --git a/lua/config/plugins/cmp.lua b/lua/config/plugins/cmp.lua index b91167f..e63b957 100644 --- a/lua/config/plugins/cmp.lua +++ b/lua/config/plugins/cmp.lua @@ -21,9 +21,10 @@ sources = cmp.config.sources({ { name = 'nvim_lsp' }, { name = 'luasnip' }, -- For luasnip users. - }, { + { name = 'nvim_lua' }, { name = 'buffer' }, - -- { name = 'path' }, + { name = 'path' }, + { name = 'nvim_lsp_signature_help' }, -- { name = 'cmdline' }, }) }) diff --git a/lua/config/plugins/dashboard.lua b/lua/config/plugins/dashboard.lua deleted file mode 100644 index c5c1719..0000000 --- a/lua/config/plugins/dashboard.lua +++ /dev/null @@ -1,16 +0,0 @@ -config = { - center = { - { - icon = '', - icon_hl = 'group', - desc = 'description', - desc_hl = 'group', - key = 'shortcut key in dashboard buffer not keymap !!', - key_hl = 'group', - key_format = ' [%s]', -- `%s` will be substituted with value of `key` - action = '', - }, - }, - footer = {}, - vertical_center = false, -- Center the Dashboard on the vertical (from top to bottom) -} diff --git a/lua/config/plugins/lsp.lua b/lua/config/plugins/lsp.lua new file mode 100644 index 0000000..61c98ed --- /dev/null +++ b/lua/config/plugins/lsp.lua @@ -0,0 +1,6 @@ +local lspconfig = require("lspconfig") +lspconfig.lua_ls.setup({}) + +vim.keymap.set('n', 'K', vim.lsp.buf.hover, {}) +vim.keymap.set('n', 'gd', vim.lsp.buf.definition, {}) +vim.keymap.set({'n', 'v'}, 'ca', vim.lsp.buf.code_action, {}) diff --git a/lua/config/plugins/mason.lua b/lua/config/plugins/mason.lua new file mode 100644 index 0000000..3e5e15f --- /dev/null +++ b/lua/config/plugins/mason.lua @@ -0,0 +1,9 @@ +ui = { + icons = { + package_installed = "", + package_pending = "", + package_uninstalled = "" + } +} + +max_concurrent_installers = 10 diff --git a/lua/config/settings.lua b/lua/config/settings.lua index 5633d0c..e9a44d1 100644 --- a/lua/config/settings.lua +++ b/lua/config/settings.lua @@ -31,7 +31,7 @@ o.splitright = true o.splitbelow = true o.termguicolors = true --- opt.shortmess:append "sI" +opt.shortmess:append "sI" opt.whichwrap:append "<>[]hl" opt.fillchars = { eob = " " } diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 4053811..e2cfab5 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -2,9 +2,25 @@ return { { "hrsh7th/nvim-cmp", dependencies = { - "hrsh7th/cmp-cmdline", - "hrsh7th/cmp-path", - "hrsh7th/cmp-buffer" + { "hrsh7th/cmp-nvim-lua" }, + { "hrsh7th/cmp-nvim-lsp-signature-help" }, + { "hrsh7th/cmp-cmdline" }, + { "hrsh7th/cmp-path" }, + { "hrsh7th/cmp-buffer" }, + { + "windwp/nvim-autopairs", + event = "InsertEnter", + opts = { + fast_wrap = {}, + disable_filetype = { "TelescopePrompt", "vim" }, + }, + config = function(opts) + require("nvim-autopairs").setup(opts) + local cmp_autopairs = require "nvim-autopairs.completion.cmp" + local cmp = require('cmp') + require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done()) + end + } }, opts = function() require "config.plugins.cmp" @@ -13,19 +29,26 @@ return { { "hrsh7th/cmp-nvim-lsp", dependencies = {}, + -- [[ config = function () local capabilities = require('cmp_nvim_lsp').default_capabilities() - require('lspconfig').clangd.setup { capabilities = capabilities, } + require('lspconfig').pylsp.setup { + capabilities = capabilities + } + require('lspconfig').ltex.setup { + capabilities = capabilities + } end, + --]] }, { "L3MON4D3/LuaSnip", dependencies = { - "saadparwaiz1/cmp_luasnip", - "rafamadriz/friendly-snippets" + "saadparwaiz1/cmp_luasnip", + "rafamadriz/friendly-snippets" }, opts = {} } diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index 5eb54ef..2b26c4b 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -3,26 +3,15 @@ return { "neovim/nvim-lspconfig", dependencies= {}, config = function() - local lspconfig = require("lspconfig") - lspconfig.lua_ls.setup({}) - - vim.keymap.set('n', 'K', vim.lsp.buf.hover, {}) - vim.keymap.set('n', 'gd', vim.lsp.buf.definition, {}) - vim.keymap.set({'n', 'v'}, 'ca', vim.lsp.buf.code_action, {}) + require "config.plugins.lsp" end, }, { "williamboman/mason.nvim", dependencies = {}, - opts = { - ui = { - icons = { - package_installed = "✓", - package_pending = "➜", - package_uninstalled = "✗" - } - } - } + opts = function () + require "config.plugins.mason" + end }, { "williamboman/mason-lspconfig.nvim", diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 078e630..ad75972 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -1,6 +1,8 @@ return { { "nvim-treesitter/nvim-treesitter", + event = { "BufReadPost", "BufNewFile" }, + cmd = { "TSInstall", "TSBufEnable", "TSBufDisable", "TSModuleInfo" }, build = ":TSUpdate", dependencies = {}, opts = { diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index d4dbfe8..7b334f8 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -1,14 +1,4 @@ return { - { - "nvimdev/dashboard-nvim", - event = "VimEnter", - dependencies = { "nvim-tree/nvim-web-devicons"}, - config = function() - require('dashboard').setup { - require "config.plugins.dashboard" - } - end, - }, { "RedsXDD/neopywal.nvim", name = "neopywal",