.sh

Multi-shell dotfiles manager
git clone https://git.torresjrjr.com/.sh.git
Log | Files | Refs | README | LICENSE

commit c0fd6fed3e4408f04f384cd9ea5fa54465970a09
parent 9bdac600926cd3809b409db889866c04a4066499
Author: Byron Torres <b@torresjrjr>
Date:   Wed, 28 Jul 2021 11:17:54 +0100

Rename .rc.sh to .init.sh

Diffstat:
Mbash/.bashrc | 2+-
Ash/.init.sh | 77+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Msh/.profile | 2+-
Dsh/.rc.sh | 77-----------------------------------------------------------------------------
Mzsh/.zshrc | 2+-
5 files changed, 80 insertions(+), 80 deletions(-)

diff --git a/bash/.bashrc b/bash/.bashrc @@ -7,7 +7,7 @@ ## Common -source "$DOTSHELL/sh/.rc.sh" +source "$DOTSHELL/sh/.init.sh" ## Env diff --git a/sh/.init.sh b/sh/.init.sh @@ -0,0 +1,77 @@ +# +# .init.sh +# +# The common POSIX script for interactive shells + + +## Env + +FETCH="${FETCH:-fetch}" + + +## Settings + +set -o vi + + +## Aliases + +# bulitins +alias c='clear' +alias rs='clear; . $DOTSHELL/sh/.init.sh' # overridden +alias ls='ls -w 80 --color=auto --group-directories-first' +alias la='ls -FAXC' +alias ll='ls -FAXlh' + +# externals +alias tree='tree -C --dirsfirst' +alias diff='diff --color=auto' +alias grep='grep --color=auto' + +alias gits='git status -s' +alias gitss='git status -v' +alias gitd='git diff' +alias gitds='git diff --staged' +alias gitl='git log --oneline --decorate --graph --all -10' +alias gitll='git log --oneline --decorate --graph --all' + + +## Functions + +info() { + $FETCH + ls -FAX ; echo + git log -0 2>&- && { # if git repo + git log -1 --abbrev-commit --format=short --color --decorate \ + | sed -n '1p; /^ /p' + git status -s + echo + } +} + +gitf() { + echo ">>>" + git fetch $1 + echo "<<<" + gitlf $1 $2 + echo "---" + git status +} + +gitlf() { + remote=${1:-origin} + branch=${2:-$(git branch | grep '^\*' | cut -d' ' -f2)} + git log --oneline --decorate --graph --color \ + "$branch" "$remote/$branch" \ + "$( git merge-base "$branch" "$remote/$branch" )^!" +} + +## Local + +test -f "$DOTSHELL/local/.init.sh" && + . "$DOTSHELL/local/.init.sh" + + +## Runtime + +info diff --git a/sh/.profile b/sh/.profile @@ -8,7 +8,7 @@ # shell export DOTSHELL="$HOME/.sh" -export ENV="$DOTSHELL/sh/.rc.sh" # see sh(1) +export ENV="$DOTSHELL/sh/.init.sh" # see sh(1) export INPUTRC="$DOTSHELL/misc/.inputrc" # system diff --git a/sh/.rc.sh b/sh/.rc.sh @@ -1,77 +0,0 @@ -# -# .rc.sh -# -# The common POSIX script for interactive shells - - -## Env - -FETCH="${FETCH:-fetch}" - - -## Settings - -set -o vi - - -## Aliases - -# bulitins -alias c='clear' -alias rs='clear; . $DOTSHELL/sh/.rc.sh' # overwritten -alias ls='ls -w 80 --color=auto --group-directories-first' -alias la='ls -FAXC' -alias ll='ls -FAXlh' - -# externals -alias tree='tree -C --dirsfirst' -alias diff='diff --color=auto' -alias grep='grep --color=auto' - -alias gits='git status -s' -alias gitss='git status -v' -alias gitd='git diff' -alias gitds='git diff --staged' -alias gitl='git log --oneline --decorate --graph --all -10' -alias gitll='git log --oneline --decorate --graph --all' - - -## Functions - -info() { - $FETCH - ls -FAX ; echo - git log -0 2>&- && { # if git repo - git log -1 --abbrev-commit --format=short --color --decorate \ - | sed -n '1p; /^ /p' - git status -s - echo - } -} - -gitf() { - echo ">>>" - git fetch $1 - echo "<<<" - gitlf $1 $2 - echo "---" - git status -} - -gitlf() { - remote=${1:-origin} - branch=${2:-$(git branch | grep '^\*' | cut -d' ' -f2)} - git log --oneline --decorate --graph --color \ - "$branch" "$remote/$branch" \ - "$( git merge-base "$branch" "$remote/$branch" )^!" -} - -## Local - -test -f "$DOTSHELL/local/.rc.sh" && - . "$DOTSHELL/local/.rc.sh" - - -## Runtime - -info diff --git a/zsh/.zshrc b/zsh/.zshrc @@ -6,7 +6,7 @@ ## Common -source "$DOTSHELL/sh/.rc.sh" +source "$DOTSHELL/sh/.init.sh" ## Settings