-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot-bashrc
59 lines (49 loc) · 1.47 KB
/
dot-bashrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific environment
if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]
then
PATH="$HOME/.local/bin:$HOME/bin:$PATH"
fi
export PATH
# User specific aliases and functions
if [ -d ~/.bashrc.d ]; then
for rc in ~/.bashrc.d/*; do
if [ -f "$rc" ]; then
. "$rc"
fi
done
fi
# customization of terminal prompt
# setup inspired by https://unix.stackexchange.com/questions/105958/terminal-prompt-not-wrapping-correctly
# and https://askubuntu.com/questions/670594/making-bash-prompt-bold
red="\001$(tput setaf 1)\002"
green="\001$(tput setaf 2)\002"
blue="\001$(tput setaf 4)\002"
cyan="\001$(tput setaf 6)\002"
bold="\001$(tput bold)\002"
reset="\001$(tput sgr0)\002"
bred=$bold$red
bcyan=$bold$cyan
PS1="$bred\u@\h"
PS1+="$reset:"
PS1+="$bcyan\w"
PS1+="$reset\$ "
unset red green blue cyan bold reset bred bcyan
unset rc
export PATH=~/.local/bin:"$PATH"
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
. "$HOME/.cargo/env"
alias obsidian="~/.appimages/Obsidian-1.5.3.AppImage"
# enable vi mode
set -o vi
EDITOR=lvim
export PATH="$PATH:$HOME/.local/bin"
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
. "$HOME/.cargo/env"