diff --git a/init.lua b/init.lua index 34d4f69..81b347f 100644 --- a/init.lua +++ b/init.lua @@ -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 "" } + diff --git a/lua/config/coq.lua b/lua/config/coq.lua new file mode 100644 index 0000000..ba46380 --- /dev/null +++ b/lua/config/coq.lua @@ -0,0 +1,3 @@ +local lsp = require "lspconfig" +local coq = require "coq" -- add this + diff --git a/lua/config/lsp-config.lua b/lua/config/lsp-config.lua deleted file mode 100644 index a69fcfc..0000000 --- a/lua/config/lsp-config.lua +++ /dev/null @@ -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({ - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.abort(), - [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - [''] = cmp.mapping.select_next_item(), - [''] = 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 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"} - } diff --git a/lua/plugins.lua b/lua/plugins.lua index 53522e9..6adb045 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -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"] = "" } 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