setlocal foldmethod=syntax " Disable vim-lexiv on ' while rust use ' as a lifetime marker inoremap ' ' nnoremap % CocCommand rust-analyzer.matchingBrace nnoremap gK CocRustAnalyzerOpenDocs nnoremap g CocRustAnalyzerParentModule nnoremap gt CocRustAnalyzerPeekTests nnoremap gT CocRustAnalyzerTestCurrent nnoremap CocRustAnalyzerReload nnoremap rr CocRustAnalyzerRun command! CocRustAnalyzerRun CocCommand rust-analyzer.run command! CocRustAnalyzerReload CocCommand rust-analyzer.reload command! CocRustAnalyzerPeekTests CocCommand rust-analyzer.peekTests command! CocRustAnalyzerOpenDocs CocCommand rust-analyzer.openDocs command! CocRustAnalyzerTestCurrent CocCommand rust-analyzer.testCurrent command! CocRustAnalyzerParentModule CocCommand rust-analyzer.parentModule command! CocRustAnalyzerReloadWorkspace CocCommand rust-analyzer.reloadWorkspace command! CocRustAnalyzerViewCrateGraph CocCommand rust-analyzer.viewCrateGraph function! s:set_rust_target(target) abort if a:target is# v:null silent! unlet g:coc_user_config['rust-analyzer.cargo.target'] else silent! let g:coc_user_config['rust-analyzer.cargo.target'] = a:target endif CocRestart endfunction command! CocRustAnalyzerTargetPlatform call s:set_rust_target(v:null) command! CocRustAnalyzerTargetWindows call s:set_rust_target('x86_64-pc-windows-gnu') command! CocRustAnalyzerTargetMacOS call s:set_rust_target('x86_64-apple-darwin') command! CocRustAnalyzerTargetLinux call s:set_rust_target('x86_64-unknown-linux-gnu') function! s:overwrite_default_mappings() abort nmap [[ (coc-diagnostic-prev)(my-zv) nmap ]] (coc-diagnostic-next)(my-zv) endfunction silent! call s:overwrite_default_mappings()