From b3584b94755d76e4de24dc98bac317416695120c Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Sun, 30 May 2021 22:40:26 +0200 Subject: [PATCH] vim: add some more plugins --- .vimrc | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 64 insertions(+), 5 deletions(-) diff --git a/.vimrc b/.vimrc index 6d78368..7be3a37 100644 --- a/.vimrc +++ b/.vimrc @@ -28,6 +28,9 @@ " gc comment/uncomment " C-K indent selection " \-a Set Kernel Coding style +" from a.vim +" :A[SVTN] Switch between header/file , split, vertical, tab, next match +" :IH[SVTN] Switch to file under cursor " Use snippets with tab e.g : for (see .vim/bundle/vim-snippets/snippets for available " snippets) " look at :help index @@ -229,8 +232,8 @@ endfu " detect indentation see http://www.freehackers.org/Indent_Finder autocmd BufReadPost /* call DetectIndent() -map :py3f ~/.vim/syntax/clang-format.py -imap :py3f ~/.vim/syntax/clang-format.pyi +noremap :py3f ~/.vim/syntax/clang-format.py +inoremap :py3f ~/.vim/syntax/clang-format.pyi set wildignore+=*.o,*.d,*.dex,*.class,*.png,*.jpeg,*.jpg,*.pdf @@ -275,6 +278,8 @@ let Tlist_Use_Right_Window = 1 " open/close tag list window with F8 "map :TlistToggle nmap :TagbarToggle +"map :Vista!! + " close preview window after a completion if has("autocmd") @@ -354,10 +359,23 @@ runtime! ftplugin/man.vim nmap :tabe ~/.vimrcgg imap " show contextual help with F1 + +" get doc of std::string instead of string +" Need installation of cppMan +function! s:JbzCppMan() + let old_isk = &iskeyword + setl iskeyword+=: + let str = expand("") + let &l:iskeyword = old_isk + execute 'Man ' . str +endfunction + function Help() try if exists('b:current_syntax') && b:current_syntax == "python" :call ShowPyDoc(expand(""), 1) + elseif exists('b:current_syntax') && b:current_syntax == "cpp" + :call s:JbzCppMan() elseif has_key(g:LanguageClient_serverCommands, &filetype) :call LanguageClient#textDocument_hover() else @@ -536,6 +554,9 @@ call vundle#begin() " let Vundle manage Vundle, required Plugin 'gmarik/Vundle.vim' +"Rust +Plugin 'rust-lang/rust.vim' + " Show current modified line Plugin 'airblade/vim-gitgutter' " Communication with git @@ -567,6 +588,7 @@ Plugin 'tomtom/tlib_vim' Plugin 'MarcWeber/vim-addon-mw-utils' Plugin 'honza/vim-snippets' Plugin 'garbas/vim-snipmate' +let g:snipMate = { 'snippet_version' : 1 } Plugin 'sirver/ultisnips' let g:UltiSnipsExpandTrigger = '' let g:UltiSnipsListSnippets = '' @@ -601,10 +623,14 @@ nnoremap O :FZF! if v:version >= 800 " Async lint - "Plugin 'w0rp/ale' + " Plugin 'w0rp/ale' let g:ale_fixers = { - \ '*': ['remove_trailing_lines', 'trim_whitespace'], - \} + \ '*': ['remove_trailing_lines', 'trim_whitespace'], + \} + let g:ale_linters = { + \ 'cpp': ['clangd'], + \} + Plugin 'autozimu/LanguageClient-neovim', { \ 'oninstall': 'bash install.sh', \ } @@ -733,4 +759,37 @@ let g:tmux_navigator_no_mappings=1 Plugin 'junegunn/vim-peekaboo' Plugin 'patashish704/pandoc-complete' + +" Debugger +Plugin 'puremourning/vimspector' +"let g:vimspector_enable_mappings = 'HUMAN' + +" Open browser related things +Plugin 'tyru/open-browser.vim' +let g:openbrowser_search_engines = extend( + \ get(g:, 'openbrowser_search_engines', {}), + \ { + \ 'cppreference': 'https://en.cppreference.com/mwiki/index.php?title=Special%3ASearch&search={query}', + \ 'qt': 'https://doc.qt.io/qt-5/search-results.html?q={query}', + \ 'devdoc': 'https://devdocs.io/#q={query}', + \ 'github-cpp': 'http://github.com/search?l=C%2B%2B&q=fork%3Afalse+language%3AC%2B%2B+{query}&type=Code', + \ 'en2fr': 'http://translate.google.fr/translate_t?hl=fr&ie=UTF-8&text={query}&sl=en&tl=fr#', + \ 'fr2en': 'http://translate.google.fr/translate_t?hl=fr&ie=UTF-8&text={query}&sl=fr&tl=en#', + \ 'verbe' : 'http://www.la-conjugaison.fr/du/verbe/{query}.php' + \ }, + \ 'keep' + \) +nnoremap osx :call openbrowser#smart_search(expand(''), "cppreference") +nnoremap osq :call openbrowser#smart_search(expand(''), "qt") +nnoremap osd :call openbrowser#smart_search(expand(''), "devdoc") +nnoremap osen2fr :call openbrowser#smart_search(expand(''), "en2fr") +nnoremap osfr2en :call openbrowser#smart_search(expand(''), "fr2en") + +" A recent tagbar +Plugin 'liuchengxu/vista.vim' +" highlight other use of he word under the cursor +Plugin 'RRethy/vim-illuminate' +" Parentheses with various colors +Plugin 'luochen1990/rainbow' +let g:rainbow_active = 1 "set to 0 if you want to enable it later via :RainbowToggle call vundle#end()