Setting PS1 without checking to see if $TERM was set meant trying to set a terminal prompt in incorrect places (eg via scp) and throwing an error. Also I was sourcing my fzf config without checking whether or not it exists. So it was spitting out errors on hosts that didnt have fzf installed.
63 lines
1.4 KiB
Bash
63 lines
1.4 KiB
Bash
# .bashrc
|
|
|
|
# Source global definitions
|
|
if [ -f /etc/bashrc ]; then
|
|
. /etc/bashrc
|
|
fi
|
|
|
|
# Uncomment the following line if you don't like systemctl's auto-paging feature:
|
|
#export SYSTEMD_PAGER=
|
|
|
|
#pager setup
|
|
#-C faster reprints
|
|
#-F auto quit if less than 1 screen
|
|
#-M more status
|
|
#-I case insensitive
|
|
#-j 5 show X lines above search for context
|
|
#-R fix ansi esc sequences
|
|
## 4 - right/left four chars
|
|
export LESS='-C -M -j 3 -R -# 4'
|
|
|
|
# User specific aliases and functions
|
|
alias l.='ls -lh --time-style=long-iso --color' 2>/dev/null
|
|
alias l='ls -lh --color --time-style=long'
|
|
alias ll='ls -lah --color --time-style=long'
|
|
alias lsd='l -d */'
|
|
alias p='ping'
|
|
alias s='sudo'
|
|
alias dmesg='dmesg -H'
|
|
alias ip='ip -c'
|
|
|
|
#golang stuff
|
|
export GOPATH=$HOME/gopath
|
|
export PATH=$GOPATH:$GOPATH/bin:$PATH
|
|
|
|
export EDITOR=/usr/bin/vim
|
|
|
|
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
|
|
alias p='ping'
|
|
|
|
#ctrl-x, ctrl-e to launch $EDITOR (vim)
|
|
#bind -m vi-insert '"\C-x\C-e": edit-and-execute-command'
|
|
|
|
#fix clear screen in vi mode
|
|
#bind -m vi-insert "\C-l":clear-screen
|
|
|
|
# HISTORY
|
|
#add date/time to history
|
|
export HISTTIMEFORMAT="%F %T: "
|
|
export HISTSIZE=1000
|
|
export HISTFILESIZE=2000
|
|
|
|
# Prompt
|
|
if [ -z $TERM ]; then
|
|
export PS1="\[$(tput bold)\]\[$(tput setaf 2)\][\u@\h \W]\\$ \[$(tput sgr0)\]"
|
|
fi
|
|
|
|
# fedoras stupid command-not-found shit
|
|
unset command_not_found_handle
|
|
|
|
if [ -f /usr/share/fzf/shell/key-bindings.bash ]; then
|
|
source /usr/share/fzf/shell/key-bindings.bash
|
|
fi
|