Skip to content

Comment on Percol: An interactive grep tool in your terminal

Comments

Let's rewrite all major userspace tools this way, or maybe use emacs ? I don't know.

ps: not sarcastic at all.

I agree with your second idea. I don't see how it's different from Vim or Emacs.

Check out vipe, which is included in Joey Hess' moreutils [1]. It lets you edit a pipe in vim. You can use it the same way as percol.

[1] https://joeyh.name/code/moreutils/

It's just a good idea that was never (AFAIK) done for shell only interactions. Often good to be able to have progressive enhancement (people not allowed to install emacs say).

What I was impressed by is

  git checkout $(git branch | percol)
to select the branch name interactively from a menu. How would you do that in Vim or Emacs?

Zsh completion with the menu style can do that, git checkout <tab> and you get a browseable list of branch names.

or dmenu

Funnily enough, I recently implemented something akin to percol:

https://github.com/dhamidi/tmenu

It actually tries to be dmenu for the terminal.

Glorious, I was about to start a similar thing (in python though). Time to play with your toy.

ps: I'd add a readline/inputrc alias for '| tmenu '

Would you mind sharing what that alias would look like and do? I can only imagine it appending the string "| tmenu" to the current line, eventually pressing Return for the user as well.

    $ bind '"\C-L": "\| less -S \C-j"'
Warning: seems like GNU readline isn't case sensitive so C-L === C-l thus, in this example, C-l default behavior (clear screen?) is overridden. I didn't RTFM so trust yourself.

Also, a redditor told me about slmenu (dmenu parody for shell)

http://www.reddit.com/r/linux/comments/283ziw/tmenu_dmenu_fo...

Update: the README now describes the available key bindings and gives more usage examples.

Google says it's an x11 app? I prefer something that works on random ssh connections and is more "inline" to the current command context

Ha what a moron I am. The funniest part is that I was ranting on #python about the need for a tui only version of that.

ps: even funnier, someone just posted a personal project doing just that.

How would you do that in [...] Emacs?

Use Magit, which is probably the best Git client anyway.

Regarding Emacs: git ships with Emacs integration <https://github.com/git/git/tree/master/contrib/emacs>.

Note that most likely git.el is not on your load-path. After it is loaded, you can use M-x git-status to interactively stage, diff and commit files. In the git-status buffer you can checkout a branch with C-c C-o. If helm is installed, you'll get something similar to percol right in Emacs.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.