From bee2daacc112b88d9c1b96d70a40a308818dca0d Mon Sep 17 00:00:00 2001 From: TheK4n Date: Fri, 12 Aug 2022 20:58:58 +0300 Subject: [PATCH] rename zsh aliases --- README.md | 2 +- sub/bash/functions | 13 +------------ sub/zsh/aliases | 8 ++++---- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 9dcb408..dd10658 100644 --- a/README.md +++ b/README.md @@ -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 | diff --git a/sub/bash/functions b/sub/bash/functions index e7c4a16..dcf13b4 100644 --- a/sub/bash/functions +++ b/sub/bash/functions @@ -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" diff --git a/sub/zsh/aliases b/sub/zsh/aliases index 19f7e5a..dca6968 100644 --- a/sub/zsh/aliases +++ b/sub/zsh/aliases @@ -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