Move a vimrc function so that it can be called in a private vimrc

This commit is contained in:
Michael Campagnaro 2023-05-10 13:06:52 -04:00
parent 418d1ae956
commit c05131d38f

49
vimrc
View File

@ -175,6 +175,33 @@ let g:campo_ctags_exclude = ['*.txt', '*.config', '.cache']
let g:campo_custom_ctags_args = ""
" Set extra paths to use when searching for ctags files. By default the current
" directory is always checked. You can use this to combine tag lookups from
" different projects, e.g. set it to the Jai directory and you can look up
" current project tags and Jai module tags (the latter isn't needed if you
" have Jai module tags in your local file, which can be generated using the
" ctags module at compile time). Related, if you're generating jai ctags and
" the editor isn't finding module references then check if the current
" directory is set to where the tags file exists. I've been caught up by this
" because I have a build.jai in the root and my code in a src/ folder, so the
" tags file gets created in the root and won't be seen if I've cd'd into src/
" when editing code.
"
" This destructively overwrites the tags option value.
"
" Call this from a .vimrc.private or .lvimrc file, e.g.
" call g:SetExtraCtagsPaths([g:campo_jai_path.'/tags'])
"
" You can see what your ctags search list is set to in the editor with :echo &tags
function! g:SetExtraCtagsPaths(paths_array)
let l:list = './tags,tags' " This is the default tags list set by vim.
for path in a:paths_array
let l:list .= ',' . path
endfor
let &tags=l:list
endfunction
"##################################################################################
" JAI
"##################################################################################
@ -780,28 +807,6 @@ let g:syntastic_check_on_wq = 0
let g:rg_highlight = 1
let g:rg_window_height = g:quickfix_pane_height
"##################################################################################
" C-TAGS
"##################################################################################
" Set extra paths to use when searching for ctags files. By default the current
" directory is always checked. You can use this to combine tag lookups from
" different projects, e.g. set it to the Jai directory and you can look up
" current project tags and Jai module tags (of course this isn't needed if you
" have Jai module tags in your local file).
"
" This destructively overwrites the tags option value.
"
" Call this from a .vimrc.private or .lvimrc file, e.g.
" call g:SetExtraCtagsPaths([g:campo_jai_path.'/tags'])
"
function! g:SetExtraCtagsPaths(paths_array)
let l:list = './tags,tags' " This is the default tags list set by vim.
for path in a:paths_array
let l:list .= ',' . path
endfor
let &tags=l:list
endfunction
"##################################################################################
" CTRL-P
"##################################################################################