vim-config/after/ftplugin/rust.vim

54 lines
1.6 KiB
VimL
Raw Permalink Normal View History

2018-05-26 17:18:09 +00:00
let g:rust_doc#define_map_K = 0
let g:rust_doc#downloaded_rust_doc_dir = '~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu'
function! s:search_under_cursor(query) range
if a:query ==# ''
echomsg "rust-doc: No identifier is found under the cursor"
return
endif
call rust_doc#open_fuzzy(a:query)
endfunction
2018-06-12 15:46:40 +00:00
" keys
2018-06-15 20:05:00 +00:00
nnoremap <buffer><silent><F7> :<C-u>call <SID>search_under_cursor(expand('<cword>'))<CR>
vnoremap <buffer><silent><F7> "gy:call <SID>search_under_cursor(getreg('g'))<CR>
2018-05-26 17:18:09 +00:00
2020-01-25 18:22:37 +00:00
" rusty-tags
autocmd BufRead *.rs :setlocal tags=./rusty-tags.vi;/
autocmd BufWritePost *.rs :silent! exec "!rusty-tags vi --quiet --start-dir=" . expand('%:p:h') . "&" | redraw!
let g:tagbar_ctags_bin = '/usr/bin/exuberant-ctags'
2020-01-08 23:37:57 +00:00
" nnoremap <F3> :call LanguageClient_contextMenu()<CR>
" nnoremap <silent> <F4> :call LanguageClient#textDocument_definition()<CR>
" nnoremap <silent> <F6> :call LanguageClient#textDocument_hover()<CR>
" nnoremap <silent> <F8> :call LanguageClient#textDocument_rename()<CR>
2018-05-26 17:18:09 +00:00
2018-06-12 15:46:40 +00:00
2020-01-08 23:37:57 +00:00
" let g:LanguageClient_autoStart = 1
2018-06-12 15:46:40 +00:00
2020-01-08 23:37:57 +00:00
" let g:LanguageClient_serverCommands = {
" \ 'rust': ['rustup', 'run', 'nightly', 'rls'] }
2018-06-12 15:46:40 +00:00
2020-01-08 23:37:57 +00:00
" let g:LanguageClient_diagnosticsEnable = 0
2018-06-15 20:05:00 +00:00
2020-01-08 23:37:57 +00:00
" let g:ale_linters = {'rust': ['rls']}
" let g:ale_fixers = { 'rust': ['rustfmt'] }
2018-06-12 15:46:40 +00:00
2020-01-08 23:37:57 +00:00
" let g:ale_fix_on_save = 0
" let g:autofmt_autosave = 0
2018-06-15 20:05:00 +00:00
" deoplete
2020-01-25 18:22:22 +00:00
call deoplete#custom#option('sources',{
\ '_': ['buffer'],
\ 'rust': ['ultisnips', 'buffer', 'file', 'LanguageClient']
\ })
inoremap <expr><tab> pumvisible() ? "\<c-n>" : "\<tab>"
call deoplete#enable()
let g:LanguageClient_serverCommands = {
\ 'rust': ['~/.cargo/bin/ra_lsp_server'],
\ }