Rename zsh_exports to zshenv.

zshenv is sourced by every zsh (not only interactive sessions, scripts too).
Content of this file is what I probably want scripts to use too. Scripts
probably don't things like aliases.
This commit is contained in:
Mika Suomalainen 2011-09-29 16:41:13 +03:00
parent 084dda139a
commit 802c0da6af
6 changed files with 39 additions and 17 deletions

6
README
View File

@ -15,11 +15,11 @@ YOU RAN INSTALLATION SCRIPT.
Notices:
zshrc: I have uncommented line 42.
zsh_exports: The default editor is nano (line 4).
zsh_exports: The default timezone is Europe/Helsinki, line 15. You probably want to change it.
zshenv: The default editor is nano (line 4).
zshenv: The default timezone is Europe/Helsinki, line 15. You probably want to change it.
zshrc: autocd is disabled (commented in near end of zshrc REASON: It doesn't seem to work with Mac OS X, and I have one MacBook running it here..
zshrc: Lines 123-125 expect you to have tmux installed.
zsh_exports: Line 11 makes C as locale. You MUST change this. See line 10 for information about how.
zshenv: Line 11 makes C as locale. You MUST change this. See line 10 for information about how.
zshrc: if you have read every notice, comment line 1 in your ~/.zshrc .
DISCLAIMER:

View File

@ -6,9 +6,9 @@ touch ~/.zshrc # Creates .zshrc if you don't have one.
cat ~/.zshrc > ~/.zshrc.default.backup # Backups your current .zshrc
touch ~/.zsh_aliases # Creates .zsh_aliases if you don't have one.
cat ~/.zsh_aliases > ~/.zsh_aliases.default.backup # Backups your current .zsh_aliases
touch ~/.zsh_exports # Creates .zsh_exports (this is my idea, I am surprised if you have it.)
cat ~/.zsh_exports > ~/.zsh_exports.default.backup # Backs up .zsh_exports.
touch ~/.zsh_functions # I am surprised if you have this, see above.
touch ~/.zshenv # Creates .zshenv
cat zshenv > ~/.zshenv.default.backup # Backs up .zsh_exports.
touch ~/.zsh_functions
cat ~/.zsh_functions > ~/.zsh_functions.default.backup # Backs up .zsh_functions .
echo "Done!"
echo "Installing zsh_aliases."
@ -17,8 +17,8 @@ echo "zsh_aliases installed."
echo "Installing zshrc."
cat zshrc > ~/.zshrc
echo "zshrc installed."
echo "Installing zsh_exports"
cat zsh_exports > ~/.zsh_exports
echo "Installing zshenv"
cat zshenv > ~/.zshenv
echo "zsh_exports installed."
echo "Installing zsh_functions"
cat zsh_functions > ~/.zsh_functions

View File

@ -2,6 +2,6 @@
echo "Restoring default files..."
cat ~/.zshrc.default.backup > ~/.zshrc
cat ~/.zsh_aliases.default.backup > ~/.zsh_aliases
cat ~/.zsh_exports.default.backup > ~/.zsh_exports
cat ~/.zshenv.default.backup > ~/.zshenv
cat ~/.zsh_functions.default.backup > ~/.zsh_functions
echo "Done! Now you should restart zsh or source files again for default files to affect."

View File

@ -1,7 +1,7 @@
#!/usr/bin/env zsh
echo "Backing up files..."
touch ~/.zsh_exports
cat ~/.zsh_exports > ~/.zsh_exports.old.backup
touch ~/.zshenv
cat ~/.zshenv > ~/.zshenv.old.backup
touch ~/.zsh_aliases
cat ~/.zsh_aliases > ~/.zsh_aliases.old.backup
touch ~/.zsh_functions
@ -12,9 +12,9 @@ echo "Installing new files..."
cat zsh_aliases > ~/.zsh_aliases
cat zsh_functions > ~/.zsh_functions
cat zshrc > ~/.zshrc
echo "Not installing zsh_exports, See content of that file:"
touch ~/.zsh_exports
echo "-- Start of content of zsh_exports --"
cat zsh_exports
echo "-- End of content of zsh_exports --"
echo "Not installing zshenv, See content of that file:"
touch ~/.zshenv
echo "-- Start of content of zshenv --"
cat zshenv
echo "-- End of content of zshenv --"
echo "Installation has been completed. You might now need to source your ~/.zshrc for changes to happen."

22
zshenv Normal file
View File

@ -0,0 +1,22 @@
# This file exports everything in my zshrc. Note: This file is not overwritten by scripts.
# Sets the default editor. I prefer nano to vim and so on, so I want it to be nano. If you don't like terminal based text editors, change "nano" to gedit (Gnome) or Kate (KDE).
export EDITOR=nano
# Sets user specifig PYTHONPATH. Replace 2.X with your Python version. For example with Python 2.7 you replace X with 7.
#export PYTHONPATH=$HOME/.packages/lib/python2.X/site-packages
# Fixes locale problems (for example) when SSHing in with different locale. (Another example: Hailo plugin for supybot gives locale errors, this fixes it.)
# Replace "C" with your locale. You can get list of locales by running "locale -a". Replace "C" with your language. For example: fi_FI.utf8 )
LC_ALL=C
export LC_ALL
# Sets your timezone. Set in format <Region/City>, or just timezone like UTC.
#export TZ="/usr/share/zoneinfo/Europe/Helsinki"
# Sets PATH. To add another path, add :</path/to/new/path> to string below.
# Yes, I know that this isn't exporting, but I don't want PYTHONPATH to be alone here and PATH matches with nature of this file.
PATH=$PATH
# Sets web-browser. Used for one alias.
#export BROWSER=lynx

2
zshrc
View File

@ -42,7 +42,7 @@ zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
# Sources everything.
source ~/.zsh_aliases
source ~/.zsh_exports
source ~/.zshenv
source ~/.zsh_functions
## DO NOT PUT ANYTHING BELOW THIS LINE OR YOUR CHANGES MAY GET IGNORED BY BASH!