feat(zsh): add p10k to repo and add some aliases and scripts

This commit is contained in:
Matej Janezic 2023-10-06 14:49:46 +02:00
parent 4040342a3c
commit 27a4e03a65
Signed by: janezicmatej
SSH Key Fingerprint: SHA256:3vE2ixAKI8uRNhob5xDwoa9mMPUsxsM4QRHNcPuMHew
5 changed files with 1741 additions and 10 deletions

1
.gitignore vendored
View File

@ -20,6 +20,7 @@ zsh/*
!zsh/scripts.zsh
!zsh/aliases.zsh
!zsh/completions/.keep
!zsh/.p10k.zsh
# tmux
!tmux

1697
zsh/.p10k.zsh Normal file

File diff suppressed because it is too large Load Diff

View File

@ -9,15 +9,8 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# completion
fpath=($ZDOTDIR/completions $fpath)
autoload -Uz compinit
compinit -d $XDG_CACHE_HOME/zsh/zcompdump-$ZSH_VERSION
zstyle ':completion:*' cache-path $XDG_CACHE_HOME/zsh/zcompcache
# pre plugin load
export NVM_COMPLETION=true
export NVM_AUTO_USE=true
# load antigen
typeset -a ANTIGEN_CHECK_FILES=(${ZDOTDIR:-~}/.zshrc ${ZDOTDIR:-~}/antigen.zsh)
@ -28,7 +21,6 @@ antigen use oh-my-zsh
antigen bundle git
# zsh users plugin
antigen bundle zsh-users/zsh-syntax-highlighting
antigen bundle zsh-users/zsh-autosuggestions
# other
@ -54,8 +46,14 @@ export GPG_TTY=$(tty)
source "$ZDOTDIR/aliases.zsh"
source "$ZDOTDIR/scripts.zsh"
# completion
fpath=($ZDOTDIR/completions $fpath)
autoload -Uz compinit
compinit -d $XDG_CACHE_HOME/zsh/zcompdump-$ZSH_VERSION
zstyle ':completion:*' cache-path $XDG_CACHE_HOME/zsh/zcompcache
# opam configuration
[[ ! -r /Users/janezicmatej/.opam/opam-init/init.zsh ]] || source /Users/janezicmatej/.opam/opam-init/init.zsh > /dev/null 2> /dev/null
# [[ ! -r /Users/janezicmatej/.opam/opam-init/init.zsh ]] || source /Users/janezicmatej/.opam/opam-init/init.zsh > /dev/null 2> /dev/null
# To customize prompt, run `p10k configure` or edit ~/.config/zsh/.p10k.zsh.
[[ ! -f ~/.config/zsh/.p10k.zsh ]] || source ~/.config/zsh/.p10k.zsh

View File

@ -1,7 +1,8 @@
alias s="ssh"
alias z="exec zsh"
alias t="tmux a || tmux new-session -s janezicmatej -c ~"
alias n=nvim_ve
alias vim=nvim_ve
# alias vim=nvim_ve
# navigation
alias cdgit="cd $GGROOT"

View File

@ -89,3 +89,37 @@ function dps {
fi
}
function get_dump {
if [[ -z $1 ]]; then
echo "provide ssh host"
return
fi
if [[ -z $2 ]]; then
echo "provide dump destination"
return
fi
selected=$(ssh "$1" docker ps --filter image=postgres:* --format "{{.Names}}" | fzf)
if [[ -z $selected ]]; then
return
fi
ssh "$1" docker exec "$selected" pg_dump -U db --format=c db > "$2$(date +'%Y-%m-%dT%H.%M.%S%z')"
}
function ggcompile {
find -L $GGROOT -mindepth 1 -maxdepth 5 -type d -name .git -prune | xargs -n 1 dirname > "$GGROOT/compiled"
}
function tssh {
if [[ -z $1 ]]; then
echo "provide ssh host"
return
fi
ssh -t "$@" "command -v tmux && (tmux a || tmux new-session -s gorazd -c ~) || bash"
}