summaryrefslogtreecommitdiffstats
path: root/dotvimrc
diff options
context:
space:
mode:
Diffstat (limited to 'dotvimrc')
-rw-r--r--dotvimrc93
1 files changed, 73 insertions, 20 deletions
diff --git a/dotvimrc b/dotvimrc
index 389f41b..1c32a3a 100644
--- a/dotvimrc
+++ b/dotvimrc
@@ -1,6 +1,9 @@
set nocompatible
syn on
+set maxmempattern=32000
+" because https://github.com/vim/vim/issues/6777#issuecomment-684776825
+
" Because Konsole font size
" https://github.com/neovim/neovim/issues/6798
set guicursor=
@@ -17,6 +20,7 @@ set pastetoggle=<F10>
set textwidth=120
set backspace=eol,indent,start
set number
+set signcolumn=yes
"set mouse=a "Disabled
"set grepprg=grep\ -nH\ $*
set grepprg=rg\ --vimgrep\ $*
@@ -40,6 +44,7 @@ set guioptions-=T
" remove menu
set guioptions-=m
+
set formatoptions+=j " Delete comment character when joining commented lines
set history=1000
@@ -60,29 +65,78 @@ Plug 'scrooloose/nerdtree'
Plug 'majutsushi/tagbar'
Plug 'vim-scripts/taglist.vim'
Plug 'tpope/vim-fugitive'
-call plug#end()
+Plug 'https://gitlab.com/Nate_B/vim-adif'
-"Plug 'CoatiSoftware/vim-sourcetrail'
-"nnoremap <leader>sr :SourcetrailRefresh<CR>
-"nnoremap <leader>sa :SourcetrailActivateToken<CR>
-
-set runtimepath+=~/.vim/LanguageClient-neovim
-" Required for operations modifying multiple buffers like rename.
+if has("nvim")
+ Plug 'neovim/nvim-lspconfig'
+endif
-let g:LanguageClient_serverCommands = {
- \ 'rust': ['rust-analyzer'],
- \ 'python': ['pyls'],
- \ 'cpp': ['clangd'],
- \ 'c': ['clangd'] }
+"Plug 'neoclide/coc.nvim', {'branch': 'release'}
+call plug#end()
-let g:LanguageClient_useVirtualText = "No"
-let g:LanguageClient_autoStart = 0
+" dotnet tool install -g csharp-ls
-nnoremap <F8> :call LanguageClient_contextMenu()<CR>
-nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
-nnoremap <silent> <F2> :call LanguageClient#textDocument_rename()<CR>
+if has("nvim")
+ lua << EOF
+ local nvim_lsp = require('lspconfig')
+
+ -- For debugging, use :LspInfo
+ --vim.lsp.set_log_level("debug")
+ -- Retrieve logs using :lua vim.cmd('e'..vim.lsp.get_log_path())
+
+ vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
+ vim.lsp.diagnostic.on_publish_diagnostics, {
+ signs = false,
+ }
+ )
+
+ -- Use an on_attach function to only map the following keys
+ -- after the language server attaches to the current buffer
+ local on_attach = function(client, bufnr)
+ local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
+ local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
+
+ -- Enable completion triggered by <c-x><c-o>
+ buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
+
+ -- Mappings.
+ local opts = { noremap=true, silent=true }
+
+ -- See `:help vim.lsp.*` for documentation on any of the below functions
+ buf_set_keymap('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
+ buf_set_keymap('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
+ --buf_set_keymap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
+ buf_set_keymap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
+ --buf_set_keymap('n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
+ --buf_set_keymap('n', '<space>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
+ --buf_set_keymap('n', '<space>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
+ --buf_set_keymap('n', '<space>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
+ --buf_set_keymap('n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
+ buf_set_keymap('n', '<space>r', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
+ buf_set_keymap('n', '<space>c', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
+ buf_set_keymap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
+ buf_set_keymap('n', '<space>e', '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts)
+ buf_set_keymap('n', '[d', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
+ buf_set_keymap('n', ']d', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
+ buf_set_keymap('n', '<space>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
+ buf_set_keymap('n', '<space>F', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
+
+ end
+
+ -- Use a loop to conveniently call 'setup' on multiple servers and
+ -- map buffer local keybindings when the language server attaches
+ local servers = { 'clangd', 'rust_analyzer', 'pylsp', 'csharp_ls', 'tsserver' }
+ for _, lsp in ipairs(servers) do
+ nvim_lsp[lsp].setup {
+ on_attach = on_attach,
+ flags = {
+ debounce_text_changes = 150,
+ }
+ }
+ end
+EOF
+endif
-set completefunc=LanguageClient#complete
if executable('rg')
let g:ackprg = "rg -ui --vimgrep"
@@ -240,7 +294,6 @@ endpython
endfun
noremap <F4> :call MPB_Flip_Ext()<CR>
-noremap <Leader>f :call MPB_Flip_Ext()<CR>
" Added for QSO logging
function! MPB_Prepend_Time()
@@ -312,7 +365,7 @@ noremap ]h :GitGutterNextHunk<CR>
"GIT stuff
noremap <Leader>gt :call TimeLapse()<cr>
-noremap <Leader>gb :Gblame<cr>
+noremap <Leader>gb :Git blame<cr>
noremap <Leader>e :NERDTreeToggle<CR>