merge: develop <--- fix/coc-config

* HEAD
| \
| * 03f670a <github@luxolus.com> nvim/plug/coc: disable loading when NodeJS is missing
| * 24aa253 <github@luxolus.com> nvim/plug/coc: fix K, <CR> keymaps
| /
| develop

Signed-off-by: Bazaah <github@luxolus.com>
This commit is contained in:
Paul Stemmet 2022-08-26 20:31:03 +00:00
commit 632e40a40d
Signed by: Paul Stemmet
GPG Key ID: EDEA539F594E7E75
2 changed files with 5 additions and 4 deletions

View File

@ -2,8 +2,6 @@ return function()
local fn, o, g = vim.fn, vim.opt, vim.g
local vimp, au = require 'vimp', require 'psoxizsh.autocmd'
if fn.executable('node') == 0 then return end
local t = function(s)
return vim.api.nvim_replace_termcodes(s, true, true, true)
end
@ -46,7 +44,7 @@ return function()
-- Make <CR> to accept selected completion item or notify coc.nvim to format
-- <C-g>u breaks current undo, please make your own choice.
vimp.inoremap({'silent', 'expr'}, '<CR>', [[coc#pum#visible() ? coc#pum#confirm() : "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"]])
vimp.inoremap({'silent', 'expr'}, '<CR>', [[coc#pum#visible() ? coc#pum#confirm() : "\<C-g>u\<CR>\<C-r>=coc#on_enter()\<CR>"]])
-- Use <c-space> to confirm completion
-- <c-space> could be remapped by other vim plugin, try `:verbose imap <CR>`.
@ -64,7 +62,9 @@ return function()
-- Use K to show documentation in preview window.
local show_documentation = function()
return coc.action('hasProvider', 'hover') and coc.action('doHover') or fn.feedkeys('K', 'in')
return fn.CocAction('hasProvider', 'hover')
and fn.CocActionAsync('doHover')
or fn.feedkeys('K', 'in')
end
vimp.nnoremap({'silent'}, 'K', show_documentation)

View File

@ -79,6 +79,7 @@ local plugins = {
-- IDE stuff + language highlighting
{ 'neoclide/coc.nvim',
disable = vim.fn.executable('node') ~= 1,
branch = 'release',
after = 'vimp',
config = require 'psoxizsh.plugins.config.coc'