Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Figure I'd link my git aliases here, that make heavy use of fzf. The goal is generally to never have to type a filename (eg. for git add) or a commit hash (eg. for cherry-pick).

Here's a link to my 'cp' alias that lets me choose a branch, then a commit to cherry pick into my current branch:

https://github.com/kbd/setup/blob/e23b3e8e2363284c3c766c0be2...



I have to read through yours which indeed look nice from a quick scan, but if your goal is firstly to save typing file paths, I presume you instead considered just having a shell mapping to do that instead of needing to instrument aliases for each command? Here's mine, which I get by hitting ctrl-s anywhere in any command line: https://github.com/Julian/dotfiles/blob/main/.config/zsh/com...


You can get similar behavior out of the box with fzf by typing `git add **[tab]`. The difference with what I do in my aliases is that I take the choices of files to add from the output of git status.


Ah, interesting -- as in fzf wants you to integrate it with your shell's tab completion by default?


Yeah https://github.com/junegunn/fzf#files-and-directories

Though I just remembered fzf maps ctrl+t by default as well (I never use it...)

https://github.com/junegunn/fzf#key-bindings-for-command-lin...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: