From 9f0cb257f39f8707d32b2c611ad4bb7c94c3c2e7 Mon Sep 17 00:00:00 2001 From: Taeyeon Mori Date: Sat, 29 Apr 2017 23:06:18 +0900 Subject: [PATCH] zsh: Move some things around --- zsh/zprofile | 42 +++++++++++++++++++++++++++++++++++++++--- zsh/zshrc | 18 ++++++++---------- 2 files changed, 47 insertions(+), 13 deletions(-) diff --git a/zsh/zprofile b/zsh/zprofile index 2740ba2..c7730bb 100644 --- a/zsh/zprofile +++ b/zsh/zprofile @@ -1,3 +1,4 @@ +# vim: ft=sh # # Executes commands in every top-level shell # @@ -26,15 +27,23 @@ # if [[ "$OSTYPE" == darwin* ]]; then - export BROWSER='open' + export BROWSER=open +elif (( $+commands[xdg-open] )); then + export BROWSER=xdg-open fi # # Editors # -export EDITOR='vim' -export VISUAL='vim' +if (( $+commands[nvim] )); then + export EDITOR=nvim + export VISUAL=nvim +else + export EDITOR=vim + export VISUAL=vim +fi + export PAGER='less' # @@ -75,6 +84,7 @@ typeset -gU cdpath fpath mailpath path pythonpath # zsh only maps the array and text versions for PATH export PYTHONPATH="${(j|:|)pythonpath}" + # # Less # @@ -103,11 +113,37 @@ if [[ ! -d "$TMPPREFIX" ]]; then mkdir -p "$TMPPREFIX" fi + +# +# SSH +# + +if (( $+commands[systemctl] )); then + eval "$(systemctl --user show-environment | grep '^SSH_AUTH_SOCK=')" +fi +if [ -n $SSH_AUTH_SOCK -a -f "$XDG_RUNTIME_DIR/ssh-agent.sock" ]; then + SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.sock" +fi +export SSH_AUTH_SOCK + + +# # Arch Build system +# + export ASPROOT=$HOME/aur/ABS/.asp + +# # LaTeX +# + export TEXMFHOME=$DOTFILES/texmf + +# # Local overrides +# + [[ -e "$DOTFILES/zsh/zprofile.local" ]] && source "$DOTFILES/zsh/zprofile.local" + diff --git a/zsh/zshrc b/zsh/zshrc index f3260a8..a9a0fb2 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -16,13 +16,16 @@ typeset -gU fpath # # Source Prezto. # + if [[ -s "${ZDOTDIR}/prezto/init.zsh" ]]; then source "${ZDOTDIR}/prezto/init.zsh" fi + # # Git # + # Revive old gst alias from OMZ/git alias gst="git status" @@ -47,31 +50,26 @@ function gupf { ) } -# -# SSH -# -if (( $+commands[systemctl] )); then - eval "$(systemctl --user show-environment | grep '^SSH_AUTH_SOCK=')" -fi -if [ -n $SSH_AUTH_SOCK -a -f "$XDG_RUNTIME_DIR/ssh-agent.sock" ]; then - SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.sock" -fi -export SSH_AUTH_SOCK # # rsync # + alias rsync="rsync -aXzPvihs -e ssh" + # # NeoVim # + if (( $+commands[nvim] )); then alias vim=nvim fi + # # Local overrides # + [[ -e "$DOTFILES/zsh/zshrc.local" ]] && source "$DOTFILES/zsh/zshrc.local"