From f506b8ee511b1a4a80595660e9b6fbe09c7af400 Mon Sep 17 00:00:00 2001 From: Gabriel Ebner Date: Mon, 24 May 2021 11:50:36 +0200 Subject: [PATCH] vim: add more lsp config --- vimrc | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/vimrc b/vimrc index 1568490..6518630 100644 --- a/vimrc +++ b/vimrc @@ -150,6 +150,8 @@ se inccommand=nosplit set mouse= set title +let mapleader=" " + let g:jellybeans_overrides = { \ 'background': { 'guibg': '000000' }, \ 'Normal': { 'guifg': 'ffffff' }, @@ -214,9 +216,6 @@ lua <lua vim.lsp.buf.definition()', {noremap = true}) - buf_set_keymap('n', 'K', 'lua vim.lsp.buf.hover()', {noremap = true}) - buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') vim.api.nvim_exec([[ augroup lsp_document_highlight autocmd! @@ -260,6 +259,29 @@ lua < compe#complete() +inoremap compe#confirm('') +inoremap compe#close('') +inoremap compe#scroll({ 'delta': +4 }) +inoremap compe#scroll({ 'delta': -4 }) + +nnoremap gD lua vim.lsp.buf.declaration() +nnoremap gd lua vim.lsp.buf.definition() +nnoremap K lua vim.lsp.buf.hover() +nnoremap K lua vim.lsp.diagnostic.show_line_diagnostics{show_header = false} +nnoremap gi lua vim.lsp.buf.implementation() +nnoremap lua vim.lsp.buf.signature_help() +nnoremap wa lua vim.lsp.buf.add_workspace_folder() +nnoremap wr lua vim.lsp.buf.remove_workspace_folder() +nnoremap wl lua print(vim.inspect(vim.lsp.buf.list_workspace_folders())) +nnoremap D lua vim.lsp.buf.type_definition() +nnoremap rn lua vim.lsp.buf.rename() +nnoremap ca lua vim.lsp.buf.code_action() +nnoremap gr lua vim.lsp.buf.references() +nnoremap e lua vim.lsp.diagnostic.show_line_diagnostics() +nnoremap [d lua vim.lsp.diagnostic.goto_prev() +nnoremap ]d lua vim.lsp.diagnostic.goto_next() +nnoremap q lua vim.lsp.diagnostic.set_loclist() +nnoremap f lua vim.lsp.buf.formatting() + endif let g:gutentags_cache_dir="~/.config/nvim/gutentags"