From deba5dcde9fcc5d667c60ffda5bb7f1887e74953 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Sat, 23 Feb 2019 09:15:44 +0000 Subject: [PATCH] Refresh Rust setup in vim --- .vimrc.keymap | 17 +++++++++++++++++ .vimrc.plugins | 1 + .vimrc.plugins-settings | 19 +++++++++++-------- 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/.vimrc.keymap b/.vimrc.keymap index d7b4c8e7..d970c0ef 100755 --- a/.vimrc.keymap +++ b/.vimrc.keymap @@ -32,3 +32,20 @@ nnoremap ' :execute "Find " . expand("") " tree map n :NERDTreeToggle + +" completion +inoremap pumvisible() ? "\" : "\" +inoremap pumvisible() ? "\" : "\" +inoremap pumvisible() ? "\" : "\" +imap (asyncomplete_force_refresh) + +function! s:check_back_space() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~ '\s' +endfunction + +inoremap + \ pumvisible() ? "\" : + \ check_back_space() ? "\" : + \ asyncomplete#force_refresh() +inoremap pumvisible() ? "\" : "\" diff --git a/.vimrc.plugins b/.vimrc.plugins index 8158422f..1939c417 100644 --- a/.vimrc.plugins +++ b/.vimrc.plugins @@ -8,6 +8,7 @@ endif call plug#begin('~/.vim/plugged') Plug 'airblade/vim-gitgutter' +Plug 'cespare/vim-toml' Plug 'godlygeek/tabular' Plug 'https://github.com/cyplo/vim-colors-solarized.git' Plug 'junegunn/fzf.vim' diff --git a/.vimrc.plugins-settings b/.vimrc.plugins-settings index 2b6fa273..628f392b 100644 --- a/.vimrc.plugins-settings +++ b/.vimrc.plugins-settings @@ -13,15 +13,18 @@ let g:fzf_command_prefix = 'Fzf' command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --follow --glob "!.git/*" --color "always" '.shellescape(), 1, 0) let g:ctrlp_show_hidden = 1 -" register rust rls -if executable('rls') - au User lsp_setup call lsp#register_server({ - \ 'name': 'rls', - \ 'cmd': {server_info->['rustup', 'run', 'stable', 'rls']}, - \ 'whitelist': ['rust'], - \ }) -endif +" code smarts - completion, navigation +let g:asyncomplete_remove_duplicates = 1 +let g:asyncomplete_smart_completion = 1 +let g:asyncomplete_auto_popup = 1 + +au User lsp_setup call lsp#register_server({ + \ 'name': 'rls', + \ 'cmd': {server_info->['rustup', 'run', 'stable', 'rls']}, + \ 'whitelist': ['rust'], + \ }) " nerdtree startup autocmd StdinReadPre * let s:std_in=1 autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | endif +