mirror of
https://github.com/CoolnsX/hyprdots.git
synced 2025-12-20 07:15:23 +05:30
project lead is allergic to changes...
This commit is contained in:
17
.zshrc
17
.zshrc
@@ -17,26 +17,30 @@ b64 () { printf "%s" "$1" | base64 $2; }
|
||||
url() { curl -s https://0x0.st -F "file=@$*" | wl-copy && notify-send "Link copied to clipboard"; }
|
||||
|
||||
gtd () {
|
||||
[ -z "$*" ] && file=$(git diff --name-only | fzf --border=rounded --height=10 --layout=reverse | tr -d ' ') || file=$*
|
||||
[ -z "$file" ] || git diff --name-only --relative --diff-filter=d $file | xargs bat --paging=never --diff
|
||||
unset file
|
||||
preview="git diff $@ --color=always -- {-1}"
|
||||
git diff $@ --name-only --relative | fzf --ansi --preview $preview --preview-window right:65%:wrap -0
|
||||
unset preview
|
||||
}
|
||||
|
||||
gtc () { [ -z "$*" ] && [ -p "/dev/stdin" ] && read -r query </dev/stdin || query=$*; git clone "$query"; }
|
||||
|
||||
gtr () { [ -z "$*" ] && [ -p "/dev/stdin" ] && read -r query </dev/stdin || query=$*; curl -s "https://api.github.com/users/$query/repos" | sed -nE 's|.*ssh_url": "([^"]*)".*|\1|p' | fzf --border --height=10 --layout=reverse; }
|
||||
gtr () { [ -z "$*" ] && [ -p "/dev/stdin" ] && read -r query </dev/stdin || query=$*; curl -s "https://api.github.com/users/$query/repos" | sed -nE 's|.*ssh_url": "([^"]*)".*|\1|p' | fzf --border --height=10 --layout=reverse -0; }
|
||||
|
||||
gtu () { [ -z "$*" ] || curl -s "https://api.github.com/search/users?q=$*" | sed -nE 's_.*login": "([^"]*)".*_\1_p' | fzf --layout=reverse --border --height=10; }
|
||||
gtu () { [ -z "$*" ] || curl -s "https://api.github.com/search/users?q=$*" | sed -nE 's_.*login": "([^"]*)".*_\1_p' | fzf --layout=reverse --border --height=10 -0; }
|
||||
|
||||
clshist() {
|
||||
a=$(cat ~/.histfile | wc -l)
|
||||
[ "$a" -gt 201 ] && sed -i "1,$((a - 200))d" ~/.histfile
|
||||
[ "$a" -gt 301 ] && sed -i "1,$((a - 300))d" ~/.histfile
|
||||
}
|
||||
|
||||
v() {
|
||||
[ -z "$*" ] && nvim -O $(fzf --preview 'bat --color=always --style=numbers --line-range=:500 {}' -m | tr '\n' ' ') || nvim -O $*
|
||||
}
|
||||
|
||||
translate () {
|
||||
curl -s "https://www.google.com/async/translate?vet=12ahUKEwjelf-f06v8AhUKzjgGHVe0CBkQqDh6BAgFECw..i&ei=8kC0Y97UDIqc4-EP1-iiyAE&yv=3&cs=0" -X POST -d "async=translate,sl:auto,tl:$1,st:$(jq -Rr '@uri' <<< $2),id:1672757511748,qc:true,ac:true,_id:tw-async-translate,_pms:s,_fmt:pc" -H "content-type:application/x-www-form-urlencoded;charset=UTF-8" | sed -nE 's|.*target-text">([^<]*)<.*romanization">([^<]*)<.*roman.*|translated : \1\nroman : \2|p'
|
||||
}
|
||||
|
||||
help() {
|
||||
"$@" --help 2>&1 | bat --plain --language=help
|
||||
}
|
||||
@@ -51,6 +55,7 @@ rmpkg(){
|
||||
|
||||
# Lines configured by zsh-newuser-install
|
||||
export EDITOR="nvim"
|
||||
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
|
||||
export VISUAL="nvim"
|
||||
export TERMINAL="foot"
|
||||
export OPENER="xdg-open"
|
||||
|
||||
Reference in New Issue
Block a user