dotfiles/dot_bashrc
2020-08-09 20:38:54 +02:00

55 lines
1.5 KiB
Bash

#!/usr/bin/env bash
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
[[ $DISPLAY ]] && shopt -s checkwinsize
[ -r /usr/share/bash-completion/bash_completion ] && . /usr/share/bash-completion/bash_completion
## Enable color on ls and grep
alias ls='ls --color=auto'
alias grep='grep --color=auto'
## Add .local/bin to path
#export PATH="${HOME}/.local/bin:${PATH}"
if [[ -d "${HOME}/.cargo/bin" ]]; then
export PATH="${HOME}/.cargo/bin:${PATH}"
fi
if [[ -d "${HOME}/.yarn/bin" ]]; then
export PATH="${HOME}/.yarn/bin:${PATH}"
fi
vterm_printf(){
if [ -n "$TMUX" ]; then
# Tell tmux to pass the escape sequences through
# (Source: http://permalink.gmane.org/gmane.comp.terminal-emulators.tmux.user/1324)
printf "\ePtmux;\e\e]%s\007\e\\" "$1"
elif [ "${TERM%%-*}" = "screen" ]; then
# GNU screen (screen, screen-256color, screen-256color-bce)
printf "\eP\e]%s\007\e\\" "$1"
else
printf "\e]%s\e\\" "$1"
fi
}
vterm_prompt_end(){
vterm_printf "\u@\[\e[37m\]\h\[\e[m\]:\[\e[32m\]\w\[\e[m\]\[\e[31m\]\\$\[\e[m\] "
}
PS1=$PS1'\[$(vterm_prompt_end)\]'
alias E="SUDO_EDITOR=\"emacsclient -a emacs\" sudoedit"
alias e="emacsclient"
#if [[ -d "/mnt/data3/Programs/bin" ]]; then
# export PATH="/mnt/data3/Programs/bin:${PATH}"
#fi
## Set prompt
export PS1="\u@\[\e[37m\]\h\[\e[m\]:\[\e[32m\]\w\[\e[m\]\[\e[31m\]\\$\[\e[m\] "
export EDITOR="emacsclient"
export BROWSER="firefox-nightly"