Files
dotfiles/dot-conf/.zshrc
2023-11-15 23:40:00 -03:00

96 lines
2.7 KiB
Bash

# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
setopt appendhistory
export EDITOR=lvim
# asdf
. "$HOME/.asdf/asdf.sh"
fpath=(${ASDF_DIR}/completions $fpath)
autoload -Uz compinit && compinit
# bindkeys
bindkey "^[[1;5C" forward-word
bindkey "^[[1;5D" backward-word
bindkey "^H" backward-kill-word
bindkey "5~" kill-word
bindkey "^[[H" beginning-of-line
bindkey "^[[F" end-of-line
bindkey "^[[3~" delete-char
autoload -U select-word-style
select-word-style bash
# aliases
alias ll="exa --icons -la"
alias ls="ll"
alias cat="bat --style=auto"
alias docs="cd /mnt/e/Windows/Documents"
alias rld="source ${HOME}/.zshrc"
alias zshrc="lvim ${HOME}/.zshrc && rld"
alias tm="tmux"
alias tmf="tmuxifier"
alias tmn="tmuxinator"
alias d="docker"
alias dc="docker compose"
alias k="kubectl"
alias mk="minikube"
alias gits="git status"
alias gpr="git pull --rebase"
alias gck="git checkout"
alias gc="git commit"
alias zj="zellij"
# command aliases
alias zjtelebot="zj --layout telebot.kdl -s telebot"
alias zjgallerydl="zj --layout gallery-dl.kdl -s gallery-dl"
# paths
export PATH=${PATH}:${HOME}/.local/bin
export PATH=${PATH}:${HOME}/repos/personal-devboot/scripts/shell
export PATH="$HOME/.tmuxifier/bin:$PATH"
export PATH="/mnt/e/Programs/streamlink-6.3.1-1-py311-x86/bin:$PATH"
# docker
# https://gbbigardi.medium.com/wsl-2-arch-docker-e-um-pouco-mais-do-meu-ambiente-de-desenvolvimento-42adc48368d4
dockerStart() {
DOCKER_DISTRO="Arch"
DOCKER_DIR=/mnt/wsl/shared-docker
DOCKER_SOCK="$DOCKER_DIR/docker.sock"
export DOCKER_HOST="unix://$DOCKER_SOCK"
if [ ! -S "$DOCKER_SOCK" ]; then
mkdir -pm o=,ug=rwx "$DOCKER_DIR"
chgrp docker "$DOCKER_DIR"
/mnt/c/Windows/System32/wsl.exe -d $DOCKER_DISTRO sh -c "nohup sudo -b dockerd < /dev/null > $DOCKER_DIR/dockerd.log 2>&1"
fi
}
k8sStart() {
export KUBECONFIG=~/.kube/config
}
k8sStart
eval "$(tmuxifier init -)"
eval "$(zoxide init zsh)"
if [ $(ps ax | grep "[s]sh-agent" | wc -l) -eq 0 ] ; then
eval $(ssh-agent -s) > /dev/null
if [ "$(ssh-add -l)" = "The agent has no identities." ] ; then
ssh-add ~/.ssh/id_ed25519_cloud@CloudPC > /dev/null 2>&1
fi
fi