summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.config/zsh/profile1
-rw-r--r--.config/zsh/rc74
l---------[-rw-r--r--].zprofile2
l---------.zshrc1
4 files changed, 77 insertions, 1 deletions
diff --git a/.config/zsh/profile b/.config/zsh/profile
new file mode 100644
index 0000000..c7b8b63
--- /dev/null
+++ b/.config/zsh/profile
@@ -0,0 +1 @@
+. "${HOME}/.profile"
diff --git a/.config/zsh/rc b/.config/zsh/rc
new file mode 100644
index 0000000..8aa8744
--- /dev/null
+++ b/.config/zsh/rc
@@ -0,0 +1,74 @@
+autoload -Uz compinit && compinit
+autoload bashcompinit && bashcompinit
+if type brew &>/dev/null; then
+ brewprefix=$(brew --prefix)
+ FPATH=$brewprefix/share/zsh-completions:$brewprefix/share/zsh/site-functions:$FPATH
+fi
+
+zmodload zsh/complist
+zstyle ':completion:*' menu select
+function insert-and-complete-again() {
+ zle expand-or-complete-prefix
+ zle list-choices
+}
+zle -N insert-and-complete-again
+bindkey '^I' insert-and-complete-again
+
+_comp_options+=(globdots) # Include hidden files.
+# Use vim keys in tab complete menu:
+bindkey -M menuselect 'h' vi-backward-char
+bindkey -M menuselect 'k' vi-up-line-or-history
+bindkey -M menuselect 'l' vi-forward-char
+bindkey -M menuselect 'j' vi-down-line-or-history
+
+[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc" ] && . "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc"
+[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutenvrc" ] && . "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutenvrc"
+[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" ] && . "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc"
+[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" ] && . "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc"
+[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/zsh/local.rc" ] && . "${XDG_CONFIG_HOME:-$HOME/.config}/zsh/local.rc"
+
+autoload -U select-word-style && select-word-style bash
+
+# Enable prompt substitutions and colors
+autoload -U colors && colors
+setopt PROMPT_SUBST
+
+# History settings
+HISTSIZE=100000
+HISTFILE=~/.zsh_history
+SAVEHIST=100000
+setopt HIST_IGNORE_SPACE
+setopt HIST_IGNORE_ALL_DUPS
+setopt APPEND_HISTORY
+
+# Titlebar update before each prompt
+precmd() {
+ print -Pn '\e]0;%~'
+ [[ -n "$IN_KAKOUNE_CONNECT" ]] && print -Pn " - $KAKOUNE_CLIENT@[$KAKOUNE_SESSION]"
+ [[ -n "$TERM" ]] && print -Pn " - $TERM"
+ print -Pn '\a'
+}
+
+# Kakoune session info
+kak_session='${IN_KAKOUNE_CONNECT:+¶$KAKOUNE_SESSION}'
+
+# Terraform info evaluated at prompt time
+terraform_info='$(fd --exact-depth=1 --extension=tf --quiet && terraform workspace show 2>/dev/null | sed "s/.*/🥡 &/")'
+
+# Git branch evaluated at prompt time
+git_branch='$(git branch --show-current 2>/dev/null | sed "s/.*/ &/" 2>/dev/null)'
+
+# Final prompt
+PROMPT='%{$fg[green]%}%n@%m %{$fg[blue]%}'"$kak_session"' %{$fg[yellow]%}%(5~|%-2~/…/%3~|%4~)%f %F{5}'$terraform_info'%f %F{9}$(echo '"$git_branch"')%f
+%{$fg[cyan]%}λ%f '
+
+# The next line updates PATH for the Google Cloud SDK.
+if [ -f '/opt/homebrew/share/google-cloud-sdk/path.zsh.inc' ]; then . '/opt/homebrew/share/google-cloud-sdk/path.zsh.inc'; fi
+
+# The next line enables shell command completion for gcloud.
+if [ -f '/opt/homebrew/share/google-cloud-sdk/completion.zsh.inc' ]; then . '/opt/homebrew/share/google-cloud-sdk/completion.zsh.inc'; fi
+
+km() {
+echo "map global ${1:?} ${2:?} %{<esc>:make-once $(history -1 | sed 's/[[:space:]]*[0-9]*[[:space:]]*\(.*\)/\1/')<ret>}" | kak -p $KAKOUNE_SESSION
+}
+alias kmp='km pistarchio '
diff --git a/.zprofile b/.zprofile
index c7b8b63..5db19f9 100644..120000
--- a/.zprofile
+++ b/.zprofile
@@ -1 +1 @@
-. "${HOME}/.profile"
+.config/zsh/profile \ No newline at end of file
diff --git a/.zshrc b/.zshrc
new file mode 120000
index 0000000..bd94640
--- /dev/null
+++ b/.zshrc
@@ -0,0 +1 @@
+.config/zsh/rc \ No newline at end of file