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

Directly execute item from history #696

Closed
3 of 14 tasks
paulmenzel opened this issue Oct 6, 2016 · 2 comments
Closed
3 of 14 tasks

Directly execute item from history #696

paulmenzel opened this issue Oct 6, 2016 · 2 comments

Comments

@paulmenzel
Copy link

  • Category
    • fzf binary
    • fzf-tmux script
    • Key bindings
    • Completion
    • Vim
    • Neovim
    • Etc.
  • OS
    • Linux
    • Mac OS X
    • Windows
    • Etc.
  • Shell
    • bash
    • zsh
    • fish

Having switched to fzf, and coming from the normal Bash backwards history search, it’d be great, if selecting the item from the fzf list, would execute it right away, so I only have to hit return once.

@junegunn
Copy link
Owner

junegunn commented Oct 8, 2016

Duplicate of #477. The issue is left open as we haven't found a way to allow the user to dynamically choose which action to perform, edit or execute, on bash. If you unconditionllay want to execute the command, you can simply append \C-m to the key binding.

# Append \C-m
bind "$(bind -s | grep '^"\\C-r"' | grep -v '\\C-m' | sed 's/"$/\\C-m"/')"

Alternatively, you can define an extra key binding for that leaving the default one unchanged.

# CTRL-X CTRL-R
bind "$(bind -s | grep '^"\\C-r"' | sed 's/"/"\\C-x/' | sed 's/"$/\\C-m"/')"

@fgervais
Copy link

I added the "Append \C-m" line to the end of

shell/key-bindings.bash

It works but is this the correct location?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants