2018-05-27 22:56:27 +01:00
|
|
|
call plug#end()
|
2016-09-10 12:38:42 +01:00
|
|
|
|
2018-05-27 23:51:05 +01:00
|
|
|
let g:deoplete#enable_at_startup = 1
|
|
|
|
|
2016-09-10 12:38:42 +01:00
|
|
|
" line ending
|
|
|
|
set fileformats=unix,dos
|
|
|
|
|
|
|
|
" colours
|
|
|
|
set t_Co=256
|
|
|
|
syntax enable
|
|
|
|
set background=dark
|
|
|
|
highlight clear SignColumn
|
2016-11-01 13:22:07 +00:00
|
|
|
try
|
|
|
|
colorscheme solarized
|
|
|
|
catch /^Vim\%((\a\+)\)\=:E185/
|
|
|
|
colorscheme desert
|
|
|
|
endtry
|
2016-09-10 12:38:42 +01:00
|
|
|
|
|
|
|
" plugins: airline
|
|
|
|
let g:bufferline_echo = 0
|
|
|
|
let g:airline_powerline_fonts = 1
|
|
|
|
let g:airline#extensions#tabline#enabled = 1
|
|
|
|
|
|
|
|
" plugins: rust
|
|
|
|
let g:rustfmt_autosave = 1
|
|
|
|
|
|
|
|
if executable('ag')
|
|
|
|
let g:ackprg = 'ag --vimgrep'
|
|
|
|
endif
|
|
|
|
|
2016-09-24 14:39:40 +01:00
|
|
|
if executable('rg')
|
|
|
|
let g:ackprg = 'rg --no-heading --vimgrep'
|
2018-05-27 23:51:05 +01:00
|
|
|
set grepprg=rg\ -i\ --vimgrep
|
|
|
|
|
|
|
|
" Ripgrep on /
|
|
|
|
command! -nargs=+ -complete=file -bar Rg silent! grep! <args>|cwindow|redraw!
|
|
|
|
nnoremap <leader>/ :Rg<SPACE>
|
2016-09-24 14:39:40 +01:00
|
|
|
endif
|
|
|
|
|
2018-05-27 23:07:20 +01:00
|
|
|
if executable('rls')
|
|
|
|
au User lsp_setup call lsp#register_server({
|
|
|
|
\ 'name': 'rls',
|
|
|
|
\ 'cmd': {server_info->['rustup', 'run', 'nightly', 'rls']},
|
|
|
|
\ 'whitelist': ['rust'],
|
|
|
|
\ })
|
2018-05-28 00:02:34 +01:00
|
|
|
let g:lsp_signs_enabled = 1 " enable signs
|
|
|
|
let g:lsp_diagnostics_echo_cursor = 1 " enable echo under cursor when in normal mode
|
|
|
|
nnoremap <leader>d :LspDefinition<cr>
|
|
|
|
nnoremap <leader>r :LspReferences<cr>
|
2018-05-27 23:07:20 +01:00
|
|
|
endif
|
|
|
|
|
2016-10-12 19:58:26 +01:00
|
|
|
" fzf
|
2018-05-27 23:51:05 +01:00
|
|
|
if executable('rg')
|
|
|
|
let $FZF_DEFAULT_COMMAND = 'rg --files --no-messages "" .'
|
|
|
|
set grepprg=rg\ --vimgrep
|
|
|
|
endif
|
|
|
|
|
|
|
|
let g:fzf_command_prefix = 'Fzf'
|
|
|
|
if executable('fzf')
|
|
|
|
nnoremap <leader>v :FzfFiles<cr>
|
|
|
|
nnoremap <leader>u :FzfTags<cr>
|
|
|
|
nnoremap <leader>j :call fzf#vim#tags("'".expand('<cword>'))<cr>
|
|
|
|
|
|
|
|
if executable('rg')
|
|
|
|
" :Find <term> runs `rg <term>` and passes it to 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(<q-args>), 1, <bang>0)
|
|
|
|
nnoremap <leader>/ :Find
|
|
|
|
nnoremap <leader>' :execute "Find " . expand("<cword>")<cr>
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
nnoremap <leader>v :CtrlP<Space><cr>
|
|
|
|
endif
|
2016-10-12 19:58:26 +01:00
|
|
|
|
2016-09-10 12:38:42 +01:00
|
|
|
" appearance
|
|
|
|
set number
|
|
|
|
set relativenumber
|
|
|
|
set laststatus=2
|
|
|
|
set noshowmode
|
|
|
|
set showtabline=1 "only show tabline when more than 1 tab
|
|
|
|
|
2018-05-27 23:51:05 +01:00
|
|
|
set statusline+=%#warningmsg#
|
|
|
|
set statusline+=%{SyntasticStatuslineFlag()}
|
|
|
|
set statusline+=%*
|
|
|
|
|
|
|
|
" syntastic
|
|
|
|
let g:syntastic_always_populate_loc_list = 1
|
|
|
|
let g:syntastic_aggregate_errors = 1
|
|
|
|
let g:syntastic_auto_loc_list = 1
|
|
|
|
let g:syntastic_check_on_open = 1
|
|
|
|
let g:syntastic_check_on_wq = 0
|
|
|
|
|
|
|
|
let g:syntastic_rust_checkers=['cargo']
|
|
|
|
|
|
|
|
" language server
|
|
|
|
let g:LanguageClient_autoStart = 1
|
|
|
|
let g:LanguageClient_serverCommands = { 'rust': ['rustup', 'run', 'nightly', 'rls'] }
|
|
|
|
|
2016-09-10 12:38:42 +01:00
|
|
|
" exclude quickfix from the buffers list
|
|
|
|
augroup qf
|
|
|
|
autocmd!
|
|
|
|
autocmd FileType qf set nobuflisted
|
|
|
|
augroup END
|
|
|
|
|
|
|
|
" vimdiff
|
|
|
|
set diffopt+=iwhite
|
|
|
|
set diffexpr=""
|