Add COQ for auto-completion

This commit is contained in:
Steins7 2022-10-18 13:48:33 +02:00
parent b25bd71619
commit 706b5be1fd
2 changed files with 21 additions and 8 deletions

View File

@ -27,3 +27,6 @@ vim.api.nvim_set_keymap('n', '<C-p>', ":bp<cr>", {})
-- Load plugins
require('plugins')
-- Launch COQ after nvim finished starting
vim.api.nvim_create_autocmd({'VimEnter'}, {command = 'COQnow -s'})

View File

@ -1,14 +1,25 @@
local function manage_plugins()
local plugins = {
["https://github.com/faerryn/plogins.nvim.git"] = {},
["https://github.com/tpope/vim-sensible"] = {},
["https://github.com/neovim/nvim-lspconfig"] = {},
["https://github.com/simrat39/rust-tools.nvim"] = {
packadd_after = { ["https://github.com/neovim/nvim-lspconfig"] = true },
["https://github.com/tpope/vim-sensible.git"] = {},
["https://github.com/neovim/nvim-lspconfig.git"] = {},
-- COQ
["https://github.com/ms-jpq/coq_nvim.git"] = {},
["https://github.com/ms-jpq/coq.artifacts.git"] = {
packadd_after = { ["https://github.com/ms-jpq/coq_nvim.git"] = true }
},
-- LSP servers
["https://github.com/simrat39/rust-tools.nvim.git"] = {
packadd_after = { ["https://github.com/neovim/nvim-lspconfig"] = true,
["https://github.com/ms-jpq/coq_nvim"] = true},
packadd_hook = function()
local rt = require("rust-tools")
local coq = require("coq")
rt.setup({
rt.setup(coq.lsp_ensure_capabilities({
server = {
on_attach = function(_, bufnr)
-- Hover actions
@ -19,7 +30,7 @@ local function manage_plugins()
rt.code_action_group.code_action_group, { buffer = bufnr })
end,
},
})
}))
end
},
}
@ -34,8 +45,7 @@ end
local plogins_source = "https://github.com/faerryn/plogins.nvim.git"
local plogins_name = plogins_source:gsub("/", "%%")
local plogins_dir =
("%s/site/pack/plogins/opt/%s"):format((vim.fn.stdpath("data")),
local plogins_dir = ("%s/site/pack/plogins/opt/%s"):format((vim.fn.stdpath("data")),
plogins_name)
if not vim.loop.fs_stat(plogins_dir) then