-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't override customized environments in subshells
Only set up environment for the top-level shell, and allow it to be inherited normally. See: sorin-ionescu/prezto#500
- Loading branch information
Pablo Olmos de Aguilera Corradini
committed
Apr 12, 2014
1 parent
3558651
commit 1907b62
Showing
3 changed files
with
82 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
# Executes commands at login pre-zshrc. | ||
# | ||
# Authors: | ||
# Sorin Ionescu <[email protected]> | ||
# Pablo Olmos de Aguilera C. <pablo at glatelier dot org> | ||
# | ||
|
||
|
@@ -17,9 +18,86 @@ | |
# done < $HOME/.systemd-profile | ||
# } | ||
|
||
# | ||
# Browser | ||
# | ||
|
||
BROWSER='firefox' | ||
|
||
# | ||
# Editors | ||
# | ||
|
||
EDITOR='vim' | ||
VISUAL='gvim' | ||
PAGER='less' | ||
SUDO_EDITOR='vim' # to use sudoedit (or sudo -e) | ||
|
||
export BROWSER EDITOR VISUAL PAGER SUDO_EDITOR | ||
|
||
# | ||
# Language | ||
# | ||
|
||
if [[ -z "$LANG" ]]; then | ||
export LANG='en_US.UTF-8' | ||
fi | ||
|
||
# | ||
# Paths | ||
# | ||
|
||
# Ensure path arrays do not contain duplicates. | ||
typeset -gU cdpath fpath mailpath path | ||
|
||
# Set the the list of directories that cd searches. | ||
# cdpath=( | ||
# $cdpath | ||
# ) | ||
|
||
# Set the list of directories that Zsh searches for programs. | ||
# I manage some binaries and scripts on my ~/bin directory, so I add it first | ||
path=( | ||
${HOME}/bin | ||
${HOME}/.npm-packages/bin | ||
${HOME}/.cabal/bin | ||
# /usr/local/{bin,sbin} # is this necessary on Arch Linux? | ||
$path | ||
) | ||
|
||
# | ||
# Less | ||
# | ||
|
||
# Set the default Less options. | ||
# Mouse-wheel scrolling has been disabled by -X (disable screen clearing). | ||
# Remove -X and -F (exit if the content fits on one screen) to enable it. | ||
export LESS='-g -i -M -R -S -w -z-4' | ||
|
||
# Set the Less input preprocessor. | ||
if (( $+commands[lesspipe.sh] )); then | ||
export LESSOPEN='| /usr/bin/env lesspipe.sh %s 2>&-' | ||
fi | ||
|
||
# | ||
# Temporary Files | ||
# | ||
|
||
if [[ ! -d "$TMPDIR" ]]; then | ||
export TMPDIR="/tmp/$USER" | ||
mkdir -p -m 700 "$TMPDIR" | ||
fi | ||
|
||
TMPPREFIX="${TMPDIR%/}/zsh" | ||
if [[ ! -d "$TMPPREFIX" ]]; then | ||
mkdir -p "$TMPPREFIX" | ||
fi | ||
|
||
# Load super secret stuff | ||
[[ -s $HOME/.secrets ]] && source $HOME/.secrets | ||
|
||
[[ $TTY == /dev/tty1 ]] \ | ||
&& (( $UID )) \ | ||
&& [[ -z $DISPLAY ]] \ | ||
&& startx | ||
# && systemctl --user start wm.target | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,76 +3,13 @@ | |
# | ||
# Authors: | ||
# Sorin Ionescu <[email protected]> | ||
# Pablo Olmos de Aguilera <pablo at glatelier dot org> | ||
|
||
# | ||
# Browser | ||
# | ||
|
||
export BROWSER='firefox' | ||
|
||
# | ||
# Editors | ||
# | ||
|
||
EDITOR='vim' | ||
VISUAL='gvim' | ||
PAGER='less' | ||
SUDO_EDITOR='vim' # to use sudoedit (or sudo -e) | ||
|
||
export EDITOR VISUAL PAGER SUDO_EDITOR | ||
|
||
# | ||
# Language | ||
# | ||
|
||
if [[ -z $LANG ]]; then | ||
export LANG='en_US.UTF-8' | ||
# Ensure that a non-login, non-interactive shell has a defined environment. | ||
if [[ "$SHLVL" -eq 1 && ! -o LOGIN ]]; then | ||
source "${ZDOTDIR:-$HOME}/.zprofile" | ||
fi | ||
|
||
# | ||
# Paths | ||
# | ||
|
||
typeset -gU cdpath fpath mailpath path | ||
|
||
# Set the the list of directories that cd searches. | ||
# cdpath=( | ||
# $cdpath | ||
# ) | ||
|
||
# | ||
# Less | ||
# | ||
|
||
# Set the default Less options. | ||
# Mouse-wheel scrolling has been disabled by -X (disable screen clearing). | ||
# Remove -X and -F (exit if the content fits on one screen) to enable it. | ||
export LESS='-g -i -M -R -S -w -z-4' | ||
|
||
|
||
# Set the Less input preprocessor. | ||
if (( $+commands[lesspipe.sh] )); then | ||
export LESSOPEN='| /usr/bin/env lesspipe.sh %s 2>&-' | ||
fi | ||
|
||
# | ||
# Temporary Files | ||
# | ||
|
||
if [[ ! -d "$TMPDIR" ]]; then | ||
export TMPDIR="/tmp/$USER" | ||
mkdir -p -m 700 "$TMPDIR" | ||
fi | ||
|
||
TMPPREFIX="${TMPDIR%/}/zsh" | ||
if [[ ! -d "$TMPPREFIX" ]]; then | ||
mkdir -p "$TMPPREFIX" | ||
fi | ||
|
||
# Load super secret stuff | ||
[[ -s $HOME/.secrets ]] && source $HOME/.secrets | ||
|
||
# Fix steam closing | ||
export STEAM_FRAME_FORCE_CLOSE=1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters