diff options
Diffstat (limited to 'nvim')
-rw-r--r-- | nvim/init.vim | 27 | ||||
-rw-r--r-- | nvim/lua/lsp.lua | 28 |
2 files changed, 6 insertions, 49 deletions
diff --git a/nvim/init.vim b/nvim/init.vim index a0d4d6f..2e42f7e 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -25,16 +25,10 @@ Plug 'google/vim-searchindex' Plug 'rktjmp/lush.nvim' Plug 'ellisonleao/gruvbox.nvim' -" LSP if has('nvim') Plug 'neovim/nvim-lspconfig' - Plug 'hrsh7th/cmp-nvim-lsp' - Plug 'hrsh7th/cmp-buffer' - Plug 'hrsh7th/nvim-cmp' - - " For vsnip users. - Plug 'hrsh7th/cmp-vsnip' - Plug 'hrsh7th/vim-vsnip' + Plug 'ms-jpq/coq_nvim', {'branch': 'coq'} + Plug 'ms-jpq/coq.artifacts', {'branch': 'artifacts'} endif @@ -127,6 +121,8 @@ let b:ale_fixers = { if has('nvim') lua require('evil_lualine') lua require('git') + + let g:coq_settings = { 'auto_start': v:true } lua require('lsp') colorscheme gruvbox @@ -184,9 +180,6 @@ nnoremap ,o :only<CR> " gs = open git status nnoremap <leader>ff :Files .<CR> nnoremap <leader>co :Commits<CR> -nnoremap :gf :GFiles<CR> -nnoremap :gs :GFiles?<CR> -nnoremap :gd :Git diff<CR> nnoremap <leader>pa :set paste<CR> nnoremap <leader>npa :set nopaste<CR> @@ -195,18 +188,6 @@ nnoremap <leader>npa :set nopaste<CR> nmap <leader>cr :!command cargo r<CR> nmap <F6> :EditorConfigReload<CR> - -" Use `[g` and `]g` to navigate diagnostics -nmap <silent> [g <Plug>(coc-diagnostic-prev) -nmap <silent> ]g <Plug>(coc-diagnostic-next) - -" GoTo code navigation. -nmap <silent> gd <Plug>(coc-definition) -nmap <silent> gy <Plug>(coc-type-definition) -nmap <silent> gi <Plug>(coc-implementation) -nmap <silent> gr <Plug>(coc-references) - - if &diff "Get from remote nnoremap dr :diffget<Space>RE<CR> diff --git a/nvim/lua/lsp.lua b/nvim/lua/lsp.lua index f881977..a63b761 100644 --- a/nvim/lua/lsp.lua +++ b/nvim/lua/lsp.lua @@ -1,29 +1,5 @@ local nvim_lsp = require('lspconfig') -local cmp = require'cmp' - -cmp.setup({ - sources = { - {name = 'buffer'}, - {name = 'nvim_lsp'}, - {name = 'vsnip'}, - }, - snippet = { - expand = function(args) - vim.fn["vsnip#anonymous"](args.body) - end, - }, - mapping = { - ['<C-Space>'] = cmp.mapping.complete(), - ['<C-e>'] = cmp.mapping.close(), - ['<CR>'] = cmp.mapping.confirm({ select = true }), - }, - documentation = { - border = 'rounded', - }, -}) - --- Use an on_attach function to only map the following keys --- after the language server attaches to the current buffer +local coq = require('coq') local on_attach = function(client, bufnr) local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end @@ -50,7 +26,7 @@ end local servers = { 'jedi_language_server', 'rust_analyzer', 'tsserver', 'clangd' } for _, lsp in ipairs(servers) do nvim_lsp[lsp].setup { - capabilities = capabilities, + capabilities = coq.lsp_ensure_capabilities(), on_attach = on_attach, flags = { debounce_text_changes = 150, |