dotfiles/.zshrc

70 lines
2.4 KiB
Bash

# vim: set filetype=sh nospell :
#
# Clone antidote ( https://antidote.sh )
[[ -d ${ZDOTDIR:-~}/.antidote ]] ||
git clone --depth=1 https://github.com/mattmc3/antidote.git ${ZDOTDIR:-~}/.antidote
# source antidote
source ${ZDOTDIR:-~}/.antidote/antidote.zsh
zstyle ':antidote:bundle' use-friendly-names 'yes'
antidote load
plugins+=(fzf)
## zoxide stuff - zoxide is a better cd utility
eval "$(zoxide init zsh)"
## starship
eval "$(starship init zsh)"
## FZF extras
[[ -e "$HOME/.fzf-extras/fzf-extras.sh" ]] &&
source "$HOME/.fzf-extras/fzf-extras.sh"
# This function is automatically called by zsh-vi-mode plugin
# Set keybindings here so that they aren't overridden by zsh-vi-mode
function zvm_after_init() {
# set vi mode
bindkey -v
# set ctrl-p and ctrl-n for vi insert mode
bindkey -v '^P' history-substring-search-up #up-history
bindkey -v '^N' history-substring-search-down #down-history
# mattmc3/zephyr path:plugins/editor
bindkey '^Z' symmetric-ctrl-z
bindkey '^S' prepend-sudo
# Alt+Enter
# To make shift+enter work in zsh we map Shift+Enter to Alt+Enter in kitty.
# There are autocommands in Neovim that set a user variable in kitty when we are in Neovim and unsets it when we exit.
# This allows us to unmap Shift+Enter in kitty when inside Neovim.
# By doing this we can use Shift+Enter for `forward-word`, which is autosuggest partial accept
# in the autosuggest plugin in zsh, without interfering with the mapping in nvim.
bindkey '^[^M' forward-word
# bindkey '^R' fzf-history-widget
# [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# Source skim keybindings. Skim repo is cloned into stow directory
# so we can use stow to install the man page. The stow binary still has
# to be installed seperately.
source "$STOW_DIR/skim/shell/key-bindings.zsh"
}
# Source anything in .zshrc.d.
for _rc in ${ZDOTDIR:-$HOME}/.zshrc.d/*.zsh; do
# Ignore tilde files.
if [[ $_rc:t != '~'* ]]; then
source "$_rc"
fi
done
unset _rc
export NVM_DIR="$HOME/.config/nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# 'try' utility (https://github.com/tobi/try)
# creates/manages directories for experiments
eval "$(~/.local/bin/try.rb init ~/projects/tries)"