From defa706a8c7a57388f41424cc56d0b04dcafc649 Mon Sep 17 00:00:00 2001 From: Norm Rasmussen Date: Wed, 15 Feb 2023 19:58:23 -0500 Subject: [PATCH] Fixed autocompletion & snippets --- nvim/.config/nvim/lazy-lock.json | 3 +++ nvim/.config/nvim/lua/plugins/init.lua | 29 +++++++++++++++++++--- nvim/.config/nvim/lua/plugins/mason.lua | 22 ---------------- nvim/.config/nvim/lua/plugins/nvim-cmp.lua | 18 ++++++++++---- 4 files changed, 42 insertions(+), 30 deletions(-) delete mode 100644 nvim/.config/nvim/lua/plugins/mason.lua diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 82cc45d..09009a4 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -19,7 +19,10 @@ "lazy.nvim": { "branch": "main", "commit": "e916f41df26e33b01f1b3ebe28881090da3a7281" }, "lazygit.nvim": { "branch": "main", "commit": "32bffdebe273e571588f25c8a708ca7297928617" }, "lsp-colors.nvim": { "branch": "main", "commit": "d0b245232aeb197bbd097111d8b69621b0671edb" }, + "lualine.nvim": { "branch": "master", "commit": "e99d733e0213ceb8f548ae6551b04ae32e590c80" }, "markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "93e58e100f37ef4fb0f897deeed20599dae9d128" }, + "mason.nvim": { "branch": "main", "commit": "fecabaff94c34bf8ed9c3b2a45d42a5906ea251c" }, "mini.fuzzy": { "branch": "stable", "commit": "e8faf897330eadb1b1b76da67eeff04be85cbd8b" }, "mini.move": { "branch": "main", "commit": "a0c5930e33e55467b0a9f3bca93d8f6fdbfac2e4" }, "mini.pairs": { "branch": "stable", "commit": "4ebc1ff8d77fe75e8f219432302800ca29e17614" }, diff --git a/nvim/.config/nvim/lua/plugins/init.lua b/nvim/.config/nvim/lua/plugins/init.lua index 5c9cee9..48f3d4b 100755 --- a/nvim/.config/nvim/lua/plugins/init.lua +++ b/nvim/.config/nvim/lua/plugins/init.lua @@ -1,9 +1,24 @@ return { - ---------------------------------------------------------------- -- LSP and Autocomplete Plugins -- They should be pulled first! ----------------------------------------------------------------- +{'williamboman/mason.nvim', + config = function() require("mason").setup({ + ui = { + icons = { + package_installed = "✓", + package_pending = "➜", + package_uninstalled = "✗" + } + } +}) + end, +}, + { 'williamboman/mason-lspconfig.nvim', + config = function() require("mason-lspconfig").setup{} end, + }, + { 'neovim/nvim-lspconfig' }, -- Manage all your Keymaps! { @@ -12,16 +27,24 @@ return { before = "telescope.nvim" }, - -- Neovim Autocomplete with LSP { 'L3MON4D3/LuaSnip', version = "1.2.1", - wants = { "friendly-snippets", "vim-snippets" }, + dependencies = { "friendly-snippets" }, }, + 'saadparwaiz1/cmp_luasnip', + 'hrsh7th/cmp-nvim-lsp-signature-help', ------------------------------------------------------------ -- General Functionality ------------------------------------------------------------ 'kdheepak/lazygit.nvim', + { + 'nvim-lualine/lualine.nvim', + dependencies = { 'kyazdani42/nvim-web-devicons' }, + config = function() require('lualine').setup{ + options = { theme = 'codedark' } + } end, +}, -- Tmux Navigation { "aserowy/tmux.nvim", diff --git a/nvim/.config/nvim/lua/plugins/mason.lua b/nvim/.config/nvim/lua/plugins/mason.lua deleted file mode 100644 index 870f321..0000000 --- a/nvim/.config/nvim/lua/plugins/mason.lua +++ /dev/null @@ -1,22 +0,0 @@ -return { - -- Easy Way to install Language Servers - { 'williamboman/mason.nvim', - 'williamboman/mason-lspconfig.nvim', - 'neovim/nvim-lspconfig', - }, - - config = function() - require("mason").setup() - local lsp_installer = require("mason-lspconfig").setup({ - automatic_instalsation = true, - ui = { - icons = { - server_installed = "✓", - server_pending = "➜", - server_uninstalled = "✗" - } - } - }) - end - -} diff --git a/nvim/.config/nvim/lua/plugins/nvim-cmp.lua b/nvim/.config/nvim/lua/plugins/nvim-cmp.lua index 867836d..a67b2bd 100644 --- a/nvim/.config/nvim/lua/plugins/nvim-cmp.lua +++ b/nvim/.config/nvim/lua/plugins/nvim-cmp.lua @@ -22,7 +22,10 @@ return { if not luasnip_status_ok then return end - --cmp.setup { + + require("luasnip.loaders.from_vscode").lazy_load() + + cmp.setup { -- Load snippet support --snippet = { -- expand = function(args) @@ -33,7 +36,7 @@ return { completion = { --completeopt = 'menu,menuone,noselect' keyword_length = 2 - } + }, -- Key mapping mapping = { @@ -68,9 +71,13 @@ return { else fallback() end - end - } - + end, + }, + snippet = { + expand = function(args) + require('luasnip').lsp_expand(args.body) + end, + }, -- Load sources, see: https://github.com/topics/nvim-cmp sources = { { name = 'nvim-lsp' }, @@ -79,5 +86,6 @@ return { { name = 'buffer' }, { name = 'zsh' }, } + } end }