feat: mimeapps, remove p10k

This commit is contained in:
ange 2024-04-24 11:25:04 +02:00
parent 03a0bab194
commit 32cb220161
Signed by: ange
GPG Key ID: 9E0C4157BB7BEB1D
29 changed files with 1383 additions and 11738 deletions

View File

@ -1,55 +1,62 @@
# Binds are of the form <key sequence> = <command to run>
# To use '=' in a key sequence, substitute it with "Eq": "<Ctrl+Eq>"
# If you wish to bind #, you can wrap the key sequence in quotes: "#" = quit
<C-p> = :prev-tab<Enter>
<C-p> = :prev-tab<Enter>
<C-PgUp> = :prev-tab<Enter>
<C-n> = :next-tab<Enter>
<C-n> = :next-tab<Enter>
<C-PgDn> = :next-tab<Enter>
<C-t> = :term<Enter>
? = :help keys<Enter>
<C-c> = :prompt 'Quit?' quit<Enter>
<C-q> = :prompt 'Quit?' quit<Enter>
\[t = :prev-tab<Enter>
\]t = :next-tab<Enter>
<C-t> = :term<Enter>
? = :help keys<Enter>
<C-c> = :quit<Enter>
<C-q> = :quit<Enter>
<C-z> = :suspend<Enter>
[messages]
q = :quit<Enter>
r = :check-mail<Enter>
j = :next<Enter>
j = :next<Enter>
<Down> = :next<Enter>
<C-d> = :next 50%<Enter>
<C-f> = :next 100%<Enter>
<C-d> = :next 50%<Enter>
<C-f> = :next 100%<Enter>
<PgDn> = :next 100%<Enter>
k = :prev<Enter>
<Up> = :prev<Enter>
<C-u> = :prev 50%<Enter>
<C-b> = :prev 100%<Enter>
k = :prev<Enter>
<Up> = :prev<Enter>
<C-u> = :prev 50%<Enter>
<C-b> = :prev 100%<Enter>
<PgUp> = :prev 100%<Enter>
g = :select 0<Enter>
G = :select -1<Enter>
g = :select 0<Enter>
G = :select -1<Enter>
J = :next-folder<Enter>
<C-Down> = :next-folder<Enter>
K = :prev-folder<Enter>
<C-Up> = :prev-folder<Enter>
H = :collapse-folder<Enter>
<C-Left> = :collapse-folder<Enter>
L = :expand-folder<Enter>
J = :next-folder<Enter>
<C-Down> = :next-folder<Enter>
K = :prev-folder<Enter>
<C-Up> = :prev-folder<Enter>
H = :collapse-folder<Enter>
<C-Left> = :collapse-folder<Enter>
L = :expand-folder<Enter>
<C-Right> = :expand-folder<Enter>
v = :mark -t<Enter>
v = :mark -t<Enter>
<Space> = :mark -t<Enter>:next<Enter>
V = :mark -v<Enter>
V = :mark -v<Enter>
T = :toggle-threads<Enter>
T = :toggle-threads<Enter>
zc = :fold<Enter>
zo = :unfold<Enter>
za = :fold -t<Enter>
zM = :fold -a<Enter>
zR = :unfold -a<Enter>
<tab> = :fold -t<Enter>
<Enter> = :view<Enter>
d = :prompt 'Really delete this message?' 'delete-message'<Enter>
D = :delete<Enter>
a = :archive flat<Enter>
A = :unmark -a<Enter>:mark -T<Enter>:archive flat<Enter>
d = :prompt 'Really delete this message?' 'delete-message'<Enter>
D = :delete<Enter>
a = :archive flat<Enter>
A = :unmark -a<Enter>:mark -T<Enter>:archive flat<Enter>
C = :compose<Enter>
m = :compose<Enter>
@ -64,15 +71,22 @@ $ = :term<space>
! = :term<space>
| = :pipe<space>
/ = :search<space>
\ = :filter<space>
n = :next-result<Enter>
N = :prev-result<Enter>
/ = :search<space>
\ = :filter<space>
n = :next-result<Enter>
N = :prev-result<Enter>
<Esc> = :clear<Enter>
s = :split<Enter>
S = :vsplit<Enter>
pl = :patch list<Enter>
pa = :patch apply <Tab>
pd = :patch drop <Tab>
pb = :patch rebase<Enter>
pt = :patch term<Enter>
ps = :patch switch <Tab>
[messages:folder=Drafts]
<Enter> = :recall<Enter>
@ -88,32 +102,33 @@ A = :archive flat<Enter>
<C-l> = :open-link <space>
f = :forward<Enter>
f = :forward<Enter>
rr = :reply -a<Enter>
rq = :reply -aq<Enter>
Rr = :reply<Enter>
Rq = :reply -q<Enter>
H = :toggle-headers<Enter>
<C-k> = :prev-part<Enter>
<C-Up> = :prev-part<Enter>
<C-j> = :next-part<Enter>
<C-Down> = :next-part<Enter>
J = :next<Enter>
H = :toggle-headers<Enter>
<C-k> = :prev-part<Enter>
<C-Up> = :prev-part<Enter>
<C-j> = :next-part<Enter>
<C-Down> = :next-part<Enter>
J = :next<Enter>
<C-Right> = :next<Enter>
K = :prev<Enter>
<C-Left> = :prev<Enter>
K = :prev<Enter>
<C-Left> = :prev<Enter>
[view::passthrough]
$noinherit = true
$ex = <C-x>
<Esc> = :toggle-key-passthrough<Enter>
$ex = <C-x>
<Esc> = :toggle-key-passthrough<Enter>
[compose]
# Keybindings used when the embedded terminal is not selected in the compose
# view
$noinherit = true
$ex = <C-x>
$complete = <C-o>
<C-k> = :prev-field<Enter>
<C-Up> = :prev-field<Enter>
<C-j> = :next-field<Enter>
@ -132,15 +147,15 @@ $ex = <C-x>
[compose::editor]
# Keybindings used when the embedded terminal is selected in the compose view
$noinherit = true
$ex = <C-x>
<C-k> = :prev-field<Enter>
<C-Up> = :prev-field<Enter>
<C-j> = :next-field<Enter>
<C-Down> = :next-field<Enter>
<C-p> = :prev-tab<Enter>
<C-PgUp> = :prev-tab<Enter>
<C-n> = :next-tab<Enter>
<C-PgDn> = :next-tab<Enter>
$ex = <C-x>
<C-k> = :prev-field<Enter>
<C-Up> = :prev-field<Enter>
<C-j> = :next-field<Enter>
<C-Down> = :next-field<Enter>
<C-p> = :prev-tab<Enter>
<C-PgUp> = :prev-tab<Enter>
<C-n> = :next-tab<Enter>
<C-PgDn> = :next-tab<Enter>
[compose::review]
# Keybindings used when reviewing a message to be sent
@ -155,9 +170,9 @@ d = :detach<space>
[terminal]
$noinherit = true
$ex = <C-x>
$ex = <C-x>
<C-p> = :prev-tab<Enter>
<C-n> = :next-tab<Enter>
<C-p> = :prev-tab<Enter>
<C-n> = :next-tab<Enter>
<C-PgUp> = :prev-tab<Enter>
<C-PgDn> = :next-tab<Enter>

View File

@ -1,18 +1,3 @@
#!/bin/bash
feh --bg-fill "$XDG_CONFIG_HOME/wallpapers/mount_cook.jpg" --no-fehbg
NBMON="$(xrandr | grep -cw connected)"
BAT="$(ls /sys/class/power_supply/BAT*/ 2> /dev/null)"
if [ "$NBMON" = 1 ] && [ -n "$BAT" ]; then
stimeout=300 # laptop
else
stimeout=1800 # desktop
fi
cycle=15 # lock 15 sec after stimeout
dpms="$((stimeout + cycle + 1))" # turn off screen 1 sec after lock
xset s "$stimeout" "$cycle"
xset dpms "$dpms" "$dpms" "$dpms"

