Mercurial > vim-gutentags
changeset 66:a14a788e3809
Filetype specific ctags executable command
If, for example, a variable `g:gutentags_ctags_executable_ruby` is
found, its value will be used as the ctags executable command for ruby
filetype files. Otherwise, it will default to global
`g:gutentags_ctags_executable`
author | marc <marc@lamarciana.com> |
---|---|
date | Sun, 17 May 2015 10:39:20 +0200 |
parents | 9e768b83d701 |
children | 57649935316f |
files | autoload/gutentags.vim autoload/gutentags/ctags.vim |
diffstat | 2 files changed, 10 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/autoload/gutentags.vim Sat May 16 21:51:17 2015 -0700 +++ b/autoload/gutentags.vim Sun May 17 10:39:20 2015 +0200 @@ -175,6 +175,15 @@ endif endfunction +" Get final ctags executable depending whether a filetype one is defined +function! gutentags#get_ctags_executable() abort + if exists('g:gutentags_ctags_executable_{&filetype}') + return g:gutentags_ctags_executable_{&filetype} + else + return g:gutentags_ctags_executable + endif +endfunction + " Get the suffix for how to execute an external command. function! gutentags#get_execute_cmd_suffix() abort if has('win32')
--- a/autoload/gutentags/ctags.vim Sat May 16 21:51:17 2015 -0700 +++ b/autoload/gutentags/ctags.vim Sun May 17 10:39:20 2015 +0200 @@ -41,7 +41,7 @@ try " Build the command line. let l:cmd = gutentags#get_execute_cmd() . s:runner_exe - let l:cmd .= ' -e "' . g:gutentags_ctags_executable . '"' + let l:cmd .= ' -e "' . gutentags#get_ctags_executable() . '"' let l:cmd .= ' -t "' . a:tags_file . '"' let l:cmd .= ' -p "' . a:proj_dir . '"' if a:write_mode == 0 && filereadable(a:tags_file)