152 lines
3.9 KiB
Bash
152 lines
3.9 KiB
Bash
HISTFILE=~/.histfile
|
|
HISTSIZE=10000
|
|
SAVEHIST=10000
|
|
setopt extendedglob nomatch notify histignorespace histignorealldups histnofunctions histnostore histverify incappendhistory autopushd pushdignoredups
|
|
unsetopt autocd beep
|
|
|
|
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
|
|
export RPROMPT=' ' # Fixes a side-effect of the vi-mode oh-my-zsh plugin
|
|
|
|
export KEYTIMEOUT=1
|
|
|
|
typeset -U path
|
|
typeset -U fpath
|
|
|
|
hash -d -- -dotfiles=~/.dotfiles
|
|
|
|
fpath=(~/bin ~/.zshcompletions $fpath)
|
|
zstyle :compinstall filename '/home/anthonys/.zshrc'
|
|
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
|
|
|
|
autoload zmv
|
|
|
|
autoload -Uz up-line-or-beginning-search down-line-or-beginning-search
|
|
zle -N up-line-or-beginning-search
|
|
zle -N down-line-or-beginning-search
|
|
|
|
[[ -n "$key[Up]" ]] && bindkey -- "$key[Up]" up-line-or-beginning-search
|
|
[[ -n "$key[Down]" ]] && bindkey -- "$key[Down]" down-line-or-beginning-search
|
|
|
|
|
|
export COMPLETION_WAITING_DOTS="true"
|
|
export VISUAL='emacsclient -c -a=""'
|
|
export EDITOR='editn'
|
|
path=("$HOME/bin" "$HOME/go/bin" $path)
|
|
|
|
zstyle ':znap:*' auto-compile no
|
|
local ZSH_PLUGIN_DIR="$HOME/.zsh_plugins"
|
|
if [[ ! -d "${ZSH_PLUGIN_DIR}/zsh-snap" ]]; then
|
|
mkdir -p ~/.zsh_plugins
|
|
cd ~/.zsh_plugins
|
|
git clone https://github.com/marlonrichert/zsh-snap.git
|
|
fi
|
|
zstyle ':znap:*' plugins-dir "${ZSH_PLUGIN_DIR}"
|
|
|
|
source "${ZSH_PLUGIN_DIR}/zsh-snap/znap.zsh" && export ZNAP_USED=1
|
|
local -a paths
|
|
for line in "${(@f)"$(<~/.zsh_plugins.txt)"}"
|
|
{
|
|
if [[ ! -d "${ZSH_PLUGIN_DIR}/$(basename $line)" ]]; then
|
|
paths=($paths $line)
|
|
fi
|
|
}
|
|
|
|
if [[ ! ${#paths[@]} -eq 0 ]]; then
|
|
echo "Paths not empty: $paths"
|
|
znap clone ${^paths}
|
|
fi
|
|
|
|
if [[ ( $ZNAP_USED = 1 ) ]]; then
|
|
znap source oh-my-zsh lib/{git,completion}
|
|
fpath=($fpath ~[oh-my-zsh]/plugins/{pass,ripgrep,cargo,docker,docker-compose,rsync,fd})
|
|
znap source zsh-syntax-highlighting
|
|
fpath=($fpath ~[zsh-completions]/src)
|
|
znap source zsh-vimode-visual
|
|
fi
|
|
|
|
if [[ -d ~/.cargo/bin ]]; then
|
|
path=($HOME/.cargo/bin $path)
|
|
fi
|
|
|
|
autoload -Uz promptinit
|
|
promptinit
|
|
|
|
if [[ $(whence -p starship 2> /dev/null) ]]; then
|
|
znap eval starship-init "starship init zsh --print-full-init"
|
|
else
|
|
if [[ ( $ZNAP_USED = 1 ) ]]; then
|
|
znap clone https://github.com/denysdovhan/spaceship-prompt
|
|
znap prompt spaceship-prompt
|
|
fi
|
|
fi
|
|
|
|
autoload -Uz compinit
|
|
compinit
|
|
|
|
znap source oh-my-zsh plugins/{gitignore,git,helm,mvn,gradle}
|
|
|
|
alias exa="exa -l --git"
|
|
if [[ $(uname -s) =~ 'Linux' ]]; then
|
|
alias cp="cp --reflink=auto"
|
|
fi
|
|
|
|
function dt() {
|
|
local session_name
|
|
session_name=${1:-DefaultSession}
|
|
|
|
tmux -u -2 new-session -A -s $session_name
|
|
}
|
|
|
|
function send-to-pane() {
|
|
tmux pipe-pane -I -t $1 "$2 | head -n 1"
|
|
}
|
|
|
|
function _send_to_pane {
|
|
reply=($(tmux display-panes -b ''))
|
|
}
|
|
compctl -K _send_to_pane send-to-pane
|
|
|
|
function root() {
|
|
if [[ -n $(git rev-parse --show-toplevel) ]]
|
|
then
|
|
cd "$(git rev-parse --show-toplevel)"
|
|
fi
|
|
}
|
|
|
|
|
|
if [[ -d $HOME/.anyenv ]]; then
|
|
path+=($HOME/.anyenv/bin)
|
|
if [[ ( $ZNAP_USED = 1 ) ]]; then
|
|
znap eval anyenv-init 'anyenv init -'
|
|
else
|
|
eval "$(anyenv init -)"
|
|
fi
|
|
fi
|
|
|
|
path+=($(yarn global bin))
|
|
export PATH
|
|
|
|
##THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
|
|
export SDKMAN_DIR="$HOME/.sdkman"
|
|
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && znap eval sdkman-init "cat $HOME/.sdkman/bin/sdkman-init.sh; echo \"echo \"SDKMAN: $SDKMAN_VERSION\"\""
|
|
|
|
if [[ -a $HOME/.zshsrc ]]; then
|
|
source $HOME/.zshsrc
|
|
else
|
|
printf "No zshsrc\nOne has been created\n"
|
|
touch $HOME/.zshsrc
|
|
fi
|
|
|
|
for funcfile in $HOME/.zsh.d/* ; do
|
|
source "${funcfile}"
|
|
done
|
|
|