diff --git a/.gitignore b/.gitignore index 10ffff2..6ce1cc5 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,7 @@ zsh/* !zsh/.zshrc !zsh/.zshenv !zsh/.zprofile -!zsh/.zsh_plugins.txt +!zsh/.zsh_plugins*.txt !zsh/scripts.zsh !zsh/aliases.zsh !zsh/completions/.keep diff --git a/zsh/.zsh_plugins.txt b/zsh/.zsh_plugins.txt index 0c10f46..acca4cd 100644 --- a/zsh/.zsh_plugins.txt +++ b/zsh/.zsh_plugins.txt @@ -9,6 +9,3 @@ ohmyzsh/ohmyzsh path:plugins/git # popular fish-like plugins zsh-users/zsh-autosuggestions - -# nvm -lukechilds/zsh-nvm diff --git a/zsh/.zsh_plugins_darwin.txt b/zsh/.zsh_plugins_darwin.txt new file mode 100644 index 0000000..7007731 --- /dev/null +++ b/zsh/.zsh_plugins_darwin.txt @@ -0,0 +1 @@ +lukechilds/zsh-nvm diff --git a/zsh/.zshenv b/zsh/.zshenv index befb32a..09af955 100644 --- a/zsh/.zshenv +++ b/zsh/.zshenv @@ -14,7 +14,9 @@ export PATH="/opt/homebrew/sbin:$PATH" export LIBRARY_PATH="$LIBRARY_PATH:/opt/homebrew/lib" # cargo -source "$HOME/.cargo/env" +if [[ "$OSTYPE" == "darwin"* ]]; then + source "$HOME/.cargo/env" +fi # language environment export LANG=en_US.UTF-8 @@ -46,7 +48,7 @@ export POETRY_HOME="$XDG_DATA_HOME/poetry" command -v poetry >/dev/null || export PATH="$POETRY_HOME/bin:$PATH" # gnupg -export GPG_TTY=$TTY +export GPG_TTY=$(tty) # aflabs export USER_UID=$(id -u) diff --git a/zsh/.zshrc b/zsh/.zshrc index 14875c3..713fb81 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -12,11 +12,20 @@ export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#ffffff,bg=cyan,bold,underline" source $ZDOTDIR/.antidote/antidote.zsh antidote load +if [[ "$OSTYPE" == "darwin"* ]]; then + antidote load ${ZDOTDIR:-~}/.zsh_plugins_darwin.txt +fi + unsetopt autocd -# pyenv -eval "$(pyenv init - zsh)" -eval "$(pyenv virtualenv-init - zsh)" +if [[ "$OSTYPE" == "darwin"* ]]; then + eval "$(pyenv init - zsh)" + eval "$(pyenv virtualenv-init - zsh)" +fi + +if [[ "$OSTYPE" == "darwin"* ]]; then + export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) +fi # ggman eval "$(ggman shellrc)" diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh index b1016f5..c7bdeee 100644 --- a/zsh/aliases.zsh +++ b/zsh/aliases.zsh @@ -1,7 +1,13 @@ alias z="exec zsh" alias t=tmux_attach -alias n=nvim_ve -# alias vim=nvim_ve + +if [[ "$OSTYPE" == "darwin"* ]]; then + alias n=nvim_ve + alias vim=nvim_ve +elif [[ "$OSTYPE" == "linux"* ]]; then + alias n=nvim +fi + alias s="ssh-menu" # docker diff --git a/zsh/scripts.zsh b/zsh/scripts.zsh index 16e21b9..db488f8 100644 --- a/zsh/scripts.zsh +++ b/zsh/scripts.zsh @@ -8,8 +8,6 @@ function nvim_ve { fi } -alias nvim=nvim_ve - function afm { RES=$(curl -s "https://$1/api/monitoring/requirements") COUNT=$(echo "$RES" | grep -c $2)