[shell] moved to a single directory + alias.sh
This commit is contained in:
2
shell/alias.sh
Normal file
2
shell/alias.sh
Normal file
@@ -0,0 +1,2 @@
|
||||
alias l="ls -lah"
|
||||
alias lg="lazygit"
|
||||
24
shell/bash/bashrc
Normal file
24
shell/bash/bashrc
Normal file
@@ -0,0 +1,24 @@
|
||||
source ~/.dotfiles/git/git-prompt.sh
|
||||
source ~/.dotfiles/shell/alias.sh
|
||||
PROMPT_COMMAND='PS1_CMD1=$(__git_ps1 " [%s]")'; PS1='\[\e[38;5;117m\]\u\[\e[0m\] \w${PS1_CMD1}\$ '
|
||||
|
||||
#
|
||||
# tmux history preservation
|
||||
#
|
||||
|
||||
# Avoid duplicates
|
||||
HISTCONTROL=ignoredups:erasedups # Ubuntu default is ignoreboth
|
||||
# When the shell exits, append to the history file instead of overwriting it
|
||||
shopt -s histappend # In Ubuntu this is already set by default
|
||||
|
||||
# After each command, append to the history file and reread it
|
||||
PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r"
|
||||
|
||||
#
|
||||
# tmux autostart
|
||||
#
|
||||
# [[ $- == *i* ]] is to check if the current seession is interactive - https://superuser.com/a/1777888/136716
|
||||
if command -v tmux &> /dev/null && [ -n "$PS1" ] && [[ $- == *i* ]] && [[ ! "$TERM" =~ screen ]] && [[ ! "$TERM" =~ tmux ]] && [ -z "$TMUX" ]; then
|
||||
exec tmux new-session -As0
|
||||
fi
|
||||
|
||||
21
shell/zsh/zshrc
Normal file
21
shell/zsh/zshrc
Normal file
@@ -0,0 +1,21 @@
|
||||
source ~/.dotfiles/shell/alias.sh
|
||||
eval "$(/opt/homebrew/bin/brew shellenv)"
|
||||
if type brew &>/dev/null
|
||||
then
|
||||
FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"
|
||||
|
||||
autoload -Uz compinit
|
||||
compinit
|
||||
fi
|
||||
|
||||
setopt appendhistory # Append history to the history file (no overwriting)
|
||||
setopt incappendhistory # Immediately append to the history file, not just when a term is killed
|
||||
setopt histignoredups
|
||||
|
||||
source ~/.dotfiles/git/git-prompt.sh
|
||||
setopt PROMPT_SUBST ; PS1='%n@%m %c$(__git_ps1 " [%s]")\$ '
|
||||
|
||||
if [ -f ~/.zshrc_local ]
|
||||
then
|
||||
source ~/.zshrc_local
|
||||
fi
|
||||
Reference in New Issue
Block a user