From 9e7a4bb2c129d14b24b822bd801b08b776eb6c84 Mon Sep 17 00:00:00 2001 From: Scott Wallace Date: Sun, 20 Jan 2019 12:01:48 +0000 Subject: [PATCH] Tidy up RC files --- .bashrc | 12 +++--------- .inputrc | 3 ++- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.bashrc b/.bashrc index 487d900..49171e4 100755 --- a/.bashrc +++ b/.bashrc @@ -67,23 +67,17 @@ pathadd ~/bin #-------------------------------------------------------------------------------- # Set some variables #-------------------------------------------------------------------------------- +# Add the Homebrew API token, if appropriate if [ -x "$(which brew 2>/dev/null)" ]; then export HOMEBREW_GITHUB_API_TOKEN=$(getkey HOMEBREW_GITHUB_API_TOKEN) 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) #-------------------------------------------------------------------------------- function _deferred { + # Bash completion with Homebrew if [ -f $(brew --prefix 2>/dev/null)/etc/bash_completion ]; then . $(brew --prefix 2>/dev/null)/etc/bash_completion 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 gdu 2>/dev/null) ]] && function du() { gdu ${@}; } && export -f du [[ -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" export GIT_SSH_COMMAND="$(which ssh) -o RemoteCommand=none" #-------------------------------------------------------------------------------- diff --git a/.inputrc b/.inputrc index e791dec..e12d964 100644 --- a/.inputrc +++ b/.inputrc @@ -1,5 +1,6 @@ set bell-style visible set prefer-visible-bell 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 +"\C-t": forward-search-history