dotfiles/zsh/zshrc

80 lines
2.3 KiB
Bash

setopt extendedglob nomatch notify histnofunctions histnostore histverify incappendhistory autopushd pushdignoredups
unsetopt beep
if [[ -f /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh ]];
then
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
fi
bindkey -v
# allow ctrl-a and ctrl-e to move to beginning/end of line
bindkey '^a' beginning-of-line
bindkey '^e' end-of-line
if [[ $(uname) == 'Darwin' ]]; then
if [[ $(arch) == 'arm64' ]]; then
path+=('/opt/homebrew/bin')
else
path+=('/usr/local/bin')
fi
fi
fpath=(~/bin ~/.zshcompletions $fpath)
zstyle :compinstall filename '/home/anthonys/.zshrc'
export CARAPACE_BRIDGES='zsh,fish,bash
zstyle ':completion:*' format $'\e[2;37mCompleting %d\e[m'
# Both because it's nice and as an example
zstyle ':completion:*:git:*' group-order 'main commands' 'alias commands' 'external commands'
# zsh-vi-mode stuff
ZVM_VI_SURROUND_BINDKEY="s-prefix"
ZVM_READKEY_ENDINE=$ZVM_READKEY_ENGINE_NEX
ZVM_INSERT_MODE_CURSOR=$ZVM_CURSOR_BLOCK
ZVM_LINE_INIT_MODE=$ZVM_MODE_INSERT
function zvm_after_lazy_keybindings() {
eval "$(/nix/store/imgh8mjpck0xadj64h9q4gqrjaj9pbn7-atuin-18.3.0/bin/atuin init zsh )"
}
# zstyle ":completion:*" complete _complete _ignored _approximate _expand
# zstyle ":completion:*" glob 1
# zstyle ":completion:*" insert-unambiguous true
# zstyle ':completion:*' menu select
# zstyle ':completion:*' rehash true
# zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'l:|=* r:|=*'
# zstyle ":completion:*" substitute 1
[[ -n "$key[Up]" ]] && bindkey -- "$key[Up]" up-line-or-beginning-search
[[ -n "$key[Down]" ]] && bindkey -- "$key[Down]" down-line-or-beginning-search
path=("$HOME/bin" "$HOME/go/bin" $path)
if [[ -d ~/.cargo/bin ]]; then
path=($path $HOME/.cargo/bin)
fi
function dt() {
local session_name=${1:-DefaultSession}
zellij attach -c $session_name
}
function root() {
if [[ -n $(git rev-parse --show-toplevel) ]]
then
cd "$(git rev-parse --show-toplevel)"
fi
}
if [[ -a $HOME/.zshsrc ]]; then
source $HOME/.zshsrc
else
printf "No zshsrc\nOne has been created\n"
touch $HOME/.zshsrc
fi
alias exa="eza -l --git"
for funcfile in $HOME/.zsh.d/* ; do
source "${funcfile}"
done