forked from laixintao/myrc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.common_alias
54 lines (39 loc) · 1.64 KB
/
.common_alias
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh
alias ll='ls -ahlF'
# verbose
alias mkdir='mkdir -v'
alias mv='mv -v'
alias cp='cp -v'
alias rm='rm -v'
alias ln='ln -v'
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
alias git-tree='git log --graph --decorate --pretty=oneline --abbrev-commit'
alias p4="proxychains4"
# vim $(fzf)
alias vf='vim $(fzf --preview "file {}" --preview-window down:1 --inline-info)'
# open typora note
alias note="open -a typora /Users/laixintao/Program/gist"
alias cat="bat"
alias ping="prettyping"
alias a=ansible
alias h=htop
alias d=docker
alias v=vagrant
alias ap=ansible-playbook
alias pub-repo="git config user.name laixintao && git config user.email laixintao1995@163.com"
alias gpc='git pullrequest create $(git branch | grep \* | cut -d " " -f2) master'
alias gcn='git commit -v --no-verify'
alias gme='GIT_COMMITTER_DATE="$(gdate --date=20:43)"; git commit --date $GIT_COMMITTER_DATE' # private work
# find for hidden files
alias fd='fd -HI'
alias clean-log='\fd -HI -e log -x rm -rf'
# https://www.commandlinefu.com/commands/view/9065/what-is-the-use-of-this-switch-
function manswitch () { man $1 | less -p "^ +$2"; }
# convert milliseconds to verbose datetime
# https://stackoverflow.com/questions/12362562/convert-milliseconds-timestamp-to-date-from-unix-command-line
milliseconds() { echo $(date -d @$(($1 / 1000))) }
# alias iredis="/Users/laixintao/.virtualenvs/iredis/bin/iredis"
alias vg="vagrant global-status"
alias abrew="/opt/homebrew/bin/brew"