all repos

init.lua @ 4349d1545ff45e272ad0e92e7a284cee42ff1cef

my nvim config
3 files changed, 17 insertions(+), 22 deletions(-)
update cmp config
Author: neoteny ss2316544@gmail.com
Committed at: 2022-01-20 16:42:31 +0200
Parent: 12a6184
M lua/lsp/init.lua

@@ -3,7 +3,10 @@ local M = {}

function M.setup() require("nvim-lsp-installer").on_server_ready(function(server) - local opts = { on_attach = on_attach } + local opts = { + on_attach = on_attach, + capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities()), + } require("lsp.null").setup() local ok, server_opts = pcall(require, "lsp.providers." .. server.name)
M lua/plugin.lua

@@ -24,6 +24,7 @@

use { "windwp/nvim-autopairs", event = "InsertEnter", + module = "nvim-autopairs", config = get_config "nvim-autopairs", }

@@ -61,42 +62,39 @@ }

use { "neovim/nvim-lspconfig", + config = get_config "lsp", requires = { "williamboman/nvim-lsp-installer", { "jose-elias-alvarez/null-ls.nvim", after = "nvim-lspconfig" }, }, - config = get_config "lsp", } use { "mfussenegger/nvim-dap", module = "dap", + config = get_config "plugin.dap", requires = { { "Pocco81/DAPInstall.nvim", module = "dap-install", requires = "nvim-dap" }, { "theHamsta/nvim-dap-virtual-text", after = "nvim-dap", config = [[ require"nvim-dap-virtual-text".setup() ]] }, { "nvim-telescope/telescope-dap.nvim", after = "nvim-dap", config = [[ require("telescope").load_extension "dap" ]] }, }, - config = get_config "plugin.dap", } use { "hrsh7th/nvim-cmp", + config = get_config "plugin.cmp", event = "InsertEnter", + module = "cmp", requires = { { "hrsh7th/cmp-nvim-lua", after = "nvim-cmp" }, - { "hrsh7th/cmp-nvim-lsp", after = "nvim-cmp" }, + { "hrsh7th/cmp-nvim-lsp", module = "cmp_nvim_lsp" }, { "hrsh7th/cmp-buffer", after = "nvim-cmp" }, { "hrsh7th/cmp-path", after = "nvim-cmp" }, - { - "saadparwaiz1/cmp_luasnip", - after = "nvim-cmp", - requires = { - "L3MON4D3/LuaSnip", - { "rafamadriz/friendly-snippets", after = "LuaSnip" }, - }, - }, + { "hrsh7th/cmp-cmdline", after = "nvim-cmp" }, + { "saadparwaiz1/cmp_luasnip", after = "nvim-cmp" }, + { "L3MON4D3/LuaSnip", module = "luasnip" }, + { "rafamadriz/friendly-snippets", after = "nvim-cmp" }, }, - config = get_config "plugin.cmp", } use {

@@ -110,19 +108,11 @@

use { "nvim-treesitter/nvim-treesitter", branch = "0.5-compat", + config = get_config "plugin.treesitter", requires = { { "nvim-treesitter/nvim-treesitter-refactor", after = "nvim-treesitter" }, { "nvim-treesitter/playground", after = "nvim-treesitter" }, }, - config = get_config "plugin.treesitter", - } - - use { - "Smirnov-O/ts-unit.nvim", - after = "nvim-treesitter", - config = function() - require("ts-unit").setup { keymaps = true } - end, } use {
M lua/plugin/cmp.lua

@@ -8,6 +8,8 @@ paths = { "~/.local/share/nvim/site/pack/packer/start/friendly-snippets" },

} cmp.event:on("confirm_done", require("nvim-autopairs.completion.cmp").on_confirm_done()) + cmp.setup.cmdline("/", { sources = { { name = "buffer" } } }) + cmp.setup.cmdline(":", { sources = cmp.config.sources { { name = "path" }, { name = "cmdline" } } }) cmp.setup { snippet = { expand = function(args)