Browse Source

Use local .env

Bryan Roessler 1 day ago
parent
commit
7ed56cf4fd
1 changed files with 19 additions and 22 deletions
  1. 19 22
      dotfiles/zsh/.zshrc

+ 19 - 22
dotfiles/zsh/.zshrc

@@ -7,9 +7,9 @@ unsetopt beep
 bindkey -e
 
 # Load secrets
-if [[ -f "$HOME/develop/scripts/dotfiles/zsh/.env" ]]; then
+if [[ -f .env ]]; then
   set -a # automatically export all variables
-  source "$HOME/develop/scripts/dotfiles/zsh/.env"
+  source .env
   set +a
 fi
 
@@ -23,10 +23,10 @@ zmodload zsh/complist
 autoload -Uz compinit && compinit -d "$compdump"
 
 # History
-HISTFILE=${XDG_STATE_HOME:-$HOME/.local/state}/zsh/history
+HISTFILE=${XDG_STATE_HOME:-$HOME}/.histfile
 [[ -d $HISTFILE:h ]] || mkdir -p $HISTFILE:h
-HISTSIZE=100000
-SAVEHIST=100000
+HISTSIZE=1000000
+SAVEHIST=1000000
 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
@@ -71,8 +71,8 @@ _git_prompt() {
 }
 
 PROMPT='[%F{'$user_color'}%n%f@%F{'$host_color'}%m%f]%~$(_git_prompt)%(!.#.$) '
-RPROMPT='%*'
-precmd() { print -Pn "\e]0;%n@%m: ${PWD/#$HOME/~}\a" }
+# RPROMPT='%*' # display clock to right of screen
+precmd() { print -Pn "\e]0;%n@%m: ${PWD/#$HOME/~}\a" ; }
 
 # Set hostname on OpenWRT
 [[ -z $HOSTNAME ]] && HOSTNAME=$(noglob uci get system.@system[0].hostname 2>/dev/null)
@@ -88,25 +88,13 @@ path=(
 export PATH
 export R_LIBS_USER="$HOME/R/qhtcp-workflow"
 
-# Aliases
-alias ll='ls -lh'
-alias la='ls -A'
-alias vmd='vmd -nt'
-alias dnf-list-files='dnf repoquery -l'
-alias gedit='gnome-text-editor'
-alias xclip='xclip -selection c'
-alias pdoman='podman'
-alias workon='virtualenv-workon'
-alias git-list='git ls-tree -r HEAD --name-only'
-alias chatgpt='chatgpt --model gpt-4o'
-
 # Keybindings
 typeset -g -A key
 for k v in \
   Home khome End kend Insert kich1 Backspace kbs Delete kdch1 \
   Up kcuu1 Down kcud1 Left kcub1 Right kcuf1 PageUp kpp PageDown knp ShiftTab kcbt; do
   [[ -n ${terminfo[$v]} ]] && key[$k]=${terminfo[$v]}
- done
+done
 bindkey -- ${key[Home]-}      beginning-of-line
 bindkey -- ${key[End]-}       end-of-line
 bindkey -- ${key[Insert]-}    overwrite-mode
@@ -128,9 +116,18 @@ if (( ${+terminfo[smkx]} && ${+terminfo[rmkx]} )); then
   add-zle-hook-widget zle-line-finish  zle_app_finish
 fi
 
-# Functions
+# Aliases and one-liners
+alias ll='ls -lh'
+alias la='ls -A'
+alias vmd='vmd -nt'
+alias dnf-list-files='dnf repoquery -l'
+alias gedit='gnome-text-editor'
+alias xclip='xclip -selection c'
+alias pdoman='podman'
+alias workon='virtualenv-workon'
+alias git-list='git ls-tree -r HEAD --name-only'
+alias chatgpt='chatgpt --model gpt-4o'
 podman-update-images() {
   podman images --format '{{.Repository}}' | grep -v '^<none>$' | xargs -r -L1 podman pull
 }
-
 buildah-prune() { buildah rm --all; }