Add default initialization file for zsh ; move scripts to rc/ dir

This commit is contained in:
iliajie
2022-11-12 21:42:56 +02:00
parent 0d1ced583f
commit 05475f051c
4 changed files with 38 additions and 2 deletions

31
xterm/rc/.zshrc Normal file
View File

@@ -0,0 +1,31 @@
# user specific environment
if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]
then
PATH="$HOME/.local/bin:$HOME/bin:$PATH"
fi
export PATH
# don't put duplicate lines in the history
HISTCONTROL=ignoredups:ignorespace
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# custom PS1
PS1='%F{magenta}%n%f@%F{green}%m%f:%1~%# '
# user default env config
if [ -f ~/.zshenv ]; then
. ~/.zshenv
fi
# user default profile config
if [ -f ~/.zprofile ]; then
. ~/.zprofile
fi
# user default run time config
if [ -f ~/.zshrc ]; then
. ~/.zshrc
fi

View File

@@ -40,9 +40,10 @@ my $shelllogin = "-".$shellname;
# Check for initialization file
if ($config{'rcfile'}) {
my $rcdir = "$module_root_directory/rc";
my $rcfile = $config{'rcfile'} == 1 ?
# Load shell init default file from module root directory
$module_root_directory."/default-rc_".$shellname :
"$rcdir/.".$shellname."rc" :
# Load shell init custom file
$config{'rcfile'};
if ($rcfile =~ /^\~\//) {
@@ -56,7 +57,11 @@ if ($config{'rcfile'}) {
}
# Sh
elsif ($shellname eq 'sh') {
$shellexec = "ENV=$rcfile; export ENV ; $shellexec";
$shellexec = "export ENV=$rcfile ; $shellexec";
}
# Zsh
elsif ($shellname eq 'zsh') {
$shellexec = "export ZDOTDIR=$rcdir ; $shellexec";
}
# Cannot use login shell while passing other parameters,