Skip to content

Commit

Permalink
Add fish aliases and functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ndbroadbent committed Oct 8, 2024
1 parent 3cf9e9d commit 637fd9d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
7 changes: 7 additions & 0 deletions fish/conf.d/aliases.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# alias ~='cd ~'
alias c-='cd -'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias ......='cd ../../../../..'
11 changes: 11 additions & 0 deletions fish/conf.d/clipboard.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Aliases for scripts in ~/bin
# ----------------------------
alias cb="simple_clipboard"
# Copy contents of a file
alias cbf="simple_clipboard <"
# Copy SSH public key
alias cbs="echo 'Copying ~/.ssh/id_rsa.pub to clipboard...' && simple_clipboard < ~/.ssh/id_rsa.pub"
# Copy current working directory
alias cbd="pwd | simple_clipboard"
# Copy current git SHA-1
alias cbg="echo 'Copying latest commit hash to clipboard...' && git rev-parse --verify HEAD | simple_clipboard"
4 changes: 4 additions & 0 deletions fish/conf.d/git.fish
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %
abbr -a gsf "git show --oneline --name-only"
alias gdi="git --no-pager -c diff.image.textconv=imgcat -c diff.image.command=imgdiff diff"

# Adds all changes to current commit and then force pushes.
# Never use this on a team project!!
alias GFORCE='git add -A && git commit --amend -C HEAD && git push -f'

function grbi
if test (count $argv) -eq 0
git rebase -i HEAD~10
Expand Down

0 comments on commit 637fd9d

Please sign in to comment.