Various new plugins and related configuration

Mostly stuff I end up using all the time (YCM, vimmake) and some new
plugins meant to be used with rust (rust, vim-lsp, vim-toml)
This commit is contained in:
Emmanuel BENOîT 2018-03-12 21:52:46 +01:00
parent 806a9e52a0
commit b14dcbdb6e
8 changed files with 68 additions and 0 deletions

View file

@ -0,0 +1 @@
NeoBundle "Valloric/YouCompleteMe"

View file

@ -0,0 +1 @@
let g:autofmt_autosave = 1

View file

@ -0,0 +1 @@
NeoBundle 'rust-lang/rust.vim'

View file

@ -0,0 +1,17 @@
au User lsp_setup call lsp#register_server({
\ 'name': 'rust' ,
\ 'cmd' : {server_info->[
\ &shell,
\ &shellcmdflag,
\ 'rustup run stable rls']
\ } ,
\ 'whitelist' : [ 'rust' ] ,
\ })
noremap <Leader>df :LspDocumentFormat<cr>
vnoremap <Leader>df :LspDocumentRangeFormat<cr>
noremap <Leader>dr :LspReferences<cr>
noremap <F3> :LspDefinition<cr>
noremap <Leader>dR :LspRename<cr>
noremap <Leader>dh :LspHover<cr>
noremap <Leader>ds :LspWorkspaceSymbol<cr>

View file

@ -0,0 +1,2 @@
NeoBundle 'prabirshrestha/async.vim'
NeoBundle 'prabirshrestha/vim-lsp'

View file

@ -0,0 +1 @@
NeoBundle 'cespare/vim-toml'

View file

@ -0,0 +1,44 @@
if exists( 'g:vim_local_path' )
let g:vimmake_path = g:vim_local_path . 'scripts'
let g:vimmake_mode = {}
let g:vimmake_mode['clean'] = 'async'
let g:vimmake_mode['build'] = 'async'
let g:vimmake_mode['rebuild'] = 'async'
let g:vimmake_mode['test'] = 'async'
function! DoBuild(full)
silent call vimmake#toggle_quickfix(12,1)
if a:full == 0
VimTool build
else
VimTool rebuild
endif
endfunc
function! KillBuild()
silent call vimmake#toggle_quickfix(0)
VimStop
endfunc
function! RunTest()
silent call vimmake#toggle_quickfix(12,1)
VimTool test
endfunc
augroup QuickfixStatus
au! BufWinEnter quickfix setlocal
\ statusline=%t\ [%{g:vimmake_build_status}]\ %{exists('w:quickfix_title')?\ '\ '.w:quickfix_title\ :\ ''}\ %=%-15(%l,%c%V%)\ %P
augroup END
noremap <F12> :silent call vimmake#toggle_quickfix(12)<cr>
inoremap <F12> <esc>:silent call vimmake#toggle_quickfix(12)<cr>li
noremap <F10> :silent call DoBuild(0)<cr>
inoremap <F10> <esc>:silent call DoBuild(0)<cr>li
noremap <S-F10> :silent call DoBuild(1)<cr>
inoremap <S-F10> <esc>:silent call DoBuild(1)<cr>li
noremap <C-F10> :silent call KillBuild()<cr>
inoremap <C-F10> <esc>:silent call KillBuild()<cr>li
noremap <F11> :silent call RunTest()<cr>
inoremap <F11> <esc>:silent call RunTest()<cr>li
endif

View file

@ -0,0 +1 @@
NeoBundle 'skywind3000/vimmake'