diff --git a/neovim/.config/nvim/lua/plugins/coc/autocmds.lua b/neovim/.config/nvim/lua/plugins/coc/autocmds.lua deleted file mode 100644 index 2148e4d..0000000 --- a/neovim/.config/nvim/lua/plugins/coc/autocmds.lua +++ /dev/null @@ -1,11 +0,0 @@ -local augroup = vim.api.nvim_create_augroup -local autocmd = vim.api.nvim_create_autocmd -local map = vim.keymap.set - -augroup("cocGolang", {clear = true}) -autocmd("BufWritePre", { - group = "cocGolang", - pattern = "go", - command = [[silent! call CocAction("runCommand", "editor.action.organizeImport")]], - desc = "Organise imported Go modules" -}) diff --git a/neovim/.config/nvim/lua/plugins/coc/init.lua b/neovim/.config/nvim/lua/plugins/coc/init.lua deleted file mode 100644 index d01b577..0000000 --- a/neovim/.config/nvim/lua/plugins/coc/init.lua +++ /dev/null @@ -1,8 +0,0 @@ --- Extension and language-server host for Neovim. -require("plugins.coc.mappings") -require("plugins.coc.autocmds") - -return { - "neoclide/coc.nvim", - branch = "release" -} diff --git a/neovim/.config/nvim/lua/plugins/coc/mappings.lua b/neovim/.config/nvim/lua/plugins/coc/mappings.lua deleted file mode 100644 index bcbbaac..0000000 --- a/neovim/.config/nvim/lua/plugins/coc/mappings.lua +++ /dev/null @@ -1,47 +0,0 @@ -local map = vim.keymap.set - -local cocMapOpts = { - silent = true, - noremap = true, - expr = true, - replace_keycodes = false -} - --- Use to cycle completions. -function _G.check_back_space() - local col = vim.fn.col(".") - 1 - return col == 0 or vim.fn.getline("."):sub(col, col):match("%s") ~= nil -end -map("i", "", [[coc#pum#visible() ? coc#pum#next(1) : v:lua.check_back_space() ? "" : coc#refresh()]], cocMapOpts) -map("i", "", [[coc#pum#visible() ? coc#pum#prev(1) : "\"]], cocMapOpts) --- Use to confirm completion. -map("i", "", [[coc#pum#visible() ? coc#pum#confirm() : "\u\\=coc#on_enter()\"]], cocMapOpts) - --- Use `[g` and `]g` to navigate diagnostics -map("n", "[g", "(coc-diagnostic-prev)", mapOpts) -map("n", "]g", "(coc-diagnostic-next)", mapOpts) - --- Go-to code navigation. Use to go back through the stack. -map("n", "gd", "(coc-definition)", mapOpts) -map("n", "gy", "(coc-type-definition)", mapOpts) -map("n", "gi", "(coc-implementation)", mapOpts) -map("n", "gr", "(coc-references)", mapOpts) - --- Rename a symbol. -map("n", "rn", "(coc-rename)", mapOpts) - --- Apply AutoFix to problem on the current line. -map("n", "qf", "(coc-fix-current)", {silent = true, nowait = true}) - --- Use KK to show documentation in preview window. -function _G.show_docs() - local cw = vim.fn.expand("") - if vim.fn.index({"vim", "help"}, vim.bo.filetype) >= 0 then - vim.api.nvim_command("h " .. cw) - elseif vim.api.nvim_eval("coc#rpc#ready()") then - vim.fn.CocActionAsync("doHover") - else - vim.api.nvim_command("!" .. vim.o.keywordprg .. " " .. cw) - end -end -map("n", "KK", ":lua _G.show_docs()", mapOpts)