Skip to content

Commit 6d2e9ea

Browse files
initial commit
1 parent 4c1d8f5 commit 6d2e9ea

File tree

4 files changed

+35
-23
lines changed

4 files changed

+35
-23
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
**/.zsh_history
77
**/.zshrc.backup
88
**/.zsh_sessions/
9+
**/.zcompcache/
910

1011
# Gcloud config, this is more of a data store
1112
**/gcloud
@@ -25,3 +26,6 @@
2526
# IntelliJ
2627
**/.idea/
2728
**/JetBrains
29+
30+
# rclone stores credentials in configuration
31+
rclone

zsh/.zshenv

+5
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,8 @@ export PATH="$PATH:${GOPATH}/bin:${GOROOT}/bin:$HOME/bin"
2525
# Java
2626
# This allows java based apps to show (e.g. goland)
2727
export _JAVA_AWT_WM_NONREPARENTING=1
28+
29+
# Save command history
30+
export HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history
31+
export HISTSIZE=2000
32+
export SAVEHIST=1000

zsh/.zshrc

+20-23
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22

33
source ${ZDOTDIR}/aliases
4+
source ${ZDOTDIR}/functions
45

56
# This is for zsh auto completion
67
autoload -Uz compinit
@@ -24,34 +25,30 @@ ssh-add ~/.ssh/personal/Adams-MBP_github 2> /dev/null
2425

2526
[[ /usr/local/bin/kubectl ]] && source <(kubectl completion zsh)
2627

27-
# AWS default creds
28-
if test -f '~/.aws/credentials'; then
29-
aws_profile='default'
30-
export AWS_ACCESS_KEY_ID=$(aws configure get default.aws_access_key_id --profile $aws_profile)
31-
export AWS_SECRET_KEY=$(aws configure get default.aws_secret_access_key --profile $aws_profile)
32-
fi
28+
# # AWS default creds
29+
# if test -f '~/.aws/credentials'; then
30+
# aws_profile='default'
31+
# export AWS_ACCESS_KEY_ID=$(aws configure get default.aws_access_key_id --profile $aws_profile)
32+
# export AWS_SECRET_KEY=$(aws configure get default.aws_secret_access_key --profile $aws_profile)
33+
# fi
3334

3435
# Updates PATH for the Google Cloud SDK.
35-
file='/Users/adam/google-cloud-sdk/path.zsh.inc'
36-
test -f $file && source $file
37-
36+
source_if_exists '/Users/adam/google-cloud-sdk/path.zsh.inc'
3837
# Enables shell command completion for gcloud.
39-
file='/Users/adam/google-cloud-sdk/completion.zsh.inc'
40-
test -f $file && source $file
38+
source_if_exists '/Users/adam/google-cloud-sdk/completion.zsh.inc'
39+
4140

4241
# Enables the following plugins for zsh (without oh-my-zsh)
43-
os=$(uname)
44-
if [[ "$os" == "Darwin" ]]; then
45-
source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh
46-
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
47-
48-
else
49-
# os == Linux
50-
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
51-
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
52-
fi
42+
# macos x86
43+
source_if_exists /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh
44+
source_if_exists /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
45+
# macos ARM
46+
source_if_exists /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh
47+
source_if_exists /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
48+
# Linux
49+
source_if_exists /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
50+
source_if_exists /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
5351

5452

5553
# Machine specific config
56-
file="${HOME}/.zshrc"
57-
test -f ${file} && source ${file}
54+
source_if_exists "${HOME}/.zshrc"

zsh/functions

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
source_if_exists() {
2+
path=$1
3+
if test -f "${path}"; then
4+
source "${path}"
5+
fi
6+
}

0 commit comments

Comments
 (0)