This commit is contained in:
Anthony Cicchetti 2020-11-23 14:15:38 -05:00
parent 2674c48c59
commit 51f353162e
3 changed files with 23 additions and 31 deletions

View file

@ -1,27 +1,10 @@
# ____ ____ #!/usr/bin/env zsh
# / __/___ / __/ if zmodload zsh/parameter 2>/dev/null && (( ${+options} )); then
# / /_/_ / / /_
# / __/ / /_/ __/
# /_/ /___/_/ key-bindings.zsh
#
# - $SKIM_TMUX_OPTS
# - $SKIM_CTRL_T_COMMAND
# - $SKIM_CTRL_T_OPTS
# - $SKIM_CTRL_R_OPTS
# - $SKIM_ALT_C_COMMAND
# - $SKIM_ALT_C_OPTS
# Key bindings
# ------------
# The code at the top and the bottom of this file is the same as in completion.zsh.
# Refer to that file for explanation.
if 'zmodload' 'zsh/parameter' 2>'/dev/null' && (( ${+options} )); then
__skim_key_bindings_options="options=(${(j: :)${(kv)options[@]}})" __skim_key_bindings_options="options=(${(j: :)${(kv)options[@]}})"
else else
() { () {
__skim_key_bindings_options="setopt" __skim_key_bindings_options="setopt"
'local' '__skim_opt' local __skim_opt
for __skim_opt in "${(@)${(@f)$(set -o)}%% *}"; do for __skim_opt in "${(@)${(@f)$(set -o)}%% *}"; do
if [[ -o "$__skim_opt" ]]; then if [[ -o "$__skim_opt" ]]; then
__skim_key_bindings_options+=" -o $__skim_opt" __skim_key_bindings_options+=" -o $__skim_opt"
@ -32,7 +15,7 @@ else
} }
fi fi
'emulate' 'zsh' '-o' 'no_aliases' emulate zsh -o no_aliases
{ {

View file

@ -2,3 +2,4 @@ https://github.com/ohmyzsh/oh-my-zsh
https://github.com/zsh-users/zsh-syntax-highlighting https://github.com/zsh-users/zsh-syntax-highlighting
https://github.com/zsh-users/zsh-completions https://github.com/zsh-users/zsh-completions
https://github.com/ress997/zsh-completions-anyenv https://github.com/ress997/zsh-completions-anyenv
https://github.com/b4b4r07/zsh-vimode-visual

View file

@ -3,8 +3,13 @@ HISTSIZE=10000
SAVEHIST=10000 SAVEHIST=10000
setopt extendedglob nomatch notify histignorespace histignorealldups histnofunctions histnostore histverify incappendhistory autopushd pushdignoredups setopt extendedglob nomatch notify histignorespace histignorealldups histnofunctions histnostore histverify incappendhistory autopushd pushdignoredups
unsetopt autocd beep unsetopt autocd beep
bindkey -v 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 RPROMPT=' ' # Fixes a side-effect of the vi-mode oh-my-zsh plugin
export KEYTIMEOUT=1 export KEYTIMEOUT=1
typeset -U path typeset -U path
@ -31,10 +36,11 @@ zle -N down-line-or-beginning-search
export COMPLETION_WAITING_DOTS="true" export COMPLETION_WAITING_DOTS="true"
export VISUAL='nvim' export VISUAL='vim'
export EDITOR='nvim' export EDITOR='vim'
path=("$HOME/bin" "$HOME/go/bin" $path) path=("$HOME/bin" "$HOME/go/bin" $path)
zstyle ':znap:*' auto-compile no
local ZSH_PLUGIN_DIR="$HOME/.zsh_plugins" local ZSH_PLUGIN_DIR="$HOME/.zsh_plugins"
if [[ ! -d "${ZSH_PLUGIN_DIR}/zsh-snap" ]]; then if [[ ! -d "${ZSH_PLUGIN_DIR}/zsh-snap" ]]; then
mkdir -p ~/.zsh_plugins mkdir -p ~/.zsh_plugins
@ -44,7 +50,6 @@ fi
zstyle ':znap:*' plugins-dir "${ZSH_PLUGIN_DIR}" zstyle ':znap:*' plugins-dir "${ZSH_PLUGIN_DIR}"
source "${ZSH_PLUGIN_DIR}/zsh-snap/znap.zsh" && export ZNAP_USED=1 source "${ZSH_PLUGIN_DIR}/zsh-snap/znap.zsh" && export ZNAP_USED=1
zstyle ':znap:*' auto-compile no
local -a paths local -a paths
for line in "${(@f)"$(<~/.zsh_plugins.txt)"}" for line in "${(@f)"$(<~/.zsh_plugins.txt)"}"
{ {
@ -60,21 +65,24 @@ fi
if [[ ( $ZNAP_USED = 1 ) ]]; then if [[ ( $ZNAP_USED = 1 ) ]]; then
znap source oh-my-zsh lib/{git,completion} znap source oh-my-zsh lib/{git,completion}
znap source oh-my-zsh plugins/vi-mode
fpath=($fpath "$(znap path oh-my-zsh)/plugins/pass") fpath=($fpath "$(znap path oh-my-zsh)/plugins/pass")
fpath=($fpath "$(znap path oh-my-zsh)/plugins/ripgrep") fpath=($fpath "$(znap path oh-my-zsh)/plugins/ripgrep")
fpath=($fpath "$(znap path oh-my-zsh)/plugins/cargo") fpath=($fpath "$(znap path oh-my-zsh)/plugins/cargo")
znap source zsh-syntax-highlighting znap source zsh-syntax-highlighting
znap source zsh-completions znap source zsh-completions
znap source zsh-completions-anyenv znap source zsh-completions-anyenv
znap source zsh-vimode-visual
fi fi
if [[ -d ~/.cargo/bin ]]; then if [[ -d ~/.cargo/bin ]]; then
path=($HOME/.cargo/bin $path) path=($HOME/.cargo/bin $path)
fi fi
autoload -Uz promptinit
promptinit
if [[ $(whence -p starship 2> /dev/null) ]]; then if [[ $(whence -p starship 2> /dev/null) ]]; then
eval "$(starship init zsh)" znap eval starship-init "cat ~/.zsh.d/adds/starship.zsh"
else else
if [[ ( $ZNAP_USED = 1 ) ]]; then if [[ ( $ZNAP_USED = 1 ) ]]; then
znap clone https://github.com/denysdovhan/spaceship-prompt znap clone https://github.com/denysdovhan/spaceship-prompt
@ -82,8 +90,7 @@ else
znap prompt spaceship-prompt znap prompt spaceship-prompt
fi fi
autoload -Uz compinit promptinit autoload -Uz compinit
promptinit
compinit compinit
znap source oh-my-zsh plugins/gitignore znap source oh-my-zsh plugins/gitignore
@ -125,7 +132,7 @@ function nv() {
function vim() { function vim() {
if [[ $(whence -p nvim 2> /dev/null) ]]; then if [[ $(whence -p nvim 2> /dev/null) ]]; then
nv ${@} nvim ${@}
else else
/usr/bin/vim ${@} /usr/bin/vim ${@}
fi fi
@ -150,9 +157,9 @@ fi
path+=($(yarn global bin)) path+=($(yarn global bin))
export PATH export PATH
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! ##THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="$HOME/.sdkman" export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh" [[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && znap eval sdkman-init "cat $HOME/.sdkman/bin/sdkman-init.sh"
if [[ -a $HOME/.zshsrc ]]; then if [[ -a $HOME/.zshsrc ]]; then
source $HOME/.zshsrc source $HOME/.zshsrc
@ -164,3 +171,4 @@ fi
for funcfile in $HOME/.zsh.d/* ; do for funcfile in $HOME/.zsh.d/* ; do
source "${funcfile}" source "${funcfile}"
done done