dotfiles/zsh/.zshrc
Oliver Davies 73e76b4d97 feat: add tmux-sessioner script
Add a script for quickly navigating between directories using fzf and
tmux sessions. Executable within zsh and Vim.
2021-09-17 19:42:11 +01:00

40 lines
851 B
Bash

# Enable extended globbing for use in _load_settings()
setopt extendedglob
# extra files in ~/.zsh/configs/pre , ~/.zsh/configs , and ~/.zsh/configs/post
# these are loaded first, second, and third, respectively.
_load_settings() {
_dir="$1"
if [ -d "$_dir" ]; then
if [ -d "$_dir/pre" ]; then
for config in "$_dir"/pre/**/*~*.zwc(N-.); do
. $config
done
fi
for config in "$_dir"/**/*(N-.); do
case "$config" in
"$_dir"/(pre|post)/*|*.zwc)
:
;;
*)
. $config
;;
esac
done
if [ -d "$_dir/post" ]; then
for config in "$_dir"/post/**/*~*.zwc(N-.); do
. $config
done
fi
fi
}
_load_settings "$HOME/.zsh/configs"
bindkey -s "^f" "tmux-sessioniser\n"
# Local config
[[ -f ~/.zshrc.local ]] && source ~/.zshrc.local