74
.config/mimeapps.list Normal file
View File

@ -0,0 +1,74 @@
[Default Applications]
# feh
image/bmp=feh.desktop
image/gif=feh.desktop
image/heic=feh.desktop
image/jpeg=feh.desktop
image/jpg=feh.desktop
image/pjpeg=feh.desktop
image/png=feh.desktop
image/tiff=feh.desktop
image/webp=feh.desktop
# firefox
application/xhtml+xml=org.mozilla.firefox.desktop
text/html=org.mozilla.firefox.desktop
text/mml=org.mozilla.firefox.desktop
text/xml=org.mozilla.firefox.desktop
x-scheme-handler/http=org.mozilla.firefox.desktop
x-scheme-handler/https=org.mozilla.firefox.desktop
# mpv
audio/3gpp2=mpv.desktop
audio/3gpp=mpv.desktop
audio/AMR=mpv.desktop
audio/aac=mpv.desktop
audio/ac3=mpv.desktop
audio/aiff=mpv.desktop
audio/amr-wb=mpv.desktop
audio/dv=mpv.desktop
audio/eac3=mpv.desktop
audio/flac=mpv.desktop
audio/m3u=mpv.desktop
audio/m4a=mpv.desktop
audio/mp1=mpv.desktop
audio/mp2=mpv.desktop
audio/mp3=mpv.desktop
audio/mp4=mpv.desktop
audio/mpeg2=mpv.desktop
audio/mpeg3=mpv.desktop
audio/mpeg=mpv.desktop
audio/mpegurl=mpv.desktop
audio/mpg=mpv.desktop
audio/musepack=mpv.desktop
audio/ogg=mpv.desktop
audio/opus=mpv.desktop
audio/rn-mpeg=mpv.desktop
audio/scpls=mpv.desktop
audio/vnd.wave=mpv.desktop
audio/vorbis=mpv.desktop
audio/wav=mpv.desktop
audio/webm=mpv.desktop
video/3gp=mpv.desktop
video/3gpp2=mpv.desktop
video/3gpp=mpv.desktop
video/avi=mpv.desktop
video/divx=mpv.desktop
video/dv=mpv.desktop
video/fli=mpv.desktop
video/flv=mpv.desktop
video/mkv=mpv.desktop
video/mp2t=mpv.desktop
video/mp4=mpv.desktop
video/mp4v-es=mpv.desktop
video/mpeg=mpv.desktop
video/msvideo=mpv.desktop
video/ogg=mpv.desktop
video/quicktime=mpv.desktop
video/webm=mpv.desktop
# pcmanfm
inode/directory=pcmanfm.desktop
# zathura
application/pdf=org.pwmt.zathura-pdf-poppler.desktop

View File

@ -2,7 +2,6 @@
@ Entertainment
https://www.youtube.com/feeds/videos.xml?channel_id=UCI4W-ck8ZLA_YljxMhlpg2g "ChessSimp"
https://www.youtube.com/feeds/videos.xml?channel_id=UCkOSNfdRmKcg4sHHcfrpOcQ "Floydson"
https://www.youtube.com/feeds/videos.xml?channel_id=UCto7D1L-MiRoOziCXK9uT5Q "LetsGameItOut"
https://www.youtube.com/feeds/videos.xml?channel_id=UCRlEFn0L2G_DktbyvN0AZ5A "WadZee"

@ -1 +1 @@
Subproject commit 8aad4396840be7fc42896e3011751b7609ca4119
Subproject commit 5129a3693c482fcbc5ab99a7706ffc4360b995a0

@ -1 +1 @@
Subproject commit 1bb28df3cfc241b961331f00dcb8d5b45fe3e4f0
Subproject commit 7d1698f3d88b448e0639974248cc17f49b7b8acf

@ -1 +1 @@
Subproject commit 30492e7e1c9e5af3642e8a74c2f88dc1f50ec305
Subproject commit dc71d94fe223763d28ab49ee3de4fd7081a84891

View File

@ -219,7 +219,7 @@ backend = "glx";
# Use higher precision during rendering, and apply dither when presenting the
# rendered screen. Reduces banding artifacts, but might cause performance
# degradation. Only works with OpenGL.
#dithered-present = false;
dithered-present = false;
# Enable/disable VSync.
# vsync = false
@ -257,7 +257,7 @@ detect-client-opacity = true;
# to maximize performance for full-screen windows. Known to cause flickering
# when redirecting/unredirecting windows.
#
# unredir-if-possible = false
unredir-if-possible = true
# Delay before unredirecting the window, in milliseconds. Defaults to 0.
# unredir-if-possible-delay = 0

View File

@ -33,6 +33,7 @@ static const Rule rules[] = {
*/
/* class instance title tags mask isfloating monitor */
{ "feh", NULL, NULL, 0, 1, -1 },
{ "zenity", NULL, NULL, 0, 1, -1 },
};
/* layout(s) */
@ -58,21 +59,21 @@ static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn()
static const char *dmenucmd[] = { "dmenu_run", "-i", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
static const char *termcmd[] = { "alacritty", NULL };
static const char *lockcmd[] = { "lock", NULL };
static const char *wwwcmd[] = { "firefox", NULL };
static const char *pwwwcmd[] = { "firefox", "--private-window", NULL };
static const char *wwwcmd[] = { "org.mozilla.firefox", NULL };
static const char *pwwwcmd[] = { "org.mozilla.firefox", "--private-window", NULL };
static const char *calccmd[] = { "alacritty", "-epython", NULL };
static const char *fmcmd[] = { "pcmanfm", NULL };
static const char *prtsccmd[] = { "sh", "-c", "gm import png:- | xclip -sel c -t image/png && xclip -sel c -o | feh -", NULL };
static const char *lvolcmd[] = { "set-vol", "-5", NULL };
static const char *rvolcmd[] = { "set-vol", "+5", NULL };
static const char *mutecmd[] = { "set-vol", "m", NULL };
static const char *lvolcmd[] = { "vol", "-5", NULL };
static const char *rvolcmd[] = { "vol", "+5", NULL };
static const char *mutecmd[] = { "vol", "m", NULL };
static const char *micmutecmd[] = { "wpctl", "set-mute", "@DEFAULT_SOURCE@", "toggle", NULL };
static const char *pausecmd[] = { "playerctl", "play-pause", NULL };
static const char *prevcmd[] = { "playerctl", "previous", NULL };
static const char *nextcmd[] = { "playerctl", "next", NULL };
static const char *stopcmd[] = { "playerctl", "stop", NULL };
static const char *lbrtcmd[] = { "set-light", "-10", NULL };
static const char *rbrtcmd[] = { "set-light", "+10", NULL };
static const char *lbrtcmd[] = { "light", "-10", NULL };
static const char *rbrtcmd[] = { "light", "+10", NULL };
static const char *passselectcmd[] = { "passselect", NULL };
static const char *passopencmd[] = { "passopen", NULL };
static const char *passusercmd[] = { "passuser", NULL };
@ -108,7 +109,6 @@ static const Key keys[] = {
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
{ MODKEY|ShiftMask, XK_z, zoom, {0} },
{ MODKEY, XK_Tab, view, {0} },
{ MODKEY|ShiftMask, XK_c, killclient, {0} },
{ MODKEY, XK_t, setlayout, {.v = &layouts[0] } },
{ MODKEY, XK_m, setlayout, {.v = &layouts[1] } },

File diff suppressed because it is too large Load Diff

View File

@ -1,18 +1,15 @@
# vim: ft=zsh
autoload -U bashcompinit compinit colors
autoload -Uz bashcompinit compinit
zmodload zsh/complist
fpath=("$ZDOTDIR/completions" $fpath)
compinit -d "$XDG_CACHE_HOME/.zcompdump-$ZSH_VERSION"
bashcompinit
colors
. "$ZDOTDIR/powerlevel10k/powerlevel10k.zsh-theme"
. "$ZDOTDIR/.p10k.zsh"
#. "$ZDOTDIR/prompt.zsh"
. "$ZDOTDIR/inputrc.zsh"
. "$ZDOTDIR/theme.zsh"
. "$ZDOTDIR/input.zsh"
. /usr/share/fzf/key-bindings.zsh
for f in "$ZDOTDIR"/aliases/*; do
. "$f"
@ -35,24 +32,4 @@ setopt EXTENDED_HISTORY
setopt EXTENDED_GLOB
export PAGER=less
export LESS_TERMCAP_mb="${fg_bold[red]}"
export LESS_TERMCAP_md="${fg_bold[red]}"
export LESS_TERMCAP_me="${reset_color}"
export LESS_TERMCAP_so="${fg_bold[yellow]}${bg[blue]}"
export LESS_TERMCAP_se="${reset_color}"
export LESS_TERMCAP_us="${fg_bold[green]}"
export LESS_TERMCAP_ue="${reset_color}"
export GROFF_NO_SGR=1
. <(dircolors)
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
WORDCHARS=''
zstyle ':completion:*:*:*:*:*' menu select
zstyle ':completion:*' matcher-list 'r:|=*' 'l:|=* r:|=*'
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
# disable named-directories autocompletion
zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories

View File

@ -3,90 +3,84 @@
alias dk='docker'
## container
alias dkc='docker container'
alias dkcc='docker container create'
alias dkci='docker container inspect'
alias dkcls='docker container ls'
alias dkclsa='docker container ls -a'
alias dkclsaq='docker container ls -a -q'
alias dkclsq='docker container ls -q'
alias dkcrm!='docker container rm -f'
alias dkcrm='docker container rm'
alias dkcsp='docker container stop'
alias dkcst='docker container restart'
alias dkex='docker container exec -i -t'
alias dklo='docker logs -f'
alias dkr='docker run -i -t'
alias dktop='docker top'
alias dkc='docker container' \
dkcc='docker container create' \
dkci='docker container inspect' \
dkcls='docker container ls' \
dkclsa='docker container ls -a' \
dkclsaq='docker container ls -a -q' \
dkclsq='docker container ls -q' \
dkcrm!='docker container rm -f' \
dkcrm='docker container rm' \
dkcsp='docker container stop' \
dkcst='docker container restart' \
dkex='docker container exec -i -t' \
dklo='docker logs -f' \
dkr='docker run -i -t' \
dktop='docker top'
## image
alias dkb='docker build . -t'
alias dki='docker image'
alias dkic='docker image create'
alias dkii='docker image inspect'
alias dkil='docker pull'
function dkila() {
readarray -t IMG \
<<< "$(docker image ls | grep -v localhost | awk '{print $1 ":" $2}')"
docker pull "${IMG[@]}"
}
alias dkils='docker image ls'
alias dkilsa='docker image ls -a'
alias dkilsaq='docker image ls -a -q'
alias dkilsq='docker image ls -q'
alias dkip='docker image push'
alias dkirm!='docker image rm -f'
alias dkirm='docker image rm'
alias dkis='docker image save'
alias dkit='docker image tag'
alias dkb='docker build . -t' \
dki='docker image' \
dkic='docker image create' \
dkii='docker image inspect' \
dkil='docker pull' \
dkils='docker image ls' \
dkilsa='docker image ls -a' \
dkilsaq='docker image ls -a -q' \
dkilsq='docker image ls -q' \
dkip='docker image push' \
dkirm!='docker image rm -f' \
dkirm='docker image rm' \
dkis='docker image save' \
dkit='docker image tag'
## volume
alias dkv='docker volume'
alias dkvc='docker volume create'
alias dkvi='docker volume inspect'
alias dkvls='docker volume ls'
alias dkvlsq='docker volume ls -q'
alias dkvrm!='docker volume rm -f'
alias dkvrm='docker volume rm'
alias dkv='docker volume' \
dkvc='docker volume create' \
dkvi='docker volume inspect' \
dkvls='docker volume ls' \
dkvlsq='docker volume ls -q' \
dkvrm!='docker volume rm -f' \
dkvrm='docker volume rm'
## network
alias dkn='docker network'
alias dknc='docker network create'
alias dkni='docker network inspect'
alias dknls='docker network ls'
alias dknlsq='docker network ls -q'
alias dknrm!='docker network rm -f'
alias dknrm='docker network rm'
alias dkn='docker network' \
dknc='docker network create' \
dkni='docker network inspect' \
dknls='docker network ls' \
dknlsq='docker network ls -q' \
dknrm!='docker network rm -f' \
dknrm='docker network rm'
## system
alias dksys='docker system'
alias dksysdf='docker system df'
alias dksysp!='docker system prune -f'
alias dksysp='docker system prune'
alias dksys='docker system' \
dksysdf='docker system df' \
dksysp!='docker system prune -f' \
dksysp='docker system prune'
# compose
alias dc='docker-compose'
alias dcd='docker-compose down'
alias dcup='docker-compose up'
alias dcupb='docker-compose up --build'
alias dcupd='docker-compose up -d'
alias dcupdb='docker-compose up -d --build'
alias dc='docker-compose' \
dcd='docker-compose down' \
dcup='docker-compose up' \
dcupb='docker-compose up --build' \
dcupd='docker-compose up -d' \
dcupdb='docker-compose up -d --build'
## container
alias dccls='docker-compose ps'
alias dcclsq='docker-compose ps -q'
alias dcex='docker-compose exec'
alias dcr='docker-compose run --rm'
alias dcrd='docker-compose run -d --rm'
alias dcrm!='docker-compose rm -f'
alias dcrm='docker-compose rm'
alias dcrmv!='docker-compose rm -v -f'
alias dcrmv='docker-compose rm -v'
alias dcsp='docker-compose stop'
alias dcst='docker-compose restart'
alias dccls='docker-compose ps' \
dcclsq='docker-compose ps -q' \
dcex='docker-compose exec' \
dcr='docker-compose run --rm' \
dcrd='docker-compose run -d --rm' \
dcrm!='docker-compose rm -f' \
dcrm='docker-compose rm' \
dcrmv!='docker-compose rm -v -f' \
dcrmv='docker-compose rm -v' \
dcsp='docker-compose stop' \
dcst='docker-compose restart'
## image
alias dcb!='docker-compose build --no-cache'
alias dcb='docker-compose build'
alias dcl='docker-compose pull'
alias dcb!='docker-compose build --no-cache' \
dcb='docker-compose build' \
dcl='docker-compose pull'

View File

@ -6,9 +6,11 @@ function update() {
$TERM --hold -e "$SHELL" -ic "config submodule update --remote --recursive && echo -e '\e[32mDONE'" &
}
alias pac='sudo pacman' \
vi='$EDITOR' \
qcp='qcp -o tabsize=4' \
alias pac='sudo pacman'
alias vi='$EDITOR'
alias qcp='qcp -o tabsize=4' \
qmv='qmv -o tabsize=4'
alias config='git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME"' \
@ -21,13 +23,6 @@ alias sudo='sudo ' \
watch='watch -c ' \
xargs='xargs '
function j() {
dests=(**/"$1"*~cvs~node_modules/)
[ -n "${dests[2]}" ] && dests=("$(printf '%s\n' "${dests[@]}" | fzf)")
cd "${dests[1]}"
}
function tmp() {
cd "$(mktemp -d --tmpdir "$1"XXX)"
}
@ -48,8 +43,9 @@ alias ls='ls --color=auto' \
l='ll -a' \
la='ll -A'
alias diff='diff --color'
alias diff='diff --color' \
grep='grep --color --exclude-dir={.bzr,.cache,.git,.hg,.idea,.svn,.tox,.venv,.vscode,CVS,node_modules}'
alias grep='grep --color --exclude-dir={.bzr,.cache,.git,.hg,.idea,.svn,.tox,.venv,.vscode,CVS,node_modules}'
alias feh='feh --auto-zoom --scale-down'
alias xmr='monero-wallet-cli --daemon-address monero.maby.dev:18081 --wallet-file /home/ange/.config/monero/ange --trusted-daemon --log-file=/tmp/monero-wallet-cli.log'

View File

@ -20,76 +20,76 @@ function grename() {
fi
}
alias ggpur='ggu'
alias g='git'
alias ga='git add'
alias gaa='git add --all'
alias gapa='git add --patch'
alias gau='git add --update'
alias gav='git add --verbose'
alias gam='git am'
alias gama='git am --abort'
alias gamc='git am --continue'
alias gamscp='git am --show-current-patch'
alias gams='git am --skip'
alias gap='git apply'
alias gapt='git apply --3way'
alias gbs='git bisect'
alias gbsb='git bisect bad'
alias gbsg='git bisect good'
alias gbsn='git bisect new'
alias gbso='git bisect old'
alias gbsr='git bisect reset'
alias gbss='git bisect start'
alias gbl='git blame -w'
alias gb='git branch'
alias gba='git branch --all'
alias gbd='git branch --delete'
alias gbD='git branch --delete --force'
alias ggpur='ggu' \
g='git' \
ga='git add' \
gaa='git add --all' \
gapa='git add --patch' \
gau='git add --update' \
gav='git add --verbose' \
gam='git am' \
gama='git am --abort' \
gamc='git am --continue' \
gamscp='git am --show-current-patch' \
gams='git am --skip' \
gap='git apply' \
gapt='git apply --3way' \
gbs='git bisect' \
gbsb='git bisect bad' \
gbsg='git bisect good' \
gbsn='git bisect new' \
gbso='git bisect old' \
gbsr='git bisect reset' \
gbss='git bisect start' \
gbl='git blame -w' \
gb='git branch' \
gba='git branch --all' \
gbd='git branch --delete' \
gbD='git branch --delete --force'
alias gbgd='LANG=C git branch --no-color -vv | grep ": gone\]" | awk '"'"'{print $1}'"'"' | xargs git branch -d'
alias gbgD='LANG=C git branch --no-color -vv | grep ": gone\]" | awk '"'"'{print $1}'"'"' | xargs git branch -D'
alias gbm='git branch --move'
alias gbnm='git branch --no-merged'
alias gbr='git branch --remote'
alias ggsup='git branch --set-upstream-to=origin/$(current_branch)'
alias gbg='LANG=C git branch -vv | grep ": gone\]"'
alias gco='git checkout'
alias gcor='git checkout --recurse-submodules'
alias gcb='git checkout -b'
alias gcp='git cherry-pick'
alias gcpa='git cherry-pick --abort'
alias gcpc='git cherry-pick --continue'
alias gclean='git clean --interactive -d'
alias gcl='git clone --recurse-submodules'
alias gbgd='LANG=C git branch --no-color -vv | grep ": gone\]" | awk '"'"'{print $1}'"'"' | xargs git branch -d' \
gbgD='LANG=C git branch --no-color -vv | grep ": gone\]" | awk '"'"'{print $1}'"'"' | xargs git branch -D' \
gbm='git branch --move' \
gbnm='git branch --no-merged' \
gbr='git branch --remote' \
ggsup='git branch --set-upstream-to=origin/$(current_branch)' \
gbg='LANG=C git branch -vv | grep ": gone\]"' \
gco='git checkout' \
gcor='git checkout --recurse-submodules' \
gcb='git checkout -b' \
gcp='git cherry-pick' \
gcpa='git cherry-pick --abort' \
gcpc='git cherry-pick --continue' \
gclean='git clean --interactive -d' \
gcl='git clone --recurse-submodules'
function gccd() {
gcl "$@" && cd "$(basename "$_")"
}
compdef _git gccd=git-clone
alias gcam='git commit --all --message'
alias gcas='git commit --all --signoff'
alias gcasm='git commit --all --signoff --message'
alias gcs='git commit --gpg-sign'
alias gcss='git commit --gpg-sign --signoff'
alias gcssm='git commit --gpg-sign --signoff --message'
alias gcmsg='git commit --message'
alias gcsm='git commit --signoff --message'
alias gc='git commit --verbose'
alias gca='git commit --verbose --all'
alias gca!='git commit --verbose --all --amend'
alias gcan!='git commit --verbose --all --no-edit --amend'
alias gcans!='git commit --verbose --all --signoff --no-edit --amend'
alias gc!='git commit --verbose --amend'
alias gcn!='git commit --verbose --no-edit --amend'
alias gcf='git config --list'
alias gdct='git describe --tags $(git rev-list --tags --max-count=1)'
alias gd='git diff'
alias gdca='git diff --cached'
alias gdcw='git diff --cached --word-diff'
alias gds='git diff --staged'
alias gdw='git diff --word-diff'
alias gcam='git commit --all --message' \
gcas='git commit --all --signoff' \
gcasm='git commit --all --signoff --message' \
gcs='git commit --gpg-sign' \
gcss='git commit --gpg-sign --signoff' \
gcssm='git commit --gpg-sign --signoff --message' \
gcmsg='git commit --message' \
gcsm='git commit --signoff --message' \
gc='git commit --verbose' \
gca='git commit --verbose --all' \
gca!='git commit --verbose --all --amend' \
gcan!='git commit --verbose --all --no-edit --amend' \
gcans!='git commit --verbose --all --signoff --no-edit --amend' \
gc!='git commit --verbose --amend' \
gcn!='git commit --verbose --no-edit --amend' \
gcf='git config --list' \
gdct='git describe --tags $(git rev-list --tags --max-count=1)' \
gd='git diff' \
gdca='git diff --cached' \
gdcw='git diff --cached --word-diff' \
gds='git diff --staged' \
gdw='git diff --word-diff'
function gdv() {
git diff -w "$@" | view -
@ -98,25 +98,25 @@ compdef _git gdv=git-diff
alias gdup='git diff @{upstream}'
alias gdt='git diff-tree --no-commit-id --name-only -r'
alias gf='git fetch'
alias gdt='git diff-tree --no-commit-id --name-only -r' \
gf='git fetch'
# --jobs=<n> was added in git 2.8
alias gfa='git fetch --all --prune --jobs=10'
alias gfo='git fetch origin'
alias gg='git gui citool'
alias gga='git gui citool --amend'
alias ghh='git help'
alias glgg='git log --graph'
alias glgga='git log --graph --decorate --all'
alias glgm='git log --graph --max-count=10'
alias glods='git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset" --date=short'
alias glod='git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset"'
alias glola='git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset" --all'
alias glols='git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset" --stat'
alias glol='git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset"'
alias glo='git log --oneline --decorate'
alias glog='git log --oneline --decorate --graph'
alias gloga='git log --oneline --decorate --graph --all'
alias gfa='git fetch --all --prune --jobs=10' \
gfo='git fetch origin' \
gg='git gui citool' \
gga='git gui citool --amend' \
ghh='git help' \
glgg='git log --graph' \
glgga='git log --graph --decorate --all' \
glgm='git log --graph --max-count=10' \
glods='git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset" --date=short' \
glod='git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset"' \
glola='git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset" --all' \
glols='git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset" --stat' \
glol='git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset"' \
glo='git log --oneline --decorate' \
glog='git log --oneline --decorate --graph' \
gloga='git log --oneline --decorate --graph --all'
# Pretty log messages
function _git_log_prettily() {
@ -126,22 +126,22 @@ function _git_log_prettily() {
}
compdef _git _git_log_prettily=git-log
alias glp='_git_log_prettily'
alias glg='git log --stat'
alias glgp='git log --stat --patch'
alias gignored='git ls-files -v | grep "^[[:lower:]]"'
alias gfg='git ls-files | grep'
alias gmr='git merge'
alias gmra='git merge --abort'
alias gmrs="git merge --squash"
alias gmrtl='git mergetool --no-prompt'
alias gmrtlvim='git mergetool --no-prompt --tool=vimdiff'
alias glp='_git_log_prettily' \
glg='git log --stat' \
glgp='git log --stat --patch' \
gignored='git ls-files -v | grep "^[[:lower:]]"' \
gfg='git ls-files | grep' \
gmr='git merge' \
gmra='git merge --abort' \
gmrs="git merge --squash" \
gmrtl='git mergetool --no-prompt' \
gmrtlvim='git mergetool --no-prompt --tool=vimdiff'
alias gl='git pull'
alias gpr='git pull --rebase'
alias gprv='git pull --rebase -v'
alias gpra='git pull --rebase --autostash'
alias gprav='git pull --rebase --autostash -v'
alias gl='git pull' \
gpr='git pull --rebase' \
gprv='git pull --rebase -v' \
gpra='git pull --rebase --autostash' \
gprav='git pull --rebase --autostash -v'
function ggu() {
[[ "$#" != 1 ]] && local b="$(current_branch)"
@ -161,9 +161,9 @@ function ggl() {
}
compdef _git ggl=git-checkout
alias gluc='git pull upstream $(current_branch)'
alias gp='git push'
alias gpd='git push --dry-run'
alias gluc='git pull upstream $(current_branch)' \
gp='git push' \
gpd='git push --dry-run'
function ggf() {
[[ "$#" != 1 ]] && local b="$(current_branch)"
@ -171,8 +171,8 @@ function ggf() {
}
compdef _git ggf=git-checkout
alias gpf!='git push --force'
alias gpf='git push --force-with-lease --force-if-includes'
alias gpf!='git push --force' \
gpf='git push --force-with-lease --force-if-includes'
function ggfl() {
[[ "$#" != 1 ]] && local b="$(current_branch)"
@ -180,68 +180,68 @@ function ggfl() {
}
compdef _git ggfl=git-checkout
alias gpsup='git push --set-upstream origin $(current_branch)'
alias gpsupf='git push --set-upstream origin $(current_branch) --force-with-lease --force-if-includes'
alias gpv='git push --verbose'
alias gpoat='git push origin --all && git push origin --tags'
alias gpod='git push origin --delete'
alias ggpush='git push origin "$(current_branch)"'
alias gpu='git push upstream'
alias grb='git rebase'
alias grba='git rebase --abort'
alias grbc='git rebase --continue'
alias grbi='git rebase --interactive'
alias grbo='git rebase --onto'
alias grbs='git rebase --skip'
alias gr='git remote'
alias grv='git remote --verbose'
alias gra='git remote add'
alias grrm='git remote remove'
alias grmv='git remote rename'
alias grset='git remote set-url'
alias grup='git remote update'
alias grh='git reset'
alias gru='git reset --'
alias grhh='git reset --hard'
alias grhk='git reset --keep'
alias grhs='git reset --soft'
alias gpristine='git reset --hard && git clean --force -dfx'
alias groh='git reset origin/$(current_branch) --hard'
alias grs='git restore'
alias grss='git restore --source'
alias grst='git restore --staged'
alias grev='git revert'
alias grm='git rm'
alias grmc='git rm --cached'
alias grt='cd "$(git rev-parse --show-toplevel || echo .)"'
alias gcount='git shortlog --summary --numbered'
alias gsh='git show'
alias gsps='git show --pretty=short --show-signature'
alias gstall='git stash --all'
alias gstaa='git stash apply'
alias gstc='git stash clear'
alias gstd='git stash drop'
alias gstl='git stash list'
alias gstp='git stash pop'
alias gsta='git stash push'
alias gsts='git stash show --patch'
alias gst='git status'
alias gss='git status --short'
alias gsb='git status --short --branch'
alias gsi='git submodule init'
alias gsu='git submodule update'
alias gsw='git switch'
alias gswc='git switch --create'
alias gta='git tag --annotate'
alias gts='git tag --sign'
alias gtv='git tag | sort -V'
alias gignore='git update-index --assume-unchanged'
alias gunignore='git update-index --no-assume-unchanged'
alias gwch='git whatchanged -p --abbrev-commit --pretty=medium'
alias gwt='git worktree'
alias gwta='git worktree add'
alias gwtls='git worktree list'
alias gwtmv='git worktree move'
alias gwtrm='git worktree remove'
alias gstu='gsta --include-untracked'
alias gtl='gtl(){ git tag --sort=-v:refname -n --list "${1}*" }; noglob gtl'
alias gpsup='git push --set-upstream origin $(current_branch)' \
gpsupf='git push --set-upstream origin $(current_branch) --force-with-lease --force-if-includes' \
gpv='git push --verbose' \
gpoat='git push origin --all && git push origin --tags' \
gpod='git push origin --delete' \
ggpush='git push origin "$(current_branch)"' \
gpu='git push upstream' \
grb='git rebase' \
grba='git rebase --abort' \
grbc='git rebase --continue' \
grbi='git rebase --interactive' \
grbo='git rebase --onto' \
grbs='git rebase --skip' \
gr='git remote' \
grv='git remote --verbose' \
gra='git remote add' \
grrm='git remote remove' \
grmv='git remote rename' \
grset='git remote set-url' \
grup='git remote update' \
grh='git reset' \
gru='git reset --' \
grhh='git reset --hard' \
grhk='git reset --keep' \
grhs='git reset --soft' \
gpristine='git reset --hard && git clean --force -dfx' \
groh='git reset origin/$(current_branch) --hard' \
grs='git restore' \
grss='git restore --source' \
grst='git restore --staged' \
grev='git revert' \
grm='git rm' \
grmc='git rm --cached' \
grt='cd "$(git rev-parse --show-toplevel || echo .)"' \
gcount='git shortlog --summary --numbered' \
gsh='git show' \
gsps='git show --pretty=short --show-signature' \
gstall='git stash --all' \
gstaa='git stash apply' \
gstc='git stash clear' \
gstd='git stash drop' \
gstl='git stash list' \
gstp='git stash pop' \
gsta='git stash push' \
gsts='git stash show --patch' \
gst='git status' \
gss='git status --short' \
gsb='git status --short --branch' \
gsi='git submodule init' \
gsu='git submodule update' \
gsw='git switch' \
gswc='git switch --create' \
gta='git tag --annotate' \
gts='git tag --sign' \
gtv='git tag | sort -V' \
gignore='git update-index --assume-unchanged' \
gunignore='git update-index --no-assume-unchanged' \
gwch='git whatchanged -p --abbrev-commit --pretty=medium' \
gwt='git worktree' \
gwta='git worktree add' \
gwtls='git worktree list' \
gwtmv='git worktree move' \
gwtrm='git worktree remove' \
gstu='gsta --include-untracked' \
gtl='gtl(){ git tag --sort=-v:refname -n --list "${1}*" }; noglob gtl'

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

93
.config/zsh/input.zsh Normal file
View File

@ -0,0 +1,93 @@
function zle-line-init() {
echoti smkx
}
function zle-line-finish() {
echoti rmkx
}
zle -N zle-line-init
zle -N zle-line-finish
# Use emacs key bindings
bindkey -e
# [PageUp] - Up a line of history
bindkey -M emacs "${terminfo[kpp]}" up-line-or-history
bindkey -M viins "${terminfo[kpp]}" up-line-or-history
bindkey -M vicmd "${terminfo[kpp]}" up-line-or-history
# [PageDown] - Down a line of history
bindkey -M emacs "${terminfo[knp]}" down-line-or-history
bindkey -M viins "${terminfo[knp]}" down-line-or-history
bindkey -M vicmd "${terminfo[knp]}" down-line-or-history
# Start typing + [Up-Arrow] - fuzzy find history forward
autoload -Uz up-line-or-beginning-search
zle -N up-line-or-beginning-search
bindkey -M emacs "${terminfo[kcuu1]}" up-line-or-beginning-search
bindkey -M viins "${terminfo[kcuu1]}" up-line-or-beginning-search
bindkey -M vicmd "${terminfo[kcuu1]}" up-line-or-beginning-search
# Start typing + [Down-Arrow] - fuzzy find history backward
autoload -Uz down-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey -M emacs "${terminfo[kcud1]}" down-line-or-beginning-search
bindkey -M viins "${terminfo[kcud1]}" down-line-or-beginning-search
bindkey -M vicmd "${terminfo[kcud1]}" down-line-or-beginning-search
# [Home] - Go to beginning of line
bindkey -M emacs "${terminfo[khome]}" beginning-of-line
bindkey -M viins "${terminfo[khome]}" beginning-of-line
bindkey -M vicmd "${terminfo[khome]}" beginning-of-line
# [End] - Go to end of line
bindkey -M emacs "${terminfo[kend]}" end-of-line
bindkey -M viins "${terminfo[kend]}" end-of-line
bindkey -M vicmd "${terminfo[kend]}" end-of-line
# [Shift-Tab] - move through the completion menu backwards
bindkey -M emacs "${terminfo[kcbt]}" reverse-menu-complete
bindkey -M viins "${terminfo[kcbt]}" reverse-menu-complete
bindkey -M vicmd "${terminfo[kcbt]}" reverse-menu-complete
# [Backspace] - delete backward
bindkey -M emacs '^?' backward-delete-char
bindkey -M viins '^?' backward-delete-char
bindkey -M vicmd '^?' backward-delete-char
# [Delete] - delete forward
bindkey -M emacs "${terminfo[kdch1]}" delete-char
bindkey -M viins "${terminfo[kdch1]}" delete-char
bindkey -M vicmd "${terminfo[kdch1]}" delete-char
# [Ctrl-Delete] - delete whole forward-word
bindkey -M emacs '^[[3;5~' kill-word
bindkey -M viins '^[[3;5~' kill-word
bindkey -M vicmd '^[[3;5~' kill-word
# [Ctrl-RightArrow] - move forward one word
bindkey -M emacs '^[[1;5C' forward-word
bindkey -M viins '^[[1;5C' forward-word
bindkey -M vicmd '^[[1;5C' forward-word
# [Ctrl-LeftArrow] - move backward one word
bindkey -M emacs '^[[1;5D' backward-word
bindkey -M viins '^[[1;5D' backward-word
bindkey -M vicmd '^[[1;5D' backward-word
bindkey ' ' magic-space # [Space] - don't do history expansion
# file rename magick
bindkey "^[m" copy-prev-shell-word
bindkey -v
# allow vv to edit the command line (standard behaviour)
autoload -Uz edit-command-line
zle -N edit-command-line
bindkey -M vicmd 'vv' edit-command-line
# allow ctrl-p, ctrl-n for navigate history (standard behaviour)
bindkey '^P' up-history
bindkey '^N' down-history
# allow ctrl-h, ctrl-w, ctrl-? for char and word deletion (standard behaviour)
bindkey '^?' backward-delete-char
bindkey '^h' backward-delete-char
bindkey '^w' backward-kill-word

View File

@ -1,313 +0,0 @@
# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html
# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Zle-Builtins
# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Standard-Widgets
# Make sure that the terminal is in application mode when zle is active, since
# only then values from $terminfo are valid
if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
function zle-line-init() {
echoti smkx
}
function zle-line-finish() {
echoti rmkx
}
zle -N zle-line-init
zle -N zle-line-finish
fi
# Use emacs key bindings
bindkey -e
# [PageUp] - Up a line of history
if [[ -n "${terminfo[kpp]}" ]]; then
bindkey -M emacs "${terminfo[kpp]}" up-line-or-history
bindkey -M viins "${terminfo[kpp]}" up-line-or-history
bindkey -M vicmd "${terminfo[kpp]}" up-line-or-history
fi
# [PageDown] - Down a line of history
if [[ -n "${terminfo[knp]}" ]]; then
bindkey -M emacs "${terminfo[knp]}" down-line-or-history
bindkey -M viins "${terminfo[knp]}" down-line-or-history
bindkey -M vicmd "${terminfo[knp]}" down-line-or-history
fi
# Start typing + [Up-Arrow] - fuzzy find history forward
if [[ -n "${terminfo[kcuu1]}" ]]; then
autoload -U up-line-or-beginning-search
zle -N up-line-or-beginning-search
bindkey -M emacs "${terminfo[kcuu1]}" up-line-or-beginning-search
bindkey -M viins "${terminfo[kcuu1]}" up-line-or-beginning-search
bindkey -M vicmd "${terminfo[kcuu1]}" up-line-or-beginning-search
fi
# Start typing + [Down-Arrow] - fuzzy find history backward
if [[ -n "${terminfo[kcud1]}" ]]; then
autoload -U down-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey -M emacs "${terminfo[kcud1]}" down-line-or-beginning-search
bindkey -M viins "${terminfo[kcud1]}" down-line-or-beginning-search
bindkey -M vicmd "${terminfo[kcud1]}" down-line-or-beginning-search
fi
# [Home] - Go to beginning of line
if [[ -n "${terminfo[khome]}" ]]; then
bindkey -M emacs "${terminfo[khome]}" beginning-of-line
bindkey -M viins "${terminfo[khome]}" beginning-of-line
bindkey -M vicmd "${terminfo[khome]}" beginning-of-line
fi
# [End] - Go to end of line
if [[ -n "${terminfo[kend]}" ]]; then
bindkey -M emacs "${terminfo[kend]}" end-of-line
bindkey -M viins "${terminfo[kend]}" end-of-line
bindkey -M vicmd "${terminfo[kend]}" end-of-line
fi
# [Shift-Tab] - move through the completion menu backwards
if [[ -n "${terminfo[kcbt]}" ]]; then
bindkey -M emacs "${terminfo[kcbt]}" reverse-menu-complete
bindkey -M viins "${terminfo[kcbt]}" reverse-menu-complete
bindkey -M vicmd "${terminfo[kcbt]}" reverse-menu-complete
fi
# [Backspace] - delete backward
bindkey -M emacs '^?' backward-delete-char
bindkey -M viins '^?' backward-delete-char
bindkey -M vicmd '^?' backward-delete-char
# [Delete] - delete forward
if [[ -n "${terminfo[kdch1]}" ]]; then
bindkey -M emacs "${terminfo[kdch1]}" delete-char
bindkey -M viins "${terminfo[kdch1]}" delete-char
bindkey -M vicmd "${terminfo[kdch1]}" delete-char
else
bindkey -M emacs "^[[3~" delete-char
bindkey -M viins "^[[3~" delete-char
bindkey -M vicmd "^[[3~" delete-char
bindkey -M emacs "^[3;5~" delete-char
bindkey -M viins "^[3;5~" delete-char
bindkey -M vicmd "^[3;5~" delete-char
fi
# [Ctrl-Delete] - delete whole forward-word
bindkey -M emacs '^[[3;5~' kill-word
bindkey -M viins '^[[3;5~' kill-word
bindkey -M vicmd '^[[3;5~' kill-word
# [Ctrl-RightArrow] - move forward one word
bindkey -M emacs '^[[1;5C' forward-word
bindkey -M viins '^[[1;5C' forward-word
bindkey -M vicmd '^[[1;5C' forward-word
# [Ctrl-LeftArrow] - move backward one word
bindkey -M emacs '^[[1;5D' backward-word
bindkey -M viins '^[[1;5D' backward-word
bindkey -M vicmd '^[[1;5D' backward-word
bindkey '\ew' kill-region # [Esc-w] - Kill from the cursor to the mark
bindkey -s '\el' 'ls\n' # [Esc-l] - run command: ls
bindkey '^r' history-incremental-search-backward # [Ctrl-r] - Search backward incrementally for a specified string. The string may begin with ^ to anchor the search to the beginning of the line.
bindkey ' ' magic-space # [Space] - don't do history expansion
# Edit the current command line in $EDITOR
autoload -U edit-command-line
zle -N edit-command-line
bindkey '\C-x\C-e' edit-command-line
# file rename magick
bindkey "^[m" copy-prev-shell-word
# consider emacs keybindings:
#bindkey -e ## emacs key bindings
#
#bindkey '^[[A' up-line-or-search
#bindkey '^[[B' down-line-or-search
#bindkey '^[^[[C' emacs-forward-word
#bindkey '^[^[[D' emacs-backward-word
#
#bindkey -s '^X^Z' '%-^M'
#bindkey '^[e' expand-cmd-path
#bindkey '^[^I' reverse-menu-complete
#bindkey '^X^N' accept-and-infer-next-history
#bindkey '^W' kill-region
#bindkey '^I' complete-word
## Fix weird sequence that rxvt produces
#bindkey -s '^[[Z' '\t'
#
# Control whether to force a redraw on each mode change.
#
# Resetting the prompt on every mode change can cause lag when switching modes.
# This is especially true if the prompt does things like checking git status.
#
# Set to "true" to force the prompt to reset on each mode change.
# Unset or set to any other value to do the opposite.
#
# The default is not to reset, unless we're showing the mode in RPS1.
typeset -g VI_MODE_RESET_PROMPT_ON_MODE_CHANGE
# Control whether to change the cursor style on mode change.
#
# Set to "true" to change the cursor on each mode change.
# Unset or set to any other value to do the opposite.
typeset -g VI_MODE_SET_CURSOR
# Control how the cursor appears in the various vim modes. This only applies
# if $VI_MODE_SET_CURSOR=true.
#
# See https://vt100.net/docs/vt510-rm/DECSCUSR for cursor styles
typeset -g VI_MODE_CURSOR_NORMAL=2
typeset -g VI_MODE_CURSOR_VISUAL=6
typeset -g VI_MODE_CURSOR_INSERT=6
typeset -g VI_MODE_CURSOR_OPPEND=0
typeset -g VI_KEYMAP=main
function _vi-mode-set-cursor-shape-for-keymap() {
[[ "$VI_MODE_SET_CURSOR" = true ]] || return
# https://vt100.net/docs/vt510-rm/DECSCUSR
local _shape=0
case "${1:-${VI_KEYMAP:-main}}" in
main) _shape=$VI_MODE_CURSOR_INSERT ;; # vi insert: line
viins) _shape=$VI_MODE_CURSOR_INSERT ;; # vi insert: line
isearch) _shape=$VI_MODE_CURSOR_INSERT ;; # inc search: line
command) _shape=$VI_MODE_CURSOR_INSERT ;; # read a command name
vicmd) _shape=$VI_MODE_CURSOR_NORMAL ;; # vi cmd: block
visual) _shape=$VI_MODE_CURSOR_VISUAL ;; # vi visual mode: block
viopp) _shape=$VI_MODE_CURSOR_OPPEND ;; # vi operation pending: blinking block
*) _shape=0 ;;
esac
printf $'\e[%d q' "${_shape}"
}
function _visual-mode {
typeset -g VI_KEYMAP=visual
_vi-mode-set-cursor-shape-for-keymap "$VI_KEYMAP"
zle .visual-mode
}
zle -N visual-mode _visual-mode
function _vi-mode-should-reset-prompt() {
# If $VI_MODE_RESET_PROMPT_ON_MODE_CHANGE is unset (default), dynamically
# check whether we're using the prompt to display vi-mode info
if [[ -z "${VI_MODE_RESET_PROMPT_ON_MODE_CHANGE:-}" ]]; then
[[ "${PS1} ${RPS1}" = *'$(vi_mode_prompt_info)'* ]]
return $?
fi
# If $VI_MODE_RESET_PROMPT_ON_MODE_CHANGE was manually set, let's check
# if it was specifically set to true or it was disabled with any other value
[[ "${VI_MODE_RESET_PROMPT_ON_MODE_CHANGE}" = true ]]
}
# Updates editor information when the keymap changes.
function zle-keymap-select() {
# update keymap variable for the prompt
typeset -g VI_KEYMAP=$KEYMAP
if _vi-mode-should-reset-prompt; then
zle reset-prompt
zle -R
fi
_vi-mode-set-cursor-shape-for-keymap "${VI_KEYMAP}"
}
zle -N zle-keymap-select
# These "echoti" statements were originally set in lib/key-bindings.zsh
# Not sure the best way to extend without overriding.
function zle-line-init() {
local prev_vi_keymap="${VI_KEYMAP:-}"
typeset -g VI_KEYMAP=main
[[ "$prev_vi_keymap" != 'main' ]] && _vi-mode-should-reset-prompt && zle reset-prompt
(( ! ${+terminfo[smkx]} )) || echoti smkx
_vi-mode-set-cursor-shape-for-keymap "${VI_KEYMAP}"
}
zle -N zle-line-init
function zle-line-finish() {
typeset -g VI_KEYMAP=main
(( ! ${+terminfo[rmkx]} )) || echoti rmkx
_vi-mode-set-cursor-shape-for-keymap default
}
zle -N zle-line-finish
bindkey -v
# allow vv to edit the command line (standard behaviour)
autoload -Uz edit-command-line
zle -N edit-command-line
bindkey -M vicmd 'vv' edit-command-line
# allow ctrl-p, ctrl-n for navigate history (standard behaviour)
bindkey '^P' up-history
bindkey '^N' down-history
# allow ctrl-h, ctrl-w, ctrl-? for char and word deletion (standard behaviour)
bindkey '^?' backward-delete-char
bindkey '^h' backward-delete-char
bindkey '^w' backward-kill-word
# allow ctrl-r and ctrl-s to search the history
bindkey '^r' history-incremental-search-backward
bindkey '^s' history-incremental-search-forward
# allow ctrl-a and ctrl-e to move to beginning/end of line
bindkey '^a' beginning-of-line
bindkey '^e' end-of-line
function wrap_clipboard_widgets() {
# NB: Assume we are the first wrapper and that we only wrap native widgets
# See zsh-autosuggestions.zsh for a more generic and more robust wrapper
local verb="$1"
shift
local widget
local wrapped_name
for widget in "$@"; do
wrapped_name="_zsh-vi-${verb}-${widget}"
if [ "${verb}" = copy ]; then
eval "
function ${wrapped_name}() {
zle .${widget}
printf %s \"\${CUTBUFFER}\" | clipcopy 2>/dev/null || true
}
"
else
eval "
function ${wrapped_name}() {
CUTBUFFER=\"\$(clippaste 2>/dev/null || echo \$CUTBUFFER)\"
zle .${widget}
}
"
fi
zle -N "${widget}" "${wrapped_name}"
done
}
wrap_clipboard_widgets copy \
vi-yank vi-yank-eol vi-yank-whole-line \
vi-change vi-change-eol vi-change-whole-line \
vi-kill-line vi-kill-eol vi-backward-kill-word \
vi-delete vi-delete-char vi-backward-delete-char
wrap_clipboard_widgets paste \
vi-put-{before,after} \
put-replace-selection
unfunction wrap_clipboard_widgets
# if mode indicator wasn't setup by theme, define default, we'll leave INSERT_MODE_INDICATOR empty by default
if [[ -z "$MODE_INDICATOR" ]]; then
MODE_INDICATOR='%B%F{red}<%b<<%f'
fi
function vi_mode_prompt_info() {
echo "${${VI_KEYMAP/vicmd/$MODE_INDICATOR}/(main|viins)/$INSERT_MODE_INDICATOR}"
}
# define right prompt, if it wasn't defined by a theme
if [[ -z "$RPS1" && -z "$RPROMPT" ]]; then
RPS1='$(vi_mode_prompt_info)'
fi

