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

Add option to use something else instead of Set-Location with Invoke-FzfPsReadlineHandlerSetLocation #88

Closed
Aankhen opened this issue Oct 11, 2021 · 4 comments · Fixed by #118

Comments

@Aankhen
Copy link

Aankhen commented Oct 11, 2021

This package is awesome! The Alt+C binding is what I’m most interested in. I try to avoid cd/Set-Location, though; I’d like to be able to use Push-Location or even zoxide instead. Would it be possible to add a setting to use a different command? (I tried to do this myself and thought I got it right on the script side, but I couldn’t figure out how to get PowerShell to pick up my changes even after rebuilding and reimporting.)

@mattcargile
Copy link
Contributor

mattcargile commented Jan 3, 2022

I think you want these environment variables?

$env:FZF_ALT_C_COMMAND
$env:FZF_ALT_C_OPTS

Nevermind, I see what you mean. You would want to change this line. You should be able to go into your local copy of the module and update this line.

Set-Location $result

P.S. There is a new alpha release 2.3.1-alpha where you need to use the AllowPrerelease flag.

@mattcargile
Copy link
Contributor

Also, did you Build the .sln as well and copy the .dll into the root directory prior to Import-Module? You could try adding a -Verbose flag to see what the error was.

The solution also has a dependency on this add-on.

@kelleyma49
Copy link
Owner

I added a new option to Set-PsFzfOption called AltCCommand, which accepts a scriptblock which is used as a replacement for the command in the Alt+C function. Refer to the default scriptblock for an example:

$script:AltCCommand = [ScriptBlock]{

@Aankhen
Copy link
Author

Aankhen commented Jan 30, 2022

That works perfectly with zoxide. Thank you very much!

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 a pull request may close this issue.

3 participants