Last active
January 8, 2019 10:44
-
-
Save marian-pritsak/d70880943dfa047a9433eab4a42ef21b to your computer and use it in GitHub Desktop.
Vim environment for SONiC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let sonic_root = getcwd() | |
let swss_path = sonic_root . "/src/sonic-swss" | |
let orch_path = swss_path . "/orchagent" | |
let sairedis_path = sonic_root . "/src/sonic-sairedis" | |
let swss_common_path = sonic_root . "/src/sonic-swss-common" | |
let sai_path = sonic_root . "/platform/mellanox/mlnx-sai/SAI-Implementation/mlnx_sai" | |
let sai_inc_path = sonic_root . "/platform/mellanox/mlnx-sai/SAI-Implementation/mlnx_sai/inc/sai" | |
let swss_common_inc_path = sonic_root . "/src/sonic-swss-common/common" | |
execute "set path+=".escape(g:sai_inc_path, ' ') | |
execute "set path+=".escape(g:swss_common_inc_path, ' ') | |
function Sonic() | |
execute 'cd' fnameescape(g:sonic_root) | |
endfunction | |
function Swss() | |
execute 'cd' fnameescape(g:swss_path) | |
endfunction | |
function Orch() | |
execute 'cd' fnameescape(g:orch_path) | |
endfunction | |
function Sairedis() | |
execute 'cd' fnameescape(g:sairedis_path) | |
endfunction | |
function SwssCommmon() | |
execute 'cd' fnameescape(g:swss_common_path) | |
endfunction | |
function Sai() | |
execute 'cd' fnameescape(g:sai_path) | |
endfunction | |
function UpdateTags(path, lang, tagspath, append) | |
execute '!ctags --languages='.a:lang.' -R -f '.a:tagspath.' --append='.a:append.' --exclude=debian --tag-relative=no '.a:path | |
endfunction | |
function SonicUpdateTags() | |
execute 'call UpdateTags(fnameescape(g:swss_path),"C++",fnameescape(g:sonic_root)."/tags","no")' | |
execute 'call UpdateTags(fnameescape(g:sairedis_path),"C++",fnameescape(g:sonic_root)."/tags","yes")' | |
execute 'call UpdateTags(fnameescape(g:saireids_path)."/SAI","C",fnameescape(g:sonic_root)."/tags","yes")' | |
execute 'call UpdateTags(fnameescape(g:swss_common_path),"C++",fnameescape(g:sonic_root)."/tags","yes")' | |
execute 'call UpdateTags(fnameescape(g:sai_path),"C",fnameescape(g:sonic_root)."/tags","yes")' | |
endfunction | |
execute 'set tags='.fnameescape(g:sonic_root).'/tags' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment