Verified Commit fe53f169 authored by Leeward Bound's avatar Leeward Bound 💼

initial commit

parents
antigen use oh-my-zsh
antigen bundle zsh-users/zsh-syntax-highlighting
antigen bundle zsh-users/zsh-history-substring-search
antigen bundle zsh-users/zsh-autosuggestions
antigen theme skylerlee/zeta-zsh-theme
antigen apply
This diff is collapsed.
[[ -s /usr/share/autojump/autojump.zsh ]] && . /usr/share/autojump/autojump.zsh
# makes color constants available
autoload -U colors
colors
# enable colored output from ls, etc. on FreeBSD-based systems
export CLICOLOR=1
which direnv &> /dev/null && eval "$(direnv hook zsh)"
export VISUAL=vim
export EDITOR=$VISUAL
setopt hist_ignore_all_dups inc_append_history
HISTFILE=~/.zhistory
HISTSIZE=4096
SAVEHIST=4096
export ERL_AFLAGS="-kernel shell_history enabled"
# vi mode
bindkey -v
bindkey "^?" backward-delete-char
bindkey "^[[3~" delete-char
bindkey "^[3;5~" delete-char
bindkey '^[[H' beginning-of-line
bindkey '^^[[H' backward-word
bindkey '^[[F' end-of-line
bindkey '^^[[F' forward-word
bindkey '^[[5~' up-line-or-history
bindkey '^[[6~' down-line-or-history
bindkey "^r" history-incremental-search-backward
bindkey "^[[A" history-search-backward #up and down use search
bindkey "^[[B" history-search-forward #up and down use search
bindkey ' ' magic-space # also do history expansion on space
bindkey '^I' complete-word # complete on tab, leave expansion to _expand
# Add home directory bin folder
export PATH="./bin:./node_modules/.bin:$HOME/.local/bin:$HOME/.config/bin:$PATH"
# load our own completion functions
fpath=(~/.zsh/completion /usr/local/share/zsh/site-functions $fpath)
# completion; use cache if updated within 24h
autoload -Uz compinit
if [[ -n $HOME/.zcompdump(#qN.mh+24) ]]; then
compinit -d $HOME/.zcompdump;
else
compinit -C;
fi;
# disable zsh bundled function mtools command mcd
# which causes a conflict.
compdef -d mcd
# ensure dotfiles bin directory is loaded first
PATH="$HOME/.bin:/usr/local/sbin:$PATH"
# modify the prompt to contain git branch name if applicable
git_prompt_info() {
current_branch=$(git rev-parse --abbrev-ref HEAD 2> /dev/null)
if [[ -n $current_branch ]]; then
echo "%{$fg_bold[green]%}$current_branch %{$reset_color%}"
fi
}
setopt promptsubst
# Allow exported PS1 variable to override default prompt.
if ! env | grep -q '^PS1='; then
PS1='${SSH_CONNECTION+"%{$fg_bold[green]%}%n@%m:"}%{$fg_bold[blue]%}>%{$reset_color%} '
fi
export GPG_TTY="$(tty)"
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
gpgconf --launch gpg-agent
gs() {
git status $*
}
gc() {
git commit $*
}
up() {
cd ..
}
zrcs () {
cd ~/salt/base/leeward/Dotfiles/.zsh/
}
# load custom executable functions
source ~/.zsh/antigen.zsh
export ANTIGEN_CACHE=~/.cache/antigen
antigen init ~/.zsh/.antigenrc
# TODO these need to be moved to the actual keybinds config file
bindkey -v
bindkey "$terminfo[kcuu1]" history-substring-search-up
bindkey "$terminfo[kcud1]" history-substring-search-down
bindkey -M vicmd 'k' history-substring-search-up
bindkey -M vicmd 'j' history-substring-search-down
for function in ~/.zsh/functions/*; do
source $function
done
# 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/config"
# Local config
[[ -f ~/.zshrc.local ]] && echo $blue "Loading ~/.zshrc.local..." && source ~/.zshrc.local
# aliases
[[ -f ~/.aliases ]] && source ~/.aliases
requires_environment:
- user
- home
- uid
- fullname
- shell
- ssh_key
base:
'*':
- zshell
$USER:
user.present:
- shell: $SHELL
# Apps
direnv: pkg.installed
autojump: pkg.installed
htop: pkg.installed
tmux: pkg.installed
jq: pkg.installed
$HOME/.zshrc:
file.managed:
- makedirs: true
- source: salt://$PROJECT/.zshrc
- user: $UID
- group: $UID
$HOME/.zsh:
file.recurse:
- source: salt://$PROJECT/.zsh
- user: $UID
- group: $UID
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment