6 ms·
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.
by kbd 6y ago
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/e23b3e8e2363284c3c766c0be2211f46c745354a/HOME/.config/git/config#L110 https://github.com/kbd/setup/blob/e23b3e8e2363284c3c766c0be2...
- JulianWasTaken 6y agoI 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/commands.zsh#L44 https://github.com/Julian/dotfiles/blob/main/.config/zsh/com...
- kbd 6y agoYou 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.
- JulianWasTaken 6y agoAh, interesting -- as in fzf wants you to integrate it with your shell's tab completion by default?
- kbd 6y agoYeah https://github.com/junegunn/fzf#files-and-directories 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-line https://github.com/junegunn/fzf#key-bindings-for-command-lin...