Git diff add bump .emacs.d remove useless aliases.
This commit is contained in:
parent
6c1663505d
commit
444f12c844
@ -1 +1 @@
|
||||
Subproject commit 80834324ebb10a1ebe4617930b70c8f9b6ae362f
|
||||
Subproject commit a026244b86416f3ef7137b915cb1699ad1d977f0
|
@ -15,6 +15,8 @@
|
||||
reb = "!r() { git rebase -i HEAD~$1; }; r"
|
||||
suir = submodule update --init --recursive
|
||||
poh = push origin HEAD
|
||||
du = "!d() { git ls-files $1 --error-unmatch 2>/dev/null 1>/dev/null && git diff $1 || `git config --get core.pager` $1; }; d"
|
||||
amend = commit -a --amend -C HEAD
|
||||
|
||||
[core]
|
||||
# Use custom `.gitignore` and `.gitattributes`
|
||||
|
@ -1,6 +1,8 @@
|
||||
alias script_abspath='$(dirname "${BASH_SOURCE}" | xargs "${readlink_command}" -f)'
|
||||
|
||||
alias emacs="emacsclient -t"
|
||||
alias tmux="tmux -2"
|
||||
alias remote_os_copy='linux_nc_paste_to_remote_clipboard'
|
||||
alias tmux_cb_to_remote_cb='tmux saveb - | linux_nc_paste_to_remote_clipboard'
|
||||
alias timestamp='date +%s'
|
||||
|
||||
# enables the sudoing of aliases.
|
||||
alias sudo='sudo '
|
||||
@ -19,27 +21,11 @@ alias localip="ifconfig getifaddr en1"
|
||||
|
||||
alias whois="whois -h whois-servers.net"
|
||||
|
||||
# Clean up LaunchServices to remove duplicates in the “Open With” menu
|
||||
alias lscleanup="/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user && killall Finder"
|
||||
|
||||
# View HTTP traffic
|
||||
alias sniff="sudo ngrep -d 'en1' -t '^(GET|POST) ' 'tcp and port 80'"
|
||||
alias httpdump="sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E \"Host\: .*|GET \/.*\""
|
||||
|
||||
# Canonical hex dump; some systems have this symlinked
|
||||
command -v hd > /dev/null || alias hd="hexdump -C"
|
||||
|
||||
# OS X has no `md5sum`, so use `md5` as a fallback
|
||||
command -v md5sum > /dev/null || alias md5sum="md5"
|
||||
|
||||
# OS X has no `sha1sum`, so use `shasum` as a fallback
|
||||
command -v sha1sum > /dev/null || alias sha1sum="shasum"
|
||||
|
||||
command -v greadlink > /dev/null && alias readlink="greadlink"
|
||||
|
||||
# URL-encode strings
|
||||
alias urlencode='python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1]);"'
|
||||
|
||||
# Merge PDF files
|
||||
# Usage: `mergepdf -o output.pdf input{1,2,3}.pdf`
|
||||
alias mergepdf='/System/Library/Automator/Combine\ PDF\ Pages.action/Contents/Resources/join.py'
|
||||
@ -56,8 +42,3 @@ done
|
||||
|
||||
alias stfu="osascript -e 'set volume output muted true'"
|
||||
alias pumpitup="osascript -e 'set volume 7'"
|
||||
|
||||
alias tmux="tmux -2"
|
||||
alias remote_os_copy='linux_nc_paste_to_remote_clipboard'
|
||||
alias tmux_cb_to_remote_cb='tmux saveb - | linux_nc_paste_to_remote_clipboard'
|
||||
alias timestamp='date +%s'
|
||||
|
@ -16,6 +16,23 @@ function is_zsh() {
|
||||
test -n "$(current_shell | grep -o zsh)"
|
||||
}
|
||||
|
||||
function git_diff_add() {
|
||||
git status --porcelain | awk '{print $2}' | xargs -I filename sh -c "git du filename && git add filename"
|
||||
}
|
||||
|
||||
function confirm() {
|
||||
# call with a prompt string or use a default
|
||||
read -r -p "$1" response
|
||||
case $response in
|
||||
[yY][eE][sS]|[yY])
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function get_cols() {
|
||||
FS=' '
|
||||
while getopts "F:" OPTCHAR; do
|
||||
|
@ -33,4 +33,4 @@ $FG[255]╰─± '
|
||||
|
||||
PS2=''
|
||||
|
||||
RPROMPT='%!'
|
||||
RPROMPT='Last Exit Code: $?'
|
||||
|
Loading…
Reference in New Issue
Block a user