Files
dots/bash/.bashrc
2019-03-17 12:42:11 -05:00

67 lines
1.6 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 -# 2'
# 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
#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
if [ ! -z "$VIRTUAL_ENV" ]; then
#export PS1="[$(basename "$VIRTUAL_ENV")] \[\u@\h \W]\\$"
export PS1="[$(basename "$VIRTUAL_ENV")] $PS1"
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