JTTWOADMNTGEUL5TBJSC5PEXSW6GMBZLY6TWLN2DHV26REVMZOZAC
let g:LanguageClient_waitOutputTimeout = 60
let g:LanguageClient_serverCommands = {
\ 'c': ['clangd'],
\ 'cpp': ['clangd'],
\ 'python': ['python3', '-m', 'pyls'],
\ 'rust': ['~/.cargo/bin/rls'],
\ 'typescript': ['typescript-language-server', '--stdio'],
\ 'javascript': ['typescript-language-server', '--stdio'],
\ 'cs': [expand('~/bin/omnisharp/logged-runner.sh'), '--languageserver']
\ }
" (2020-03-05) rust_analyzer isn't quite ready for prime-time
" lua require'nvim_lsp'.rust_analyzer.setup({on_init = require'ncm2'.register_lsp_source})
lua require'nvim_lsp'.rls.setup{on_init = require'ncm2'.register_lsp_source}
lua require'nvim_lsp'.pyls.setup{on_init = require'ncm2'.register_lsp_source}
lua require'nvim_lsp'.clangd.setup{on_init = require'ncm2'.register_lsp_source}
lua require'nvim_lsp'.gopls.setup{on_init = require'ncm2'.register_lsp_source}
lua require'nvim_lsp'.tsserver.setup{on_init = require'ncm2'.register_lsp_source}
" Prefer vimtex to latex-box
let g:polyglot_disabled = ['latex']
function SetLspMappings()
nnoremap <buffer> <silent> <c-]> <cmd>lua vim.lsp.buf.declaration()<cr>
nnoremap <buffer> <silent> gd <cmd>lua vim.lsp.buf.definition()<cr>
nnoremap <buffer> <silent> K <cmd>lua vim.lsp.buf.hover()<cr>
nnoremap <buffer> <silent> gD <cmd>lua vim.lsp.buf.implementation()<cr>
nnoremap <buffer> <silent> <c-k> <cmd>lua vim.lsp.buf.signature_help()<cr>
nnoremap <buffer> <silent> 1gD <cmd>lua vim.lsp.buf.type_definition()<cr>
nnoremap <buffer> <silent> gr <cmd>lua vim.lsp.buf.references()<cr>
nnoremap <buffer> <silent> <localleader>r <cmd>lua vim.lsp.buf.rename()<cr>
endfunction
" filetype detection for arm assembly files to enable syntax highlighting
au BufNewFile,BufRead *_armv8.s,*_armv8.S set filetype=arm
" store language server logs
let g:LanguageClient_loggingFile = expand('~/.local/share/nvim/language-client.log')
augroup lsp_mappings
autocmd!
autocmd FileType rust,c,cpp,javascript,typescript,python :call SetLspMappings()
augroup END
let g:ncm2#popup_limit = 20 " display 20 items at most
" let g:ncm2#popup_limit = 20 " display 20 items at most
set pumheight=20 " display 20 items at most
" let g:LanguageClient_waitOutputTimeout = 60
" let g:LanguageClient_serverCommands = {
" \ 'c': ['clangd'],
" \ 'cpp': ['clangd'],
" \ 'python': ['python3', '-m', 'pyls'],
" \ 'rust': ['~/.cargo/bin/rls'],
" \ 'rust': ['~/.cargo/bin/rust-analyzer'],
" \ 'typescript': ['typescript-language-server', '--stdio'],
" \ 'javascript': ['typescript-language-server', '--stdio'],
" \ 'cs': [expand('~/bin/omnisharp/logged-runner.sh'), '--languageserver']
" \ }
" get rid of the gutter error indicators - I use the gutter for git,
" and I already have the virtual text
" let g:LanguageClient_diagnosticsSignsMax = 0
" store language server logs
" let g:LanguageClient_loggingFile = expand('~/.local/share/nvim/language-client.log')
nnoremap <leader>f :Files<cr>
nnoremap <leader>b :Buffers<cr>
nnoremap <leader>g :Rg<cr>
nnoremap <leader>c :Commands<cr>
nnoremap <leader>h :Helptags<cr>
nnoremap <leader>f <cmd>Files<cr>
nnoremap <leader>b <cmd>Buffers<cr>
nnoremap <leader>g <cmd>Rg<cr>
nnoremap <leader>c <cmd>Commands<cr>
nnoremap <leader>h <cmd>Helptags<cr>
" LanguageClient integration
nnoremap <silent> K :call LanguageClient_textDocument_hover()<cr>
nnoremap <silent> gd :call LanguageClient_textDocument_definition()<cr>
nnoremap <silent> <leader>r :call LanguageClient_textDocument_rename()<cr>
nnoremap <silent> <leader>u :call LanguageClient_textDocument_references()<cr>