@ -1 +0,0 @@
Subproject commit da9b03777c4f2390c7e3f5c720ee4689336f811b

View File

@ -1,47 +0,0 @@
# LEFT
# dir vcs command_execution_time status
# RIGHT
# background_jobs virtualenv kubecontext
autoload -Uz vcs_info
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:git*' formats '%b (%a) %m%u%c'
function preexec() {
_timer_start="$SECONDS"
}
function _get_time() {
local d="$((SECONDS - _timer_start))"
local text
text="$((d % 60))s"
if [ "$d" -gt 60 ]; then
text="$((d % 60))m$text"
(( d /= 60 ))
fi
if [ "$d" -gt 60 ]; then
text="${d}h$text"
fi
echo "$text"
}
function precmd() {
local err
IFS='|' err="${pipestatus[*]}"
timer="$((SECONDS - _timer_start))"
vcs_info
PROMPT='%~ '
[ -n "$vcs_info_msg_0_" ] && PROMPT="$PROMPT$vcs_info_msg_0_ "
[ "$timer" -ge 2 ] && PROMPT="$PROMPT$(_get_time) "
[ "$err" != 0 ] && PROMPT="$PROMPT$err "
RPROMPT='%(1j.%j.)'
false && RPROMPT="$RPROMPT virtualenv"
false && RPROMPT="$RPROMPT kubecontext"
}

