vim-ctrlp-switcher
vim-ctrlp-switcher copied to clipboard
ctrlp-switch based on CWD
could this be changed to search based on current file's dir ? not based on pwd , so that i don't need switch to current edit file's dir to use ctrlp-switcher
It is possible.
Would you like it to search only that folder, or the subdirs as well?
yes, in most case, i think you should do like this :
first search the .git / .hg folder , to locate the repository root dir ,
if not found , should search from the current edit file's dir include its subdirs ,
this will be more smart .
how do you think ?
If you want to search from the project's sources, I advise you to set the g:ctrlpswitcher_project_sources for your project. It will override the current directory.
I can add an option to use the project root (it is provided by ctrlp), but still the variable above should be the preferred way to specify the root location under which the search is to be performed.
Now, regarding searching from the current directory - do you want the other results to be hidden, or you'd be fine just with sorting those from the file's dir (and subdirs) first and then the others (this is something I have planned to do)
mm.. seems use project root is more smart , setting g:ctrlpswitcher_project_sources to a fix value is not enough , i have several projects , so i need set it every time ..
searching from the current file's directory sometimes is more useful , for example , sometimes my CWD=~/ , if search from ~/ , this will consume lots of time to search ..
could you provide another command just like ctrlp :
: CtrlPSwitcherCurFile
: CtrlPSwitcherCurDir
this will be useful for use ..
Thanks
That is why the documentation recommends using MarcWeber/vim-addon-local-vimrc.git
could you provide another command just like ctrlp :
Not a fan of adding too many commands. I'd rather have per-project options.
Will think about it.
I'd also appreciate if we could search in the result of :pwd, e.g with :CtrlPSwitcherPwd Many thanks!