nix/prog/nvim: fix coc-nvim config
This commit is contained in:
parent
0fc652d311
commit
4a965d655d
3 changed files with 18 additions and 4 deletions
|
@ -1,4 +1,13 @@
|
|||
{
|
||||
# General
|
||||
coc.source = {
|
||||
around.enable = true;
|
||||
buffer.enable = true;
|
||||
file.enable = false;
|
||||
};
|
||||
|
||||
|
||||
# LSP
|
||||
languageserver = {
|
||||
nix = {
|
||||
command = "rnix-lsp";
|
||||
|
|
|
@ -72,8 +72,6 @@ vim.opt.formatoptions = 'jtcrq'
|
|||
vim.opt.clipboard = 'unnamedplus'
|
||||
-- Highlight line cursor is currently on.
|
||||
vim.opt.cursorline = true
|
||||
-- Select the first item of popup menu automatically without inserting it.
|
||||
vim.opt.completeopt:append('noinsert')
|
||||
-- Invisible characters representation when :set list
|
||||
vim.opt.listchars = {
|
||||
tab = '→ ',
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
-- Smaller updatetime for CursorHold & CursorHoldI
|
||||
vim.opt.updatetime = 300
|
||||
|
||||
-- Coc don't use completeopt
|
||||
vim.opt.completeopt = {}
|
||||
-- don't give |ins-completion-menu| messages.
|
||||
vim.opt.shortmess:append('c')
|
||||
|
||||
|
@ -23,9 +25,14 @@ vim.keymap.set('i', '<C-space>', vim.fn['coc#refresh'], {
|
|||
-- Use <cr> for confirm completion, `<C-g>u` means break undo chain at current
|
||||
-- position. Coc only does snippet and additional edit on confirm.
|
||||
local function confirm_coc_completion()
|
||||
return vim.fn.pumvisible() == 1 and "<C-y>" or "<C-g>u<CR>"
|
||||
if vim.call'coc#pum#visible' == 1 then
|
||||
vim.call'coc#pum#confirm'
|
||||
return ""
|
||||
else
|
||||
return "<CR>"
|
||||
end
|
||||
vim.keymap.set('i', '<CR>', confirm_coc_completion, { expr = true })
|
||||
end
|
||||
vim.keymap.set('i', '<CR>', confirm_coc_completion, { expr = true, silent = true })
|
||||
|
||||
local sr_opts = { silent = true, remap = true }
|
||||
-- Use `[c` and `]c` for navigate diagnostics
|
||||
|
|
Loading…
Reference in a new issue