Added if statement for pkgfile, syntax highlighting for less, added

weechat alias.
This commit is contained in:
David Thurstenson 2016-01-21 13:42:34 -06:00
parent b912cc3a2c
commit 2faa1e480a
1 changed files with 34 additions and 4 deletions

36
.bashrc
View File

@ -3,17 +3,32 @@
# #
# Thurstylark # Thurstylark
### MISC ###
# If not running interactively, don't do anything # If not running interactively, don't do anything
[[ $- != *i* ]] && return [[ $- != *i* ]] && return
export EDITOR=vim
# Don't put duplicate lines or lines starting with space in the history. # Don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options # See bash(1) for more options
HISTCONTROL=ignoreboth HISTCONTROL=ignoreboth
# Enable pkgfile to automatically search for packages: # Prefer vim, but if it's not installed, nano will do
if [[ -s /usr/bin/vim ]]; then
export EDITOR=vim
else
export EDITOR=nano
fi
# Enable pkgfile to automatically search for packages if pkgfile is installed
if [[ -s /usr/share/doc/pkgfile/command-not-found.bash ]];then
source /usr/share/doc/pkgfile/command-not-found.bash source /usr/share/doc/pkgfile/command-not-found.bash
fi
# Enable less syntax hilighting if src-hilight is installed
if [[ -s /usr/bin/src-hilite-lesspipe.sh ]]; then
export LESSOPEN="| /usr/bin/src-hilite-lesspipe.sh %s"
export LESS=' -R '
fi
# If a directory is given without any # If a directory is given without any
# command, CD into it. # command, CD into it.
@ -59,3 +74,18 @@ alias lsblk='lsblk -o NAME,FSTYPE,SIZE,TYPE,MOUNTPOINT'
# Always use sudo when using systemctl. Pairs well with passwordless sudo for systemctl. # Always use sudo when using systemctl. Pairs well with passwordless sudo for systemctl.
alias systemctl='sudo --preserve-env systemctl' alias systemctl='sudo --preserve-env systemctl'
# I'm tired of managing weechat configs and multiple nicks
# Client depends: ssh, mosh, correct ssh host configuration
# Server depends: ssh, mosh, screen, weechat, weechat.service (custom)
# Only do this if weechat isn't installed and you aren't thurstyserv
if [[ ! -s /usr/bin/weechat ]]; then
# Connect to the existing screen session through mosh
# (disconnecting it elsewhere if necessary)
alias weechat='mosh home -- screen -dr weechat'
elif [[ "$HOSTNAME" -eq "thurstyserv" ]]; then
# Connect to the existing screen session locally
# (disconnecting it elsewhere if necessary)
alias weechat='screen -dr weechat'
fi