From 4cfad810fa085e08c13510e0d612e2a0a02318ad Mon Sep 17 00:00:00 2001 From: afonsofrancof Date: Tue, 6 Dec 2022 17:17:39 +0000 Subject: [PATCH] added cmp source plugins --- .config/nvim/lua/mappings.lua | 1 - .config/nvim/lua/plugins/lspconfig.lua | 91 ++++++++++++-------------- .config/nvim/lua/plugins/packer.lua | 7 ++ 3 files changed, 50 insertions(+), 49 deletions(-) diff --git a/.config/nvim/lua/mappings.lua b/.config/nvim/lua/mappings.lua index b42c2db..b8a4d8e 100644 --- a/.config/nvim/lua/mappings.lua +++ b/.config/nvim/lua/mappings.lua @@ -2,7 +2,6 @@ vim.wo.number=true vim.wo.relativenumber= true vim.g.instant_username = "Afonso" -vim.opt.clipboard= 'unnamedplus' vim.opt.hlsearch = false vim.opt.smartindent = true vim.opt.wrap = false diff --git a/.config/nvim/lua/plugins/lspconfig.lua b/.config/nvim/lua/plugins/lspconfig.lua index 3e067dd..50d2cea 100644 --- a/.config/nvim/lua/plugins/lspconfig.lua +++ b/.config/nvim/lua/plugins/lspconfig.lua @@ -37,51 +37,46 @@ local on_attach = function(client, bufnr) }) end ---local lsp = require "lspconfig" ---local coq = require "coq" --- ---lsp['hls'].setup{ --- on_attach = on_attach, --- flags = lsp_flags, ---} --- ---lsp['rust_analyzer'].setup{} --- ---lsp.rust_analyzer.setup( --- coq.lsp_ensure_capabilities{ --- on_attach = on_attach, --- flags = lsp_flags, --- -- Server-specific settings... --- settings = { --- ["rust-analyzer"] = {} --- } --- } ---) --- ---lsp['texlab'].setup{ --- on_attach = on_attach, --- flags = lsp_flags, ---} ---lsp['sumneko_lua'].setup{ --- --- settings = { --- Lua = { --- runtime = { --- -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) --- version = 'LuaJIT', --- }, --- diagnostics = { --- -- Get the language server to recognize the `vim` global --- globals = {'vim'}, --- }, --- workspace = { --- -- Make the server aware of Neovim runtime files --- library = vim.api.nvim_get_runtime_file("", true), --- }, --- -- Do not send telemetry data containing a randomized but unique identifier --- telemetry = { --- enable = false, --- }, --- }, --- }, ---} +local lsp = require "lspconfig" + +lsp['hls'].setup{ + on_attach = on_attach, + flags = lsp_flags, +} + +lsp['rust_analyzer'].setup{ + + on_attach = on_attach, + flags = lsp_flags, + -- Server-specific settings... + settings = { + ["rust-analyzer"] = {} + } +} +lsp['texlab'].setup{ + on_attach = on_attach, + flags = lsp_flags, +} +lsp['sumneko_lua'].setup{ + + settings = { + Lua = { + runtime = { + -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) + version = 'LuaJIT', + }, + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = {'vim'}, + }, + workspace = { + -- Make the server aware of Neovim runtime files + library = vim.api.nvim_get_runtime_file("", true), + }, + -- Do not send telemetry data containing a randomized but unique identifier + telemetry = { + enable = false, + }, + }, + }, +} diff --git a/.config/nvim/lua/plugins/packer.lua b/.config/nvim/lua/plugins/packer.lua index b110f33..d237ba3 100644 --- a/.config/nvim/lua/plugins/packer.lua +++ b/.config/nvim/lua/plugins/packer.lua @@ -59,10 +59,17 @@ local plugins = packer.startup({function(use) } --------------------------------------------------SUGGESTION BOX----------------------------------------- use { "hrsh7th/nvim-cmp", + requires = { + 'hrsh7th/cmp-nvim-lsp', -- lsp + 'hrsh7th/cmp-buffer', --buffer completions + 'hrsh7th/cmp-path', --path completions + 'hrsh7th/cmp-cmdline' --cmdline completions + }, config = function() require "plugins.cmp" end } + --- use {"ms-jpq/coq_nvim", --- branch = 'coq', --- config = function ()