Skip to content
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

Allows to modify defaul options during program run #152

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Czaki
Copy link

@Czaki Czaki commented Jan 21, 2015

In some projects I would be able to exclude some files and folders from ack request. After I read your documentation I think that this change is good option to allow this.
(helpfull with local vimrc plugins)

@ches
Copy link
Collaborator

ches commented Feb 20, 2015

Hi, thanks for your patch. Your suggestion makes sense to me, without it I'm not really sure why g:ack_default_options even exists, since you could put options that you want always into the g:ackprg setting itself (perhaps it's to be able to leave options like --column out of :AckFile, though there is already code to deal with that to some degree). So I agree that being able to change it at runtime makes it more useful.

Would you mind rebasing your branch? The location of the let l:ackprg_run line has moved, no other change in its behavior. And you can remove the line from plugin/ack.vim instead of commenting it out, please.

Thanks!

@Konfekt
Copy link
Contributor

Konfekt commented Mar 2, 2015

Regardant use cases, the nomenclature is just misleading. I assumed that the prg option should only contain the program name 'ag' and its parameters had to go into the options option.

@ches
Copy link
Collaborator

ches commented Jun 6, 2015

Regardant use cases, the nomenclature is just misleading. I assumed that the prg option should only contain the program name 'ag' and its parameters had to go into the options option.

Including more than just the executable name in g:ackprg makes sense if you consider that 'grepprg' works the same way, but I agree that it's potentially confusing for both g:ackprg and g:ack_default_options to be public configurable variables. Documentation could perhaps be more clear as @Konfekt said in #139, but docs aren't the answer if there isn't a strong reason for one of the settings to exist at all.

I'll give some thought to removing g:ack_default_options completely and just applying the options that the plugin currently uses after trying to detect whether ack or ack-grep is available. If people want to customize the arguments, they can include them in a custom g:ackprg value, which could be done in a local vimrc (or manually at runtime) as well. Personally I already do this with let g:ackprg = "ag --vimgrep" and it's all dandy.

ches added a commit that referenced this pull request Jun 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants