From 19569ad7d9072930dc66e640fa627b5e55dcf103 Mon Sep 17 00:00:00 2001 From: Piotr Piwko Date: Sat, 30 Jul 2016 21:39:37 +0200 Subject: [PATCH 1/2] Support for custom tag files Provide support for g:ctrlp_tag_custom_files variable which optionally may contains the list of tags files that shall be take into account during tag searching in Tag mode. --- autoload/ctrlp/tag.vim | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/autoload/ctrlp/tag.vim b/autoload/ctrlp/tag.vim index 31504dcc..d2ae4f37 100644 --- a/autoload/ctrlp/tag.vim +++ b/autoload/ctrlp/tag.vim @@ -137,7 +137,18 @@ fu! ctrlp#tag#id() endf fu! ctrlp#tag#enter() - let tfs = tagfiles() + + +let s:tagfiles = tfs != [] ? filter(map(tfs, 'fnamemodify(v:val, ":p")'), +\ 'filereadable(v:val)') : [] +endf + +fu! ctrlp#tag#enter() + if exists('g:ctrlp_tag_custom_files') + let tfs = g:ctrlp_tag_custom_files + else + let tfs = tagfiles() + endif let s:tagfiles = tfs != [] ? filter(map(tfs, 'fnamemodify(v:val, ":p")'), \ 'filereadable(v:val)') : [] endf From d12ac01762e99f9bc8ae5df9bda57c726d4e2b8c Mon Sep 17 00:00:00 2001 From: Piotr Piwko Date: Sat, 30 Jul 2016 21:55:54 +0200 Subject: [PATCH 2/2] Description for g:ctrlp_tag_custom_files --- doc/ctrlp.txt | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/doc/ctrlp.txt b/doc/ctrlp.txt index 4cc6017d..75614b91 100644 --- a/doc/ctrlp.txt +++ b/doc/ctrlp.txt @@ -89,6 +89,9 @@ Overview:~ |g:ctrlp_buftag_systemenc|....The encoding used for the ctags command. |g:ctrlp_buftag_types|........Add new filetypes and set the cmd arguments. + Tag mode: + |g:ctrlp_tag_custom_files|....Specified custom tag files + Advanced options: |ctrlp_open_func|.............Use custom file opening functions. |ctrlp_status_func|...........Change CtrlP's two statuslines. @@ -1351,7 +1354,19 @@ Examples: > \ 'args': '-f -', \ }, \ } -< + + +---------------------------------------- +Tag mode options:~ + + *'g:ctrlp_tag_custom_files'* +Use this to set different tags files than standard tags variable. If it is set +the tag searching consider only those specified files instead of global tags +variable. + +Examples: > + let g:ctrlp_tag_custom_files = [".tags", "~/.vim/global_tags"] + =============================================================================== CUSTOMIZATION *ctrlp-customization*