[bash] Fix bash profile initialization
Removed automatic initializations of zsh functions. Fixed not calling correct folders for bash aliases, environment variables and profile settings.
This commit is contained in:
parent
ce4473bf9f
commit
1ae92cfc2a
4 changed files with 40 additions and 28 deletions
|
@ -47,12 +47,14 @@ if exist git; then
|
||||||
|
|
||||||
alias gst='git status'
|
alias gst='git status'
|
||||||
|
|
||||||
|
if [ "$0" = "/bin/zsh" ]; then
|
||||||
autoload -Uz is-at-least
|
autoload -Uz is-at-least
|
||||||
if is-at-least 2.13 "$(git --version 2>/dev/null | awk '{print $3}')"; then
|
if is-at-least 2.13 "$(git --version 2>/dev/null | awk '{print $3}')"; then
|
||||||
alias gsta='git stash push'
|
alias gsta='git stash push'
|
||||||
else
|
else
|
||||||
alias gsta='git stash save'
|
alias gsta='git stash save'
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
alias gstp='git stash pop'
|
alias gstp='git stash pop'
|
||||||
alias gstl='git stash list'
|
alias gstl='git stash list'
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,13 +1,26 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
#
|
#
|
||||||
# ~/.bash_profile
|
# ~/.bash_profile
|
||||||
#
|
#
|
||||||
|
# shellcheck disable=SC1090
|
||||||
|
|
||||||
if [ -d $XDG_CONFIG_HOME/shell/login.d ]; then
|
# load global sh env vars
|
||||||
for file in $XDG_CONFIG_HOME/shell/login.d/*.sh; do
|
[ -f "$XDG_CONFIG_HOME/sh/env" ] && source "$XDG_CONFIG_HOME/sh/env"
|
||||||
source $file
|
if [ -d "$XDG_CONFIG_HOME/sh/env.d" ]; then
|
||||||
|
for _env in "$XDG_CONFIG_HOME/sh/env.d"/*.sh; do
|
||||||
|
. "$_env"
|
||||||
done
|
done
|
||||||
|
unset _env
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[[ -f ~/.bashrc ]] && . ~/.bashrc
|
# load profile files vars
|
||||||
|
[ -f "$XDG_CONFIG_HOME/sh/profile" ] && source "$XDG_CONFIG_HOME/sh/profile"
|
||||||
|
if [ -d "$XDG_CONFIG_HOME/sh/profile.d" ]; then
|
||||||
|
for _profile in "$XDG_CONFIG_HOME/sh/profile.d"/*.sh; do
|
||||||
|
. "$_profile"
|
||||||
|
done
|
||||||
|
unset _profile
|
||||||
|
fi
|
||||||
|
|
||||||
export PATH="$HOME/.cargo/bin:$PATH"
|
# shellcheck disable=SC1090
|
||||||
|
[[ -f ~/.bashrc ]] && . ~/.bashrc
|
||||||
|
|
21
home/.bashrc
21
home/.bashrc
|
@ -1,23 +1,20 @@
|
||||||
#
|
#
|
||||||
# ~/.bashrc
|
# ~/.bashrc
|
||||||
#
|
#
|
||||||
|
# shellcheck disable=SC1090
|
||||||
|
|
||||||
|
CONFDIR="${XDG_CONFIG_HOME:-$HOME/.config}"
|
||||||
|
|
||||||
# If not running interactively, don't do anything
|
# If not running interactively, don't do anything
|
||||||
[[ $- != *i* ]] && return
|
[[ $- != *i* ]] && return
|
||||||
|
|
||||||
# Load files from rc.d
|
[ -f "$CONFDIR/sh/alias" ] && source "$CONFDIR/sh/alias"
|
||||||
if [ -d $XDG_CONFIG_HOME/shell/rc.d ]; then
|
# load additional aliases
|
||||||
for file in $XDG_CONFIG_HOME/shell/rc.d/*.sh; do
|
if [ -d "$CONFDIR/sh/alias.d" ]; then
|
||||||
source $file
|
for _alias in "$CONFDIR/sh/alias.d"/*.sh; do
|
||||||
|
. "$_alias"
|
||||||
done
|
done
|
||||||
|
unset _alias
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Load files from bashrc.d
|
|
||||||
if [ -d $XDG_CONFIG_HOME/shell/bashrc.d ]; then
|
|
||||||
for file in $XDG_CONFIG_HOME/shell/bashrc.d/*.bash; do
|
|
||||||
source $file
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
alias ls='ls --color=auto'
|
alias ls='ls --color=auto'
|
||||||
PS1='[\u@\h \W]\$ '
|
PS1='[\u@\h \W]\$ '
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# more usage instructions at https://github.com/clvv/fasd
|
# more usage instructions at https://github.com/clvv/fasd
|
||||||
eval "$(fasd --init posix-hook posix_alias bash-hook zsh-hook zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install)"
|
# eval "$(fasd --init posix-hook posix_alias bash-hook zsh-hook zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install)"
|
||||||
# eval "$(fasd --init auto)"
|
type fasd >/dev/null 2>&1 && eval "$(fasd --init auto)"
|
||||||
|
|
||||||
alias a='fasd -a' # any
|
alias a='fasd -a' # any
|
||||||
alias s='fasd -si' # show / search / select
|
alias s='fasd -si' # show / search / select
|
||||||
|
|
Loading…
Reference in a new issue