Move zsh setup back into separate files for ohmyzsh custom

This commit is contained in:
Evie Litherland-Smith 2023-02-09 16:26:31 +00:00
parent e7ceb24455
commit b01daaceaa
4 changed files with 14 additions and 31 deletions

View file

@ -1,3 +1,8 @@
# Connect to TMUX if not login shell and not already connected
if [[ $- =~ i ]] && [[ -z "$TMUX" ]]; then
tmux new -A -s main
fi
# 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.
@ -83,29 +88,5 @@ source $ZSH/oh-my-zsh.sh
export EDITOR="nvim"
export VISUAL="nvim"
LOCAL_BIN="$HOME/.local/bin"
echo $PATH | grep -i "$LOCAL_BIN" - > /dev/null || export PATH=$PATH:$LOCAL_BIN
vim ()
{
poetry env info > /dev/null 2>&1 && poetry run nvim $@ || nvim $@
}
alias nvimdiff="nvim -d"
alias lg="lazygit"
command -v yadm > /dev/null && {
alias yvi="yadm enter nvim"
alias ylg="yadm enter lazygit"
alias yss="yadm status"
}
[ "$TERM" = "xterm-kitty" ] && alias ssh="kitty +kitten ssh"
autoload -U bashcompinit
bashcompinit
command -v pipx > /dev/null && {
command -v register-python-argcomplete3 > /dev/null && eval "$(register-python-argcomplete3 pipx)"
command -v register-python-argcomplete > /dev/null && eval "$(register-python-argcomplete pipx)"
}
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

View file

@ -1,4 +1,7 @@
vim ()
{
poetry env info > /dev/null 2>&1 && poetry run nvim $@ || nvim $@
}
alias nvimdiff="nvim -d"
alias pvim="poetry run nvim"
alias lg="lazygit"
[ "$TERM" = "xterm-kitty" ] && alias ssh="kitty +kitten ssh"

View file

@ -1,4 +1,6 @@
autoload -U bashcompinit
bashcompinit
command -v pipx > /dev/null && {
command -v register-python-argcomplete3 > /dev/null && eval "$(register-python-argcomplete3 pipx)"
command -v register-python-argcomplete > /dev/null && eval "$(register-python-argcomplete pipx)"
}

View file

@ -2,6 +2,3 @@
LOCAL_BIN="$HOME/.local/bin"
echo $PATH | grep -i "$LOCAL_BIN" - > /dev/null || export PATH=$PATH:$LOCAL_BIN
DOTFILES_BIN="$(dirname $(dirname $(readlink -f $0)))/bin"
echo $PATH | grep -i "$DOTFILES_BIN" - > /dev/null || export PATH=$PATH:$DOTFILES_BIN