diff options
Diffstat (limited to '.vimrc')
-rw-r--r-- | .vimrc | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -234,7 +234,7 @@ cmap w!! %!sudo tee > /dev/null % " This replicates the idea of closing a tab nmap <leader>bq :bp <BAR> bd #<CR> -colorscheme base16-tomorrow-night +colorscheme base16-default-dark " Load all plugins now. " Plugins need to be added to runtimepath before helptags can be generated. @@ -258,7 +258,7 @@ function! s:on_lsp_buffer_enabled() abort nmap <buffer> ]g <plug>(lsp-next-diagnostic) nmap <buffer> K <plug>(lsp-hover) nnoremap <buffer> <expr><c-f> lsp#scroll(+4) - nnoremap <buffer> <expr><c-d> lsp#scroll(-4) + nnoremap <buffer> <expr><c-s> lsp#scroll(-4) let g:lsp_format_sync_timeout = 1000 autocmd! BufWritePre *.rs,*.go call execute('LspDocumentFormatSync') @@ -271,3 +271,17 @@ augroup lsp_install " call s:on_lsp_buffer_enabled only for languages that has the server registered. autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled() augroup END + +if executable('solargraph') + " gem install solargraph + au User lsp_setup call lsp#register_server({ + \ 'name': 'solargraph', + \ 'cmd': {server_info->[&shell, &shellcmdflag, 'solargraph stdio']}, + \ 'initialization_options': {"diagnostics": "true"}, + \ 'whitelist': ['ruby'], + \ }) +endif + +inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>" +inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>" +inoremap <expr> <cr> pumvisible() ? asyncomplete#close_popup() : "\<cr>" |