Add basic zsh connection
This commit is contained in:
parent
902ca7dc02
commit
bb900a090f
9 changed files with 69 additions and 54 deletions
12
zsh/.config/zsh/.zprofile
Normal file
12
zsh/.config/zsh/.zprofile
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
[ -f "$XDG_CONFIG_HOME/sh/profile" ] && . "$XDG_CONFIG_HOME/sh/profile"
|
||||
# .zlogin
|
||||
#
|
||||
if [ -d "$XDG_CONFIG_HOME/sh/profile.d" ]; then
|
||||
for file in "$XDG_CONFIG_HOME/sh/profile.d"/*.sh; do
|
||||
# shellcheck disable=1090
|
||||
source "$file"
|
||||
done
|
||||
unset file
|
||||
fi
|
||||
20
zsh/.config/zsh/.zshenv
Normal file
20
zsh/.config/zsh/.zshenv
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env zsh
|
||||
#
|
||||
#
|
||||
|
||||
# load global sh env vars
|
||||
[ -f "$XDG_CONFIG_HOME/sh/env" ] && source "$XDG_CONFIG_HOME/sh/env"
|
||||
if [ -d "$XDG_CONFIG_HOME/sh/env.d" ]; then
|
||||
for _env in "$XDG_CONFIG_HOME/sh/env.d"/*.sh; do
|
||||
. "$_env"
|
||||
done
|
||||
unset _env
|
||||
fi
|
||||
|
||||
# load zsh specific env vars
|
||||
if [ -d "$XDG_CONFIG_HOME/zsh/env.d" ]; then
|
||||
for _env in "$XDG_CONFIG_HOME/zsh/env.d"/*.zsh; do
|
||||
. "$_env"
|
||||
done
|
||||
unset _env
|
||||
fi
|
||||
22
zsh/.config/zsh/.zshrc
Normal file
22
zsh/.config/zsh/.zshrc
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/env zsh
|
||||
#
|
||||
#
|
||||
|
||||
# shellcheck source=alias
|
||||
[ -f "$XDG_CONFIG_HOME/sh/alias" ] && . "$XDG_CONFIG_HOME/sh/alias"
|
||||
# load additional aliases
|
||||
if [ -d "$XDG_CONFIG_HOME/sh/alias.d" ]; then
|
||||
for _alias in "$XDG_CONFIG_HOME/sh/alias.d"/*.sh; do
|
||||
. "$_alias"
|
||||
done
|
||||
unset _alias
|
||||
fi
|
||||
|
||||
# history
|
||||
#
|
||||
# Show the top 5 commands used in recent history
|
||||
history_top() {
|
||||
history | awk "{a[\$2]++} END{for(i in a){printf \"%5d\t%s\n\",a[i],i}}" | sort -rn | head
|
||||
}
|
||||
# Display timestamped recent command history
|
||||
alias history="fc -l -d -D"
|
||||
Loading…
Add table
Add a link
Reference in a new issue