My zsh configuration
git clone https://mcol.xyz/code/zshrc
Log | Files | Refs | Submodules | README

commit c21b1f7f8dcae46f4470d1bd75e26d53f2c53231
parent 7d148c5f7a89530912db959208d70e3d48c79fb6
Author: mcol <mcol@posteo.net>
Date:   Mon, 15 Nov 2021 00:49:22 +0000

update

Diffstat:
Maliases | 30+++++++++++++++++++++++++-----
Mfunctions.zsh | 8++++++--
Mrc.conf | 20++++++++++----------
Mzshrc | 17++++++++++++++---
4 files changed, 55 insertions(+), 20 deletions(-)

diff --git a/aliases b/aliases @@ -6,13 +6,22 @@ # misc alias ..='cd ../' alias ...='cd ../../' -alias l='ls -lhFv' +alias l='ls -lhFv -I \*.o' alias lc='ls -c1' alias tmp='cd /tmp; l' alias _='sudo' alias grep='grep --exclude-dir="__pycache__"' alias p='ps aux | grep -v grep | grep -i' alias import='echo you forgot to enter python' +alias rg='grep -r' +vgr() { vim `grep -lr "$@"`; } + +if [[ -z "$WAYLAND_DISPLAY" ]] +then + alias copy='xclip -selection clipboard' +else + alias copy='wl-copy' +fi # systemd alias sc='systemctl' @@ -52,14 +61,20 @@ alias gs='git status' alias ad='git add' alias co='git commit' alias cm='git commit -m' +alias ca='git commit --amend' alias psh='git push' +alias pshs='git push &> /dev/null &' alias fe='git fetch && git status' alias pl='git pull' -alias rb='git pull --rebase upstream master' +alias rb='git pull --rebase upstream master || git pull --rebase upstream main' +alias rbi='git rebase -i' +alias rbc='git rebase --continue' +rbh() { git rebase -i HEAD~$1; } alias br='git branch' alias brs='git branch -v' alias ch='git checkout' alias dif='git diff' +alias diff='git diff --' alias dic='git diff --cached' alias cl='git clone' alias chp='git cherry-pick' @@ -67,12 +82,17 @@ alias rs='git restore' alias st='git stash' alias stl='git stash list' alias stp='git stash pop' +pr() { git fetch upstream pull/$1/head:$1 && git checkout $1; } +lg() { git log -${1:-1}; } +alias lgc="git log -1 | head -1 | awk '{print \$2}' | copy -n" # tools alias usync='rsync -avPzh --delete' -alias psb='python setup.py build' -alias psi='python setup.py install' -alias psiu='python setup.py install --user' +alias psb='python setup.py -q build' +alias psi='python setup.py -q install' +alias psiu='python setup.py -q install --user' +alias m=make +alias mc='make clean' # quick edits alias modalia='vim $HOME/.config/aliases && source $HOME/.config/aliases' diff --git a/functions.zsh b/functions.zsh @@ -63,8 +63,12 @@ avi_to_mp4() { } rec_screen() { - ffmpeg -f x11grab -r 30 -s 1920x1080 -i :0.0 out.mp4 + ffmpeg -f x11grab -r 30 -s 1920x1080 -i $DISPLAY -pix_fmt yuv420p out.mp4 } rec_screen_mic() { - ffmpeg -f x11grab -r 30 -s 1920x1080 -i :0.0 -f pulse -ac 2 -i default out.mkv + ffmpeg -f x11grab -r 30 -s 1920x1080 -i $DISPLAY -f pulse -ac 2 -i default out.mkv +} + +tagans() { + git log --pretty=format:"%an" $1...$2 | sort -u } diff --git a/rc.conf b/rc.conf @@ -23,7 +23,7 @@ set viewmode miller set column_ratios 1,3,4 # Which files should be hidden? (regular expression) -set hidden_filter ^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$|^__(py)?cache__$ +set hidden_filter ^\.|\.(?:pyc|pyo|o|swp)$|^lost\+found$|^__(py)?cache__$ # Show hidden files? You can toggle this by typing 'zh' set show_hidden false @@ -614,8 +614,8 @@ map r2 shell convert %s -rotate 180 %s map r3 shell convert %s -rotate 270 %s # drag files -#map <C-d> shell dragon-drag-and-drop -a -x %p &> /dev/null & -map <C-d> shell cp %s /tmp/%s && dragon-drag-and-drop -a -x /tmp/%s &> /dev/null & +map <C-d> shell dragon-drag-and-drop -a -x %p &> /dev/null & +#map <C-d> shell cp %s /tmp/%s && dragon-drag-and-drop -a -x /tmp/%s &> /dev/null & # filter while finding map f console scout -ftsea%space @@ -653,23 +653,23 @@ map gv cd ~/.vim map gD cd ~/Downloads map gz cd ~/.zsh map gB cd ~/.local/share/Trash/files -map gq cd /usr/lib/python3.7/site-packages/libqtile +map gq cd ~/git/qtile # git -map bs shell git -c color.status=always status | less -r +map bs shell git -c color.status=always status | less --mouse -r map bm console shell git commit -m ' -map bd shell git diff --color=always %s | less -r -map bD shell git diff --color=always | less -r +map bd shell git diff --color=always -- %s | less --mouse -r +map bD shell git diff --color=always | less --mouse -r map ba shell git add %s map bA shell git add -f %s map bc console shell git checkout%space -map bp shell git push | less -r -map bl shell git pull | less -r +map bp shell git push | less --mouse -r +map bl shell git pull | less --mouse -r map bu shell git restore --cached %s map br shell git restore %s map bt shell tig -map bg shell gita add $(git rev-parse --show-toplevel) | less +map bg shell gita add $(git rev-parse --show-toplevel) | less --mouse # a plugin that adds file glyphs / icon support to Ranger: # https://github.com/alexanderjeurissen/ranger_devicons default_linemode devicons diff --git a/zshrc b/zshrc @@ -21,6 +21,7 @@ local ZSH="$HOME/.zsh" HYPHEN_INSENSITIVE="true" COMPLETION_WAITING_DOTS="true" ZSH_COMPDUMP="$HOME/.zcompdump" +setopt NO_nomatch # zsh history HISTFILE="$HOME/.zsh_history" @@ -68,6 +69,16 @@ export LC_CTYPE=en_US.UTF-8 # don't load default ranger config export RANGER_LOAD_DEFAULT_RC=FALSE -export PYTHONPATH=$HOME/git/reach -export XKB_DEFAULT_OPTIONS=caps:swapescape,altwin:swap_alt_win -export XKB_DEFAULT_LAYOUT=gb +export PYTHONPATH=$HOME/git/reach:$PYTHONPATH + +# mypy +export MYPYPATH=$PYTHONPATH + +export PAGER="less --mouse" + +# If being executed via the '2' script +if [[ -n "$DO2" ]] +then + z $DO2 + unset DO2 +fi