aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimen A. W. Olsen <hello@simenandre.no>2024-12-27 20:30:23 +0100
committerSimen A. W. Olsen <hello@simenandre.no>2024-12-27 20:30:23 +0100
commit58d6aefd2b81023f020c0a9997b9dd448508d59a (patch)
tree7cb146a113f56dc348fac5baab07aa5e4d3e794a
parente5acad1421f72dacad6bd386c36242d905f113a8 (diff)
downloaddotfiles-58d6aefd2b81023f020c0a9997b9dd448508d59a.tar.gz
dotfiles-58d6aefd2b81023f020c0a9997b9dd448508d59a.zip
zsh fixups
-rw-r--r--zsh/.config/zsh/.zshenv3
-rwxr-xr-x[l---------]zsh/.zshenv25
-rwxr-xr-xzsh/.zshrc (renamed from zsh/.config/zsh/.zshrc)16
3 files changed, 30 insertions, 14 deletions
diff --git a/zsh/.config/zsh/.zshenv b/zsh/.config/zsh/.zshenv
deleted file mode 100644
index 51b9cf4..0000000
--- a/zsh/.config/zsh/.zshenv
+++ /dev/null
@@ -1,3 +0,0 @@
-export ZDOTDIR=$HOME/.config/zsh
-
-. "$HOME/.cargo/env"
diff --git a/zsh/.zshenv b/zsh/.zshenv
index 9fbf4d2..ac043fe 120000..100755
--- a/zsh/.zshenv
+++ b/zsh/.zshenv
@@ -1 +1,24 @@
-.config/zsh/.zshenv \ No newline at end of file
+##!/bin/zsh
+#
+# .zshenv - Zsh environment file, loaded always.
+#
+
+# Set ZDOTDIR if you want to re-home Zsh.
+export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME/.config}
+export XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
+export XDG_CACHE_HOME=${XDG_CACHE_HOME:-$HOME/.cache}
+export ZDOTDIR=${ZDOTDIR:-$XDG_CONFIG_HOME/zsh}
+
+# Ensure path arrays do not contain duplicates.
+typeset -gU path fpath
+
+# Set the list of directories that zsh searches for commands.
+path=(
+ $HOME/{,s}bin(N)
+ $HOME/.local/{,s}bin(N)
+ /opt/{homebrew,local}/{,s}bin(N)
+ /usr/local/{,s}bin(N)
+ $path
+)
+
+. "$HOME/.cargo/env"
diff --git a/zsh/.config/zsh/.zshrc b/zsh/.zshrc
index 9ef0a9d..8734542 100755
--- a/zsh/.config/zsh/.zshrc
+++ b/zsh/.zshrc
@@ -1,22 +1,18 @@
+#!/bin/bash
+# ^----- get shellcheck hints based on bash
+# https://github.com/koalaman/shellcheck/issues/809
+# shellcheck disable=SC1090 # sourced filenames with variables
+echo "Loading ~/.zshrc"
+
# Download Znap, if it's not there yet.
[[ -r ~/.zsh_repos/znap/znap.zsh ]] ||
git clone --depth 1 -- \
https://github.com/marlonrichert/zsh-snap.git ~/.zsh_repos/znap
source ~/.zsh_repos/znap/znap.zsh # Start Znap
-export GOPATH=~/go
-export REPOS=~/ghq
-
znap eval starship 'starship init zsh --print-full-init'
znap prompt
znap source marlonrichert/zsh-autocomplete
znap source zsh-users/zsh-autosuggestions
-for file in ~/.{aliases.zsh,path.zsh,extras.zsh}; do
- if [[ -r "$file" ]] && [[ -f "$file" ]]; then
- # shellcheck source=/dev/null
- source "$file"
- fi
-done
-