Tidy up RC files

This commit is contained in:
Scott Wallace 2019-01-20 12:01:48 +00:00
parent 4b4a220ed7
commit 9e7a4bb2c1
2 changed files with 5 additions and 10 deletions

12
.bashrc
View file

@ -67,23 +67,17 @@ pathadd ~/bin
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
# Set some variables # Set some variables
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
# Add the Homebrew API token, if appropriate
if [ -x "$(which brew 2>/dev/null)" ]; then if [ -x "$(which brew 2>/dev/null)" ]; then
export HOMEBREW_GITHUB_API_TOKEN=$(getkey HOMEBREW_GITHUB_API_TOKEN) export HOMEBREW_GITHUB_API_TOKEN=$(getkey HOMEBREW_GITHUB_API_TOKEN)
fi fi
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
#--------------------------------------------------------------------------------
# Rebind CTRL-T to search forward in history
#--------------------------------------------------------------------------------
if [ -n "$PS1" ]; then
bind "\C-t":forward-search-history
fi
#--------------------------------------------------------------------------------
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
# Add bash completion scripts (deferred until the end and backgrounded) # Add bash completion scripts (deferred until the end and backgrounded)
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
function _deferred { function _deferred {
# Bash completion with Homebrew
if [ -f $(brew --prefix 2>/dev/null)/etc/bash_completion ]; then if [ -f $(brew --prefix 2>/dev/null)/etc/bash_completion ]; then
. $(brew --prefix 2>/dev/null)/etc/bash_completion . $(brew --prefix 2>/dev/null)/etc/bash_completion
fi fi
@ -130,7 +124,7 @@ if ! alias ll >/dev/null 2>&1; then function ll() { ls -l ${@}; } && export -f l
[[ -x $(which glances 2>/dev/null) ]] && function top() { glances; } && export -f top [[ -x $(which glances 2>/dev/null) ]] && function top() { glances; } && export -f top
[[ -x $(which gdu 2>/dev/null) ]] && function du() { gdu ${@}; } && export -f du [[ -x $(which gdu 2>/dev/null) ]] && function du() { gdu ${@}; } && export -f du
[[ -x $(which gsort 2>/dev/null) ]] && function sort() { gsort ${@}; } && export -f sort [[ -x $(which gsort 2>/dev/null) ]] && function sort() { gsort ${@}; } && export -f sort
[[ -x /bin/ps && -x $(which pstree 2>/dev/null) ]] && function ps() { if [[ ${1} =~ 'f' ]]; then pstree; else /bin/ps ${@}; fi } [[ -x /bin/ps && -x $(which pstree 2>/dev/null) && $(uname -s) = 'Darwin' ]] && function ps() { if [[ ${1} =~ 'f' ]]; then pstree; else /bin/ps ${@}; fi }
[[ -x $(which tree 2>/dev/null) ]] && alias tree="tree -AQh --du" [[ -x $(which tree 2>/dev/null) ]] && alias tree="tree -AQh --du"
export GIT_SSH_COMMAND="$(which ssh) -o RemoteCommand=none" export GIT_SSH_COMMAND="$(which ssh) -o RemoteCommand=none"
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------

View file

@ -1,5 +1,6 @@
set bell-style visible set bell-style visible
set prefer-visible-bell set prefer-visible-bell
set convert-meta on set convert-meta on
"\e[1;5D": backward-word # ctrl + left "\e[1;5D": backward-word # ctrl + left
"\e[1;5C": forward-word # ctrl + right "\e[1;5C": forward-word # ctrl + right
"\C-t": forward-search-history