66
.config/zsh/theme.zsh Normal file
View File

@ -0,0 +1,66 @@
autoload -Uz vcs_info colors && colors
export LESS_TERMCAP_mb="${fg_bold[red]}"
export LESS_TERMCAP_md="${fg_bold[red]}"
export LESS_TERMCAP_me="$reset_color"
export LESS_TERMCAP_so="${fg_bold[yellow]}${bg[blue]}"
export LESS_TERMCAP_se="$reset_color"
export LESS_TERMCAP_us="${fg_bold[green]}"
export LESS_TERMCAP_ue="$reset_color"
. <(dircolors)
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
zstyle ':completion:*:*:*:*:*' menu select
zstyle ':completion:*' matcher-list 'r:|=*' 'l:|=* r:|=*'
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' stagedstr ' %{%F{178}%}+%{%f%b%}'
zstyle ':vcs_info:*' unstagedstr ' %{%F{178}%}*%{%f%b%}'
#zstyle ':vcs_info:*' untrackedstr ' %{%F{39}%}?%{%f%b%}'
zstyle ':vcs_info:git:*' formats '%{%F{76}%}%b%{%f%}%c%u '
zstyle ':vcs_info:git:*' actionformats '%{%F{76}%}%b%{%f%}|%{%F{196}%}%a%{%f%}%c%u '
function preexec() {
_timer_start="$SECONDS"
}
function _get_time() {
local d="$1"
local text
text="$((d % 60))s"
if [ "$d" -gt 60 ]; then
(( d /= 60 ))
text="$((d % 60))m$text"
if [ "$d" -gt 60 ]; then
text="${d}h$text"
fi
fi
echo "$text"
}
function precmd() {
IFS='|' local timer ctx err="${pipestatus[*]}"
[ "$_timer_start" -gt 0 ] && timer="$((SECONDS - _timer_start))"
_timer_start=-1
ctx="$(kubectx -c)"
vcs_info
PROMPT=''
[ -n "$ctx" ] && PROMPT+="%{%F{134}%}$ctx/$(kubens -c)%{%f%b%} "
PROMPT+='%{%B%F{32}%}%~%{%f%b%} '
PROMPT+="$vcs_info_msg_0_"
[ "$timer" -ge 2 ] && PROMPT+="%{%F{101}%}$(_get_time "$timer")%{%f%b%} "
[[ "$err" =~ [1-9] ]] && PROMPT+="%{%F{160}%}${err[*]}%{%f%b%} "
RPROMPT=''
RPROMPT+=' %{%F{71}%}%(1j.%j.)%{%f%b%}'
[ -n "$VIRTUAL_ENV" ] && RPROMPT+=" %{%F{37}%}${VIRTUAL_ENV:h:t}%{%f%b%}"
}

