From 7c3d7ffd6f1e993a010d77e6ed66f95b7a2ac82a Mon Sep 17 00:00:00 2001 From: Hizenberg Date: Wed, 19 Nov 2025 16:42:54 +0000 Subject: [PATCH] complete --- env_setup.sh | 20 +++++++++++++++++ my_vimrc | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) diff --git a/env_setup.sh b/env_setup.sh index e16933a..88cbfd9 100755 --- a/env_setup.sh +++ b/env_setup.sh @@ -51,8 +51,18 @@ essential_plugins=( optional_plugins=( "dense-analysis/ale" + "vim-scripts/OmniCppComplete" + "ludovicchabant/vim-gutentags" + "skywind3000/gutentags_plus" ) +essential_pkg=( + "build-essential" + "gdb" + "cscope" + "universal-ctags" + "global" +) # checkStatus 1 -- To exit the script # checkStatus 0 -- To return 255(failure) value # checkStatus {(optional)status-message} @@ -544,6 +554,16 @@ status=$? logStatus "Setting up Plugin directory: " $status touch status.txt + +# Installing packages + +for pkg in "${essential_pkg[@]}" +do + checkPkgIsInstalled "$pkg" 1 + status=$? + logStatus "Installing $pkg: " $status +done + # Installing the plugins for plugins in "${essential_plugins[@]}" do diff --git a/my_vimrc b/my_vimrc index 51317c1..0437e1a 100644 --- a/my_vimrc +++ b/my_vimrc @@ -251,6 +251,8 @@ endfunction command! ALEOn call s:ALEEnable() command! ALEOff call s:ALEDisable() +" Codequery +"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ function! s:CodeQueryEnable() abort silent! packadd unite.vim silent! packadd vim-codequery @@ -260,4 +262,64 @@ endfunction command! CQOn call s:CodeQueryEnable() + +" Gutentags -- Gtags +"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +function! GutenTagsEnable() abort + + "let g:gutentags_file_list_command = 'find tj100_mc/ modules/ce/ modules/ethCommon/ modules/ethTransport/ common/ -type f \( -name "*.[ch]" -o -name "*.cpp" -o -name "*.hpp" -o -name "*.js" -o -name "*.pl" -o -name "*.sh"\)' + + "let g:gutentags_ctags_extra_args = [ + " \'--language=C,C++,Javascript,Perl,Sh', + " \'--langmap=C:+.c.h', + " \'--langmap=C++:+.cpp.hpp.cc.hh', + " \'--langmap=Javascript:+.js', + " \'--langmap=Perl:+.pl.pm', + " \'--langmap=Sh:+.sh', + " \'--langmap=mib:+.mib' + " \] + + " For ctags and gtags_plus configuration + " enable gtags module + let g:gutentags_modules = ['ctags', 'gtags_cscope'] + + " config project root markers. + let g:gutentags_add_default_project_roots = 0 + let g:gutentags_project_roots = ['.root'] + + " Put the ctags file in /.root/tags (path is relative to project root) + let g:gutentags_ctags_tagfile = expand('$PWD/.root/tags') + + " Store GNU Global (gtags) databases under /.root/ (instead of ~/.cache/tags) + let g:gutentags_cache_dir = expand('$PWD/.root') + + " To let gutentag_plus manage the connection with gtags instead of gutentags. + "let g:gutentags_auto_add_gtags_cscope = 1 + + let g:gutentags_define_advanced_commnads = 1 + + " change focus to quickfix window after search (optional). + let g:gutentags_plus_switch = 1 + let g:gutentags_plus_nomap = 1 + noremap css :GscopeFind s + noremap csg :GscopeFind g + noremap csc :GscopeFind c + noremap cst :GscopeFind t + noremap cse :GscopeFind e + noremap csf :GscopeFind f + noremap csi :GscopeFind i =expand("") + noremap csd :GscopeFind d =expand("") + noremap csa :GscopeFind a + noremap csz :GscopeFind z + echo "Gutentags + Plus enabled" +endfunction + +function! s:GTagsDisable() abort + let g:gutentags_enabled = 0 + + if exists(':GscopeKill') | silent! GscopeKill | endif + + echo "Gutentags disabled" +endfunction + " My vimrc end -- Hizenberg