Difference between revisions of "Better Bash Configs"

From TheBeard Science Project Wiki
Jump to: navigation, search
Line 34: Line 34:
 
         echo -e "\nset mark-symlinked-directories on" >>~/.inputrc
 
         echo -e "\nset mark-symlinked-directories on" >>~/.inputrc
 
fi
 
fi
 +
 +
# For on-the-fly $IFS manipulation
 +
alias ifs='IFS=$(echo -en "\x0a\x08")'
 +
alias unifs='IFS=$(echo -en "\x20\x09\x0a")'
 +
  
 
</source>
 
</source>

Revision as of 19:49, 12 January 2020

These are just some things I add to my bashrc for enhancing the features of Bash.

# Because sometimes I manipulate $IFS and forget what to change it back to
export SAVEIFS=$IFS

# Set your default editor for systemd (like when using systemctl edit thing.service)
export SYSTEMD_EDITOR="/usr/bin/vim"

# Stop putting quotes around files/folders that have spaces
export QUOTING_STYLE=literal

# Make it so the screen doesn't blank out after a period of time
setterm -blank 0 >&/dev/null

# Set a nice font
setfont /usr/share/consolefonts/Lat15-TerminusBold22x11.psf.gz >&/dev/null

# For better tab completion on symlink directories
# Normal behavior: With folder symlink "Documents", Type "Doc", Tab once auto-completes
#                  to "Documents", Tab again it completes to "Documents/".
# New behavior:    With folder symlink "Documents", Type "Doc", Tab once auto-completes
#                  to "Documents/". Nice.
if ! [ -d "~/.inputrc" ];then
        if [ -r "/etc/inputrc" ];then
                cp /etc/inputrc ~/.inputrc
        elif [ -r "/etc/inputrc.default" ];then
                cp /etc/inputrc.default ~/.inputrc
        else
                touch ~/.inputrc
        fi
        echo -e "\nset mark-symlinked-directories on" >>~/.inputrc
fi

# For on-the-fly $IFS manipulation
alias ifs='IFS=$(echo -en "\x0a\x08")'
alias unifs='IFS=$(echo -en "\x20\x09\x0a")'