3
.gitmodules vendored
View File

@ -10,6 +10,3 @@
[submodule ".config/nvim/pack/plugins/opt/treesitter"]
path = .config/nvim/pack/plugins/opt/treesitter
url = https://github.com/nvim-treesitter/nvim-treesitter.git
[submodule ".config/zsh/powerlevel10k"]
path = .config/zsh/powerlevel10k
url = https://github.com/romkatv/powerlevel10k.git

View File

@ -14,4 +14,7 @@ picom &
gammastep &
sbar &
xset s 600 15
xset dpms 616 616 616
exec dwm

View File

@ -28,8 +28,9 @@ path=(
$path
)
export BROWSER=firefox
export BROWSER=org.mozilla.firefox
export EDITOR=nvim
export VISUAL=nvim
export PAGER=less
export MAKEFLAGS='-j'

View File

@ -5,5 +5,4 @@
sleep 3
for _ in {0..1023}; do
xdotool mousemove_relative 8 0
#ydotool mousemove -x 8 -y 0
done

View File

@ -11,7 +11,7 @@ function update_cpu() {
}
function update_memory() {
memory=" $(free -h | awk '/^Mem:/ {print $3}')"
memory=" $(free -h | awk '/^Mem:/{print $3}')"
}
function update_bat() {
@ -53,14 +53,14 @@ function update_source_vol() {
}
function update_wlp() {
local sig ssid
local sig ssid dev=wlan0
sig="$(awk '/^wlp/ {print int($3)}' /proc/net/wireless)"
sig="$(awk "/$dev/{print int(\$3)}" /proc/net/wireless)"
if [ -z "$sig" ]; then
wlp='⚠'
return
fi
ssid="$(nmcli device wifi show-password | sed -n 's/^SSID:\s*//p')"
ssid="$(networkctl status "$dev" | grep -Po 'Wi-Fi access point:\s*\K\w+')"
{ [ "$sig" -gt 56 ] && wlp="▂▄▆█ $ssid"; } ||
{ [ "$sig" -gt 38 ] && wlp="▂▄▆_ $ssid"; } ||
{ [ "$sig" -gt 21 ] && wlp="▂▄__ $ssid"; } ||
@ -83,8 +83,9 @@ else
fi
# SIGNALING
# trap '<function>;display' 'RTMIN+n'
trap 'update_sink_vol;display' 'RTMIN'
# trap '<function>;display;wait' 'RTMIN+n'
trap 'update_sink_vol;display;wait' 'RTMIN'
trap 'update_wlp;display;wait' 'RTMIN+1'
# to update it from external commands
## kill -m "$(cat ~/.cache/pidofbar)"
# where m = 34 + n
@ -107,5 +108,5 @@ while true; do
}
sec="$((sec + 10))"
}
awk '@load "time"; BEGIN {d=10; s=system("date \"+%S.%N\""); sleep(d - s % d)}' &
awk "@load \"time\"; BEGIN {d=10; s=$(date '+%S.%N'); sleep(d - s % d)}" &
done

13
bin/wlp Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash -e
iwctl=(iwctl station wlan0)
"${iwctl[@]}" show | grep -q 'Scanning\s\+yes' || "${iwctl[@]}" scan
for _ in {0..29}; do
if "${iwctl[@]}" show | grep -q '\s*State\s\+connected\s*$'; then
kill -35 "$(cat "$HOME/.cache/pidofbar")"
exit 0
fi
sleep 1
done