-
Notifications
You must be signed in to change notification settings - Fork 3
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
Feature request: make fasder work with fish shell #32
Comments
I did a little much here and I've only used it for a few hours but it's working thus far. Event Handler (i put it in function _fasd_update --on-event fish_postexec
# just split into tokens
echo $argv[1] | read --tokenize --list -- tokens
# early exit if there's only the leading command here
if test (count $tokens) -le 1
return
end
# get normalized, absolute path candidates for the rest of the tokens
# and keep only those that are existing files or directories
set -l candidates (path resolve -- $tokens[2..] | path filter -t file,dir)
for fp in $candidates
# only add if this path isn't to an executable
if not type -q $fp
fasder --add "$fp"
end
end
end and then just source the file in your config.fish to load it: |
Thank you, I have set it up and will check over the next few days and see how it works. |
ok I changed it to be a preexec hook which is what fasder does for zsh. I now realize that this is necessary for resolving paths in like function _fasd_update --on-event fish_preexec
# just split into tokens
echo $argv[1] | read --tokenize --list -- tokens
# early exit if there's only the leading command here
if test (count $tokens) -le 1
return
end
# get normalized, absolute path candidates for the rest of the tokens
# and keep only those that are existing files or directories
set -l candidates (path resolve -- $tokens[2..] | path filter -t file,dir)
for fp in $candidates
# only add if this path isn't to an executable
if not type -q $fp
fasder --add "$fp"
end
end
end |
Looks promising, if only I could use it with fish... But it looks like it has some zsh assumptions built in.
The text was updated successfully, but these errors were encountered: