# HG changeset patch # User marc # Date 1431851960 -7200 # Node ID a14a788e3809193e54ee23ffd7b926440757bb90 # Parent 9e768b83d701bda056028cdabf731107f805a787 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` diff -r 9e768b83d701 -r a14a788e3809 autoload/gutentags.vim --- 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') diff -r 9e768b83d701 -r a14a788e3809 autoload/gutentags/ctags.vim --- 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)