lsp change to coq

This commit is contained in:
nova 2024-01-29 00:07:54 +01:00
parent 56e9bb7d04
commit 37e28c2b11
4 changed files with 28 additions and 140 deletions

View File

@ -1,6 +1,6 @@
require("bootstrap")
require("plugins")
require("config.lsp-config")
require("config.coq")
require("config.winsep")
require("config.bindings")
require("ui.startscreen")
@ -17,6 +17,4 @@ vim.cmd(":set relativenumber")
vim.cmd("set foldmethod=marker")
vim.opt.fillchars:append { eob = " " }
--}}}
require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_vscode").lazy_load { paths = vim.g.vscode_snippets_path or "" }

3
lua/config/coq.lua Normal file
View File

@ -0,0 +1,3 @@
local lsp = require "lspconfig"
local coq = require "coq" -- add this

View File

@ -1,98 +0,0 @@
-- Set up nvim-cmp.
local cmp = require'cmp'
cmp.setup({
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
-- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
-- require('snippy').expand_snippet(args.body) -- For `snippy` users.
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
end,
},
window = {
-- completion = cmp.config.window.bordered(),
-- documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
['<Tab>'] = cmp.mapping.select_next_item(),
['<S-Tab>'] = cmp.mapping.select_prev_item(),
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'vsnip' }, -- For vsnip users.
-- { name = 'luasnip' }, -- For luasnip users.
-- { name = 'ultisnips' }, -- For ultisnips users.
-- { name = 'snippy' }, -- For snippy users.
}, {
{ name = 'buffer' },
})
})
-- Set configuration for specific filetype.
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
{ name = 'git' }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git).
}, {
{ name = 'buffer' },
})
})
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({ '/', '?' }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
}
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
})
})
require("mason").setup()
require("mason-lspconfig").setup()
-- Set up lspconfig.
local capabilities = require('cmp_nvim_lsp').default_capabilities()
-- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled.
--
require("mason-lspconfig").setup({
ensure_installed = { "lua_ls" }
})
require('lspconfig')['clangd'].setup {
capabilities = capabilities
}
require('lspconfig')['csharp_ls'].setup {
capabilities = capabilities
}
require('lspconfig')['lua_ls'].setup {
capabilities = capabilities
}
require('lspconfig')['bashls'].setup {
capabilities = capabilities
}
require('lspconfig')['rust_analyzer'].setup {
capabilities = capabilities
}
require('lspconfig')['arduino_language_server'].setup {
cmd = {"arduino-language-server",
"-fqbn", "arduino:avr:mega",
"-cli", "arduino-cli",
"-clangd", "clangd",
"-cli-config", "$HOME/.arduino15/arduino-cli.yaml"}
}

View File

@ -3,42 +3,29 @@ local plugins = {
-- {{{ basic lsp stuff
{
"neovim/nvim-lspconfig",
event = "VeryLazy",
dependencies = {
{
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-cmdline",
},
},
event = "VeryLazy",
},
{
"williamboman/mason-lspconfig.nvim",
event = "VeryLazy",
event = "VeryLazy",
dependencies = {
"williamboman/mason.nvim"
}
},-- }}}
-- {{{ snipplets
{
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
}
},
{
"L3MON4D3/LuaSnip",
{
'ms-jpq/coq_nvim',
branch = 'coq',
event = "InsertEnter",
init = function() vim.g.coq_settings = { auto_start = true, ["keymap.jump_to_mark"] = "<C-s>" } end,
dependencies = {
"rafamadriz/friendly-snippets",
{ "ms-jpq/coq.artifacts",
branch = "artifacts",
event = "InsertEnter", },
{ "neovim/nvim-lspconfig" },
},
config = function(_, opts)
require("luasnip.loaders.from_vscode").lazy_load()
end,
}, -- }}}
},
-- }}}
-- }}}
-- {{{ editor
@ -54,19 +41,17 @@ local plugins = {
}, -- }}}
-- {{{ auto closes ()
{
"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"
require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done())
end,
}, -- }}}
-- {
-- "windwp/nvim-autopairs",
-- event = "InsertEnter",
-- opts = {
-- fast_wrap = {},
-- disable_filetype = { "TelescopePrompt", "vim" },
-- },
-- config = function(_, opts)
-- require("nvim-autopairs").setup(opts)
-- end,
-- }, -- }}}
-- }}}
-- {{{ ui