rename zsh aliases
This commit is contained in:
parent
1913c383b7
commit
bee2daacc1
@ -53,7 +53,7 @@ Config files for:
|
||||
| Alias | Equals | Description |
|
||||
|:------------------------|:-------------------------------------------------|:----------------------------|
|
||||
| `git diff L` | `git diff \| less -R` | View stdout |
|
||||
| `cat main.py S -S py` | `cat main.py \| highlight -O ansi --syntax py` | Highlight syntax |
|
||||
| `cat main.py HL -S py` | `cat main.py \| highlight -O ansi --syntax py` | Highlight syntax |
|
||||
| `redis-server BG` | `redis-server &>/dev/null &` | Run command in background |
|
||||
|
||||
|
||||
|
||||
@ -129,17 +129,6 @@ mcd () {
|
||||
}
|
||||
|
||||
|
||||
# Syntax-highlight JSON strings or files
|
||||
# Usage: `json '{"foo":42}'` or `echo '{"foo":42}' | json`
|
||||
json() {
|
||||
if [ -t 0 ]; then # argument
|
||||
python -m json.tool <<< "$*" | pygmentize -l javascript
|
||||
else # pipe
|
||||
python -m json.tool | pygmentize -l javascript
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# docker
|
||||
|
||||
# execute bash shell in running container
|
||||
@ -165,6 +154,7 @@ py() {
|
||||
test -z "$@" && ipython -i -c "q = exit" || python3 $@
|
||||
}
|
||||
|
||||
|
||||
# toggle wireguard vpn with interface /etc/wireguard/wg0.conf
|
||||
# to allow sudo user toggle vpn without password:
|
||||
## sudo groupadd wireguard
|
||||
@ -172,7 +162,6 @@ py() {
|
||||
## sudo vi /etc/sudoers.d/wireguard
|
||||
### %wireguard ALL= NOPASSWD: /sbin/systemctl start wg-quick@wg0.service
|
||||
### %wireguard ALL= NOPASSWD: /sbin/systemctl stop wg-quick@wg0.service
|
||||
|
||||
vpn() {
|
||||
local STATUS SERVICE CONFIG CONFIGFILE
|
||||
CONFIG="$1"
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
alias -g L="| less -R"
|
||||
alias -g S='| highlight -O ansi'
|
||||
alias -g HL='| highlight -O ansi -S auto'
|
||||
alias -g CL=" --color=always | less -R"
|
||||
alias -g NO="1>/dev/null" # stdOut
|
||||
alias -g NE="2>/dev/null" # stdErr
|
||||
alias -g NA="1>/dev/null 2>&1" # All
|
||||
alias -g OUT="1>/dev/null" # stdOUT
|
||||
alias -g ERR="2>/dev/null" # stdERR
|
||||
alias -g ALL="1>/dev/null 2>&1"
|
||||
alias -g BG="&>/dev/null &"
|
||||
bindkey '`' autosuggest-accept
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user