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

fzf command history integration #50

Open
eyalev opened this issue Oct 9, 2017 · 6 comments
Open

fzf command history integration #50

eyalev opened this issue Oct 9, 2017 · 6 comments

Comments

@eyalev
Copy link

eyalev commented Oct 9, 2017

fzf (https://github.com/junegunn/fzf) enables fuzzy-searching the command history (among other things).

When I'm in a regular shell I can hit Ctrl+R and filter with fuzzy-search through previous commands.

Is there a way to achieve this is shellex?

Thanks

@pseyfert
Copy link
Collaborator

pseyfert commented Oct 9, 2017

Hi,
since shellex just runs a zsh, and fzf lists zsh as supported shells, I claim fzf should just work out of the box in shellex. You'd only need to create a config file like ${HOME}/.shellex/99-fzf which contains what you'd put in your ${HOME}/.zshrc to use fzf in zsh. I'll give it a try in the next days.
Cheers.

@pseyfert
Copy link
Collaborator

pseyfert commented Oct 9, 2017

following what fzf does in the installation, I added

export PATH="$PATH:/home/pseyfert/coding/fzf/bin"
source /home/pseyfert/coding/fzf/shell/key-bindings.zsh

to ~/.shellex/99-fzf. fzf mostly works, the problem is that the resizing of shellex doesn't let you see the search results, so that's kind of useless.

As a hack one could prevent shrinking of the window in urxvt/shellex.in in on_line_update, or at least shrinking to less than 20 lines, but then you have the large shellex, even after you picked your match and want to edit the line further. It should be possible to do better…

@eyalev
Copy link
Author

eyalev commented Oct 9, 2017

Thanks for your efforts!

I guess I could work with fixed-lines-height.


Related question:

When I'm running shellex from my current terminal it works as you described.
But when I'm running from 'Alt-F2` (command launcher on Ubuntu) I get:

fzf-history-widget:4: command not found: fzf

Anyway to fix this?

@pseyfert
Copy link
Collaborator

pseyfert commented Oct 9, 2017

I also had that first, do you have your equivalent of the line

export PATH="$PATH:/home/pseyfert/coding/fzf/bin"

right?

Also, assuming you already have fzf installed for your regular shell, I assume you ran the install script in fzf at some point. Do you have a fzf/bin/fzf executable? In my case - not to mess with my standard shell - I ran ./install --no-bash --no-zsh --no-fish, such that the executable is prepared but no rc file manipulated.

@eyalev
Copy link
Author

eyalev commented Oct 9, 2017

Oh, my bad(!) I had a typo in the export line..

Thanks again

@kolypto
Copy link

kolypto commented Mar 31, 2019

In my case, the problem was that I cloned the repository, but did not compile the fzf binary file.
Go to your fzf installation path, and run ./install:

$ cd $FZF_BASE && ./install

Hope it helps!

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

No branches or pull requests

3 participants