diff --git a/zsh/funcs/sk_bindings.zsh b/zsh/funcs/sk_bindings similarity index 86% rename from zsh/funcs/sk_bindings.zsh rename to zsh/funcs/sk_bindings index 4ed3fdc..db1ea89 100644 --- a/zsh/funcs/sk_bindings.zsh +++ b/zsh/funcs/sk_bindings @@ -1,27 +1,10 @@ -# ____ ____ -# / __/___ / __/ -# / /_/_ / / /_ -# / __/ / /_/ __/ -# /_/ /___/_/ 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 +#!/usr/bin/env zsh +if zmodload zsh/parameter 2>/dev/null && (( ${+options} )); then __skim_key_bindings_options="options=(${(j: :)${(kv)options[@]}})" else () { __skim_key_bindings_options="setopt" - 'local' '__skim_opt' + local __skim_opt for __skim_opt in "${(@)${(@f)$(set -o)}%% *}"; do if [[ -o "$__skim_opt" ]]; then __skim_key_bindings_options+=" -o $__skim_opt" @@ -32,7 +15,7 @@ else } fi -'emulate' 'zsh' '-o' 'no_aliases' +emulate zsh -o no_aliases { diff --git a/zsh/zsh_plugins.txt b/zsh/zsh_plugins.txt index f68a422..101faf5 100644 --- a/zsh/zsh_plugins.txt +++ b/zsh/zsh_plugins.txt @@ -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-completions https://github.com/ress997/zsh-completions-anyenv +https://github.com/b4b4r07/zsh-vimode-visual diff --git a/zsh/zshrc b/zsh/zshrc index 78eb6bf..4afbdae 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -3,8 +3,13 @@ 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 @@ -31,10 +36,11 @@ zle -N down-line-or-beginning-search export COMPLETION_WAITING_DOTS="true" -export VISUAL='nvim' -export EDITOR='nvim' +export VISUAL='vim' +export EDITOR='vim' 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 @@ -44,7 +50,6 @@ fi zstyle ':znap:*' plugins-dir "${ZSH_PLUGIN_DIR}" source "${ZSH_PLUGIN_DIR}/zsh-snap/znap.zsh" && export ZNAP_USED=1 -zstyle ':znap:*' auto-compile no local -a paths for line in "${(@f)"$(<~/.zsh_plugins.txt)"}" { @@ -60,21 +65,24 @@ fi if [[ ( $ZNAP_USED = 1 ) ]]; then 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/ripgrep") fpath=($fpath "$(znap path oh-my-zsh)/plugins/cargo") znap source zsh-syntax-highlighting znap source zsh-completions znap source zsh-completions-anyenv + 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 - eval "$(starship init zsh)" + znap eval starship-init "cat ~/.zsh.d/adds/starship.zsh" else if [[ ( $ZNAP_USED = 1 ) ]]; then znap clone https://github.com/denysdovhan/spaceship-prompt @@ -82,8 +90,7 @@ else znap prompt spaceship-prompt fi -autoload -Uz compinit promptinit -promptinit +autoload -Uz compinit compinit znap source oh-my-zsh plugins/gitignore @@ -125,7 +132,7 @@ function nv() { function vim() { if [[ $(whence -p nvim 2> /dev/null) ]]; then - nv ${@} + nvim ${@} else /usr/bin/vim ${@} fi @@ -150,9 +157,9 @@ fi path+=($(yarn global bin)) 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" -[[ -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 source $HOME/.zshsrc @@ -164,3 +171,4 @@ fi for funcfile in $HOME/.zsh.d/* ; do source "${funcfile}" done +