mirror of https://github.com/fredrikekre/.dotfiles
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.3 KiB
54 lines
1.3 KiB
# Common commands for .bashrc. Include by adding the following to .bashrc: |
|
# |
|
# # Include cross-system common parts from .dotfiles.git repo |
|
# if [ -f ~/.bashrc.dotfiles ]; then |
|
# . ~/.bashrc.dotfiles |
|
# fi |
|
|
|
# If not running interactively, don't do anything |
|
case $- in |
|
*i*) ;; |
|
*) return;; |
|
esac |
|
|
|
# Start tmux by default |
|
if command -v tmux &> /dev/null && [ -z "$TMUX" ]; then |
|
if tmux ls | grep "default: " > /dev/null; then |
|
tmux attach -t default |
|
else |
|
tmux new -s default |
|
fi |
|
fi |
|
|
|
# dotfiles alias |
|
alias dotfiles='git --git-dir="$HOME/.dotfiles.git/" --work-tree="$HOME/"' |
|
|
|
# Bash prompt |
|
if [[ "${TERM}" =~ 256 ]]; then |
|
# Colors from vim-airline bubblegum theme: 110 blue, 150 green |
|
PS1="[\[\e[38;5;150m\e[1m\]\u@\h\[\e[0m\]:\[\e[38;5;110m\e[1m\]\w\e[0m\]]\$ " |
|
else |
|
PS1="[\[\e[32m\e[1m\]\u@\h\[\e[0m\]:\[\e[34m\e[1m\]\w\[\e[0m\]]\$ " |
|
fi |
|
export PS1 |
|
|
|
# Julia environment variables |
|
export JULIA_PKG_DEVDIR=$HOME/dev |
|
export JULIA_PROJECT=@. |
|
|
|
# Add private bin directories to PATH |
|
PATH="$HOME/bin:$HOME/.local/bin:$PATH" |
|
|
|
# Enable direnv |
|
if command -v direnv &> /dev/null ; then |
|
eval "$(direnv hook bash)" |
|
# alias tmux='direnv exec / tmux' |
|
fi |
|
|
|
# Set the editor |
|
if command -v nvim &> /dev/null; then |
|
alias vim=nvim |
|
export EDITOR=nvim |
|
else |
|
export EDITOR=vim |
|
fi
|
|
|