-
Notifications
You must be signed in to change notification settings - Fork 6
enable specifying a root-relative subdirectory to be searched in #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks for the suggestion! I'd like to understand the use case a little bit. I think you're trying to search the root file system instead of from the current project subdirectory. That seems out of scope for how The current SideSearch command tries to pass arguments directly to the terminal command. For example, if you want to find the word I don't think it is necessary to have code in place that concatenates Please correct me if I'm misunderstanding anything. |
Also, I just realized that the current behavior is unintended. By accident, the Vim args take precedent over the Anyway, without any further changes to the plugin source, I think the previous comment still stands. We can override the search path simply by adding it after the search term via |
With The use case exactly the opposite. With So because |
Okay, I think I understand. The new function allows the user to specify a subdirectory instead of using the guessed project root. So the logical steps would be:
(Sorry for the pseudo-code, I don't have Vim syntax in my brain at the moment) @jakutis What do you feel about this solution? Want to take a shot at it? Otherwise, I will later this weekend. |
Go ahead with it! I think this is a good solution - it is simple and enables my use case and possibly other. It works for me when "What looks like a path" would be defined as "if the string is a path to an existing directory" - any path - relative or absolute |
Thanks for the PR. After the discussions, we now have this PR instead: #16 |
Motivation: missing
:SideSearch
ability to select a root-relative subdirectory to be searched in.This PR:
SideSearchRestrictedAndRelative
command/function (see below) and then do:SideSearchRestrictedAndRelative some\ query some/root-relative/directory
(or:SS some\ query some/root-relative/directory
)SideSearch
command/function APIThen to use this possibility - local user config would contain:
Having these (possibly with better naming) as part of
side-search.vim
, not user config, may also be a good idea. If you agree, then there would be less additions to README.In my config I also have the command abbreviation setup:
cabbrev SS SideSearchRestrictedAndRelative