.bashrc: add tmux autorun/attach; clean

This commit is contained in:
masterzu 2018-04-06 14:49:51 +02:00
parent f038738232
commit e7e80b08d8
1 changed files with 13 additions and 20 deletions

33
.bashrc
View File

@ -8,13 +8,11 @@
export MAIL=/var/mail/$USER export MAIL=/var/mail/$USER
export MAILCHECK=30 export MAILCHECK=30
export EDITOR=vim export EDITOR=vim
export PATH=".:$HOME/bin:$HOME/.local/bin:$PATH:/usr/sbin:/sbin" export PATH=".:$HOME/bin:$HOME/.local/bin:$PATH:/usr/sbin:/sbin"
export LANG=fr_FR.UTF-8 export LANG=fr_FR.UTF-8
# history : don't put duplicate lines in the history. Ignore line begin with space # history : don't put duplicate lines in the history. Ignore line begin with space
export HISTCONTROL=ignoredups:ignorespace export HISTCONTROL=ignoredups:ignorespace
# ... add timestamp # ... add timestamp
@ -31,7 +29,6 @@ shopt -s checkwinsize
## autocd ## autocd
shopt -s autocd shopt -s autocd
# make less more friendly for non-text input files, see lesspipe(1) # make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)" [ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"
@ -58,14 +55,6 @@ DEFAULT_COLOR="\[\033[00m\]"
# very basic prompt -- more in .bash_prompt # very basic prompt -- more in .bash_prompt
PROMPT_COMMAND='PS1="[\u@\h] -- \w "; echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"' PROMPT_COMMAND='PS1="[\u@\h] -- \w "; echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
test -f ~/dotfiles/.bash_prompt && source ~/dotfiles/.bash_prompt
# dircolors
# To create the file: dircolors -p
if [ -f ~/dotfiles/.dircolors ]; then
eval "`dircolors ~/dotfiles/.dircolors`"
fi
# I love google-chrome :) # I love google-chrome :)
export BROWSER=google-chrome export BROWSER=google-chrome
@ -74,21 +63,25 @@ alias ls='ls -F --color'
alias l='ls -l' alias l='ls -l'
alias ll='ls -al' alias ll='ls -al'
### dotfiles stuff
test -f ~/dotfiles/.bash_aliases && source ~/dotfiles/.bash_aliases test -f ~/dotfiles/.bash_aliases && source ~/dotfiles/.bash_aliases
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`"
### manpath ### .local stuffs
# manpath
export MANPATH=$HOME/.local/share/man: export MANPATH=$HOME/.local/share/man:
### nodejs
# nodejs
test -d ~/.local_node/bin && export PATH="$PATH:$HOME/.local_node/bin" test -d ~/.local_node/bin && export PATH="$PATH:$HOME/.local_node/bin"
# RUST env https://www.rust-lang.org/fr-FR/
# test -f $HOME/.cargo/env && source $HOME/.cargo/env
# autolaunch tmux # autolaunch tmux
# https://wiki.archlinux.org/index.php/Tmux#Bash # https://wiki.archlinux.org/index.php/Tmux#Bash
# [[ $- != *i* ]] && return # test $- != *i* && return
# [[ -z "$TMUX" ]] && exec tmux test -z "$TMUX" -a "$TERM" == "st-256color" && {
test -n "$(tmux ls 2>/dev/null)" && exec tmux attach || exec tmux
}
# end .bashrc # end .bashrc