From 6c9c17409b1c38364dcc5621b6473feb1cf9a5ca Mon Sep 17 00:00:00 2001 From: Mitch Riedstra Date: Mon, 29 Jan 2018 02:33:36 -0500 Subject: A better way of setting the editor --- mkshrc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'mkshrc') diff --git a/mkshrc b/mkshrc index f2f5fd7..9be5faf 100644 --- a/mkshrc +++ b/mkshrc @@ -543,13 +543,10 @@ colormanpages() { #|_| |_|_|___/\___| |_| \__,_|_| |_|\___|\__|_|\___/|_| |_|___/ #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% set_editor() { - export EDITOR="vi" + # export EDITOR="vi" - if [ -x "$(which nvim)" ] ; then - export EDITOR="$(which nvim)" - elif [ -x "$(which vim)" ] ; then - export EDITOR="$(which vim)" - fi + export EDITOR="$(which ed mg nano vi vim nvim 2>/dev/null | tail -n1)" + export VISUAL="$EDITOR" # Set an alias for our editor of choice alias vi="$EDITOR" @@ -607,7 +604,6 @@ COLOR=1 set_pager set_editor export PATH="$HOME/bin:$PATH" -export VISUAL="$EDITOR" export GOPATH=$HOME/go export PATH=$PATH:$GOPATH/bin -- cgit v1.2.3 From 5880ffbce8b3b2e2d6b4bf2e2600527280d3199d Mon Sep 17 00:00:00 2001 From: Mitch Riedstra Date: Sat, 3 Feb 2018 15:26:20 -0500 Subject: Fall back to regular diff if colordiff isn't available. Default to -F on ls aliases --- mkshrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mkshrc') diff --git a/mkshrc b/mkshrc index 9be5faf..a9a6c0d 100644 --- a/mkshrc +++ b/mkshrc @@ -103,8 +103,8 @@ fi #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% setaliases() { alias ls="ls -F"; - alias l="ls -lh"; - alias ll="ls -l"; + alias l="ls -lhF"; + alias ll="ls -lhF"; alias g="grep"; alias m="$PAGER"; alias j="jobs"; @@ -127,7 +127,7 @@ setcoloraliases() { fi alias grep="grep --color=auto"; - alias diff='colordiff'; + alias diff="$(which diff colordiff 2>/dev/null | tail -n 1)"; alias search='egrep --color=auto -rnI'; alias t='tree -CdL' } -- cgit v1.2.3 From 57ef6eed56a626fd5ff386dce6f71a8ede291e50 Mon Sep 17 00:00:00 2001 From: Mitch Riedstra Date: Sat, 3 Feb 2018 23:42:57 -0500 Subject: Remove egrep from color aliases --- mkshrc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'mkshrc') diff --git a/mkshrc b/mkshrc index a9a6c0d..21f45f2 100644 --- a/mkshrc +++ b/mkshrc @@ -111,9 +111,7 @@ setaliases() { alias p="pwd"; alias gdb='gdb -q' alias bc='bc -q' - alias egrep='egrep --color=auto' alias eg='egrep' - alias egf='egrep --color=force' alias search='egrep -rniI' } @@ -127,6 +125,7 @@ setcoloraliases() { fi alias grep="grep --color=auto"; + alias egrep='egrep --color=auto' alias diff="$(which diff colordiff 2>/dev/null | tail -n 1)"; alias search='egrep --color=auto -rnI'; alias t='tree -CdL' @@ -586,11 +585,12 @@ export LANG="$1"; NEWLINE='$(printf "\n")' SHELL_CONFIG=".mkshrc" -PRELOAD="$HOME/${SHELL_CONFIG}.pre" -LOCAL="$HOME/${SHELL_CONFIG}.local" -UPDATE_URL="https://www.rygel.us/etc/" FANCY_PROMPT=1 COLOR=1 +UPDATE_URL="https://www.rygel.us/etc/" + +PRELOAD="$HOME/${SHELL_CONFIG}.pre" +LOCAL="$HOME/${SHELL_CONFIG}.local" # For use with SSL functions # Just use easy-rsa, it's less hassle -- cgit v1.2.3 From 156297140380bf4b46d8058e7e6df0b56637fda4 Mon Sep 17 00:00:00 2001 From: Mitch Riedstra Date: Wed, 7 Feb 2018 21:13:12 -0500 Subject: Remove -s from hostname do to incompatibilities with GNU hostname on Void Linux --- mkshrc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'mkshrc') diff --git a/mkshrc b/mkshrc index 21f45f2..64012fe 100644 --- a/mkshrc +++ b/mkshrc @@ -38,12 +38,12 @@ precmd() { (( e )) && print -n "$e|" } set_ps1() { - PS1='$(precmd)${BG}${ACCENT_C}${ACCENT_P}${USER_C}${USER:=$(id -un)}@$(hostname -s)${ACCENT_C}${ACCENT_P} ${ACCENT_P}${PATH_C}${PWD:-?}${ACCENT_C}${ACCENT_P}${END_C} + PS1='$(precmd)${BG}${ACCENT_C}${ACCENT_P}${USER_C}${USER:=$(id -un)}@$(hostname)${ACCENT_C}${ACCENT_P} ${ACCENT_P}${PATH_C}${PWD:-?}${ACCENT_C}${ACCENT_P}${END_C} ${END_P} ' export PS1; } set_root_ps1() { -PS1='$(precmd)${BG}${ACCENT_C}${ACCENT_P}${HOST_C}$(hostname -s)${ACCENT_C}${ACCENT_P} ${ACCENT_P}${PATH_C}${PWD:-?}${ACCENT_C}${ACCENT_P}${END_C} +PS1='$(precmd)${BG}${ACCENT_C}${ACCENT_P}${HOST_C}$(hostname)${ACCENT_C}${ACCENT_P} ${ACCENT_P}${PATH_C}${PWD:-?}${ACCENT_C}${ACCENT_P}${END_C} ${END_P} ' export PS1; } @@ -52,7 +52,7 @@ set_prompt() { if [ `id -u` -eq 0 ] ; then # Previously # Red for root, and no username - # PS1="$(hostname -s) \$PWD + # PS1="$(hostname) \$PWD BG="" ACCENT_C="" ACCENT_P="|" @@ -63,7 +63,7 @@ set_prompt() { set_root_ps1 else # Previously - # PS1="${USER:=$(id -un)}@$(hostname -s) \$PWD + # PS1="${USER:=$(id -un)}@$(hostname) \$PWD BG="" ACCENT_C="" ACCENT_P="|" @@ -75,7 +75,7 @@ set_prompt() { fi } set_basic_prompt() { - PS1="$(precmd)${USER:=$(id -un)}@$(hostname -s) \$PWD $ " + PS1="$(precmd)${USER:=$(id -un)}@$(hostname) \$PWD $ " export PS1; } set_super_basic_prompt() { -- cgit v1.2.3 From 1b90b7a843b46f6a3e2f695804e351d7ded44848 Mon Sep 17 00:00:00 2001 From: Mitch Riedstra Date: Thu, 8 Feb 2018 20:22:02 -0500 Subject: Add in xbps aliases as well as a way to include the mkshrc in the global profile --- mkshrc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'mkshrc') diff --git a/mkshrc b/mkshrc index 64012fe..af09ae7 100644 --- a/mkshrc +++ b/mkshrc @@ -8,6 +8,10 @@ # # Personally I use this with mksh, .mkshrc is auto loaded by mksh +# Nifty little line that will force the script to return if it's not runnking KSH +# Automatically uncommented if installed system-wide with "install_mkshrc_system" +# [ -z "$KSH_VERSION" ] && return + # This will hopefully fix the bullshit with zsh if \ [ $SHELL = "/bin/zsh" ] || \ @@ -134,16 +138,20 @@ setcoloraliases() { setsudoaliases() { if which sudo > /dev/null 2>&1 && [ -x "$(which sudo)" ] ; then # Package managers + # Isn't it amazing how many distros you end up using? alias apt-get='sudo apt-get' alias yum='sudo dnf' alias dnf='sudo dnf' alias pacman='sudo pacman' + alias xbps-install='sudo xbps-install' + alias xbps-remove='sudo xbps-remove' alias pkg='sudo pkg' # Filesystem utilities alias zfs='sudo zfs' alias btrfs='sudo btrfs' alias mount='sudo mount' + alias umount='sudo umount' fi } -- cgit v1.2.3