Browse Source

* Add coc extension list to plugin config to ease first-time setup

* Add coc lua extension to allow us to install plugins during NukeVim
 install
* Update docs to reflect that coc extension installation makes the
 install process look broken.
* Migrate one of the holdover autocmds from vimscript to lua extension
 so it doesn't cause errors when coc is disabled
master
Adam Pippin 2 years ago
parent
commit
1994d4894b
  1. 4
      coc-settings.json
  2. 4
      doc/nukevim.txt
  3. 12
      lua/config/plugins/development.lua
  4. 18
      lua/plugin/neoclide/coc-nvim.lua
  5. 3
      startup.vim

4
coc-settings.json

@ -0,0 +1,4 @@
{
"html.autoClosingTags": false,
"html.autoCreateQuotes": false
}

4
doc/nukevim.txt

@ -142,7 +142,9 @@ Check out, unzip, copy or otherwise place the repo contents in your
Run `nvim +NukeVimInstall +qall` to install all the relevant plugins, perform
any initial NukeVim or other plugin setup tasks, and exit.
This may take a few minutes.
This may take a few minutes and may appear to be frozen. I hope to fix this
eventually, but the coc extension is a little finnicky about how you can
install things and this is the best I could get for the time being.
--------------------------------------------------------------------------------

12
lua/config/plugins/development.lua

@ -60,6 +60,18 @@ return {
requires = { binary = { 'npm' } },
branch = 'release'
},
config = {
extensions = {
'coc-css',
'coc-html',
'coc-json',
'coc-markdownlint',
'coc-marketplace',
'coc-phpls',
'coc-sql',
'coc-yaml'
}
},
keys = {
{ mode = 'n', key = { '<leader>', 'c', 'r' }, map = ":call CocAction('jumpReferences')<CR>", label = "references" },
}

18
lua/plugin/neoclide/coc-nvim.lua

@ -0,0 +1,18 @@
local M = require('module'):new()
function M:boot()
-- if you leave the cursor on a variable/etc for a moment, this will cause
-- all other occurrences to be subtly highlighted.
vim.api.nvim_create_autocmd('CursorHold', {
pattern = { '*' },
command = "silent call CocActionAsync('highlight')"
})
end
function M:install()
if (self.config.extensions == nil) then return end
exts = table.concat(self.config.extensions, ' ')
vim.cmd(':CocInstall -sync '..exts)
end
return M

3
startup.vim

@ -99,9 +99,6 @@ function! s:show_documentation()
endfunction
nnoremap <silent> K :call <SID>show_documentation()<CR>
" Highlight the symbol and its references when holding the cursor.
autocmd CursorHold * silent call CocActionAsync('highlight')
" Merge the signal column (your shit broke, yo') into the number column,
" or if not supported at least show it all the time so the whole text
" isn't constantly shifting as errors appear/disappear.

Loading…
Cancel
Save