2017-02-24 15:02:49 +00:00
|
|
|
# .bashrc bash start script
|
2018-03-14 09:10:45 +00:00
|
|
|
# (c) Pcht 2007-2018
|
2016-11-14 13:56:32 +00:00
|
|
|
|
|
|
|
# If not running interactively, don't do anything
|
|
|
|
[ -z "$PS1" ] && return
|
|
|
|
|
|
|
|
# autocheck local mail
|
|
|
|
export MAIL=/var/mail/$USER
|
|
|
|
export MAILCHECK=30
|
|
|
|
|
|
|
|
export EDITOR=vim
|
|
|
|
|
2018-03-14 09:10:45 +00:00
|
|
|
export PATH=".:$HOME/bin:$HOME/.local/bin:$PATH:/usr/sbin:/sbin"
|
2016-11-14 13:56:32 +00:00
|
|
|
export LANG=fr_FR.UTF-8
|
|
|
|
|
|
|
|
# history : don't put duplicate lines in the history. Ignore line begin with space
|
|
|
|
export HISTCONTROL=ignoredups:ignorespace
|
|
|
|
# ... add timestamp
|
|
|
|
export HISTTIMEFORMAT="[%d/%m/%Y %H:%M:%S] "
|
|
|
|
### append history to file
|
|
|
|
shopt -s histappend
|
|
|
|
### check before use history command (like !!)
|
|
|
|
shopt -s histverify
|
|
|
|
|
|
|
|
# check the window size after each command and, if necessary,
|
|
|
|
# update the values of LINES and COLUMNS.
|
|
|
|
shopt -s checkwinsize
|
|
|
|
|
|
|
|
## autocd
|
|
|
|
shopt -s autocd
|
|
|
|
|
|
|
|
# make less more friendly for non-text input files, see lesspipe(1)
|
|
|
|
[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"
|
|
|
|
|
|
|
|
# from http://thesmithfam.org/blog/2009/01/06/best-bash-prompt-ever/#comments
|
|
|
|
# color change with $? result
|
|
|
|
BLACK="\[\033[0;30m\]"
|
|
|
|
DARK_GRAY="\[\033[1;30m\]"
|
|
|
|
LIGHT_GRAY="\[\033[0;37m\]"
|
|
|
|
BLUE="\[\033[0;34m\]"
|
|
|
|
LIGHT_BLUE="\[\033[1;34m\]"
|
|
|
|
GREEN="\[\033[0;32m\]"
|
|
|
|
LIGHT_GREEN="\[\033[1;32m\]"
|
|
|
|
CYAN="\[\033[0;36m\]"
|
|
|
|
LIGHT_CYAN="\[\033[1;36m\]"
|
|
|
|
RED="\[\033[0;31m\]"
|
|
|
|
LIGHT_RED="\[\033[1;31m\]"
|
|
|
|
PURPLE="\[\033[0;35m\]"
|
|
|
|
LIGHT_PURPLE="\[\033[1;35m\]"
|
|
|
|
BROWN="\[\033[0;33m\]"
|
|
|
|
YELLOW="\[\033[1;33m\]"
|
|
|
|
WHITE="\[\033[1;37m\]"
|
|
|
|
DEFAULT_COLOR="\[\033[00m\]"
|
|
|
|
|
2017-02-24 15:02:49 +00:00
|
|
|
# very basic prompt -- more in .bash_prompt
|
|
|
|
PROMPT_COMMAND='PS1="[\u@\h] -- \w "; echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
|
|
|
|
|
|
|
|
# I love google-chrome :)
|
2016-11-14 13:56:32 +00:00
|
|
|
export BROWSER=google-chrome
|
|
|
|
|
2017-02-24 15:02:49 +00:00
|
|
|
# very min bash aliases
|
2016-11-15 11:01:21 +00:00
|
|
|
alias ls='ls -F --color'
|
|
|
|
alias l='ls -l'
|
|
|
|
alias ll='ls -al'
|
2017-02-24 15:02:49 +00:00
|
|
|
|
2018-04-06 12:49:51 +00:00
|
|
|
### dotfiles stuff
|
2017-02-24 15:02:49 +00:00
|
|
|
test -f ~/dotfiles/.bash_aliases && source ~/dotfiles/.bash_aliases
|
2018-04-06 12:49:51 +00:00
|
|
|
test -f ~/dotfiles/.bash_prompt && source ~/dotfiles/.bash_prompt
|
|
|
|
test -d ~/dotfiles/bash_completion && { for f in ~/dotfiles/bash_completion/*.bash; do source $f; done; }
|
|
|
|
# To create the file: dircolors -p
|
|
|
|
test -f ~/dotfiles/.dircolors && eval "`dircolors ~/dotfiles/.dircolors`"
|
2017-04-21 10:27:23 +00:00
|
|
|
|
2018-04-06 12:49:51 +00:00
|
|
|
### .local stuffs
|
|
|
|
# manpath
|
2018-03-14 09:10:45 +00:00
|
|
|
export MANPATH=$HOME/.local/share/man:
|
|
|
|
|
2018-04-06 12:49:51 +00:00
|
|
|
### nodejs
|
2017-04-27 08:44:30 +00:00
|
|
|
test -d ~/.local_node/bin && export PATH="$PATH:$HOME/.local_node/bin"
|
|
|
|
|
2018-03-14 09:10:45 +00:00
|
|
|
# autolaunch tmux
|
|
|
|
# https://wiki.archlinux.org/index.php/Tmux#Bash
|
2018-04-06 12:49:51 +00:00
|
|
|
# test $- != *i* && return
|
|
|
|
test -z "$TMUX" -a "$TERM" == "st-256color" && {
|
|
|
|
test -n "$(tmux ls 2>/dev/null)" && exec tmux attach || exec tmux
|
|
|
|
}
|
|
|
|
|
2019-01-16 11:58:23 +00:00
|
|
|
# added by Nix installer
|
|
|
|
if [ -e /home/patrick/.nix-profile/etc/profile.d/nix.sh ]; then . /home/patrick/.nix-profile/etc/profile.d/nix.sh; fi
|
|
|
|
|
2019-01-16 11:49:13 +00:00
|
|
|
# golang env
|
|
|
|
export PATH=$PATH:/home/patrick/src/golang/go1.11.2/bin
|
|
|
|
export GOPATH=/home/patrick/devel/golang
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-24 15:02:49 +00:00
|
|
|
# end .bashrc
|