Xinqi Bao's Git

docs: keep readme focused on setup
[dotfiles.git] / .bashrc
1 #
2 # ~/.bashrc
3 #
4
5 # If not running interactively, don't do anything
6 [[ $- != *i* ]] && return
7
8 export PATH="${HOME}/.local/opt/node/bin:${PATH}"
9 export PATH="${HOME}/.local/bin:${PATH}"
10 export PATH="${HOME}/tool:${PATH}"
11
12 # Let mise take precedence over Cargo and local tools.
13 [ -f "${HOME}/.cargo/env" ] && . "${HOME}/.cargo/env"
14 if command -v mise >/dev/null 2>&1; then
15 eval "$(mise activate bash)"
16 fi
17
18 alias ls='ls --color=auto'
19 alias ll='ls -lhrt'
20
21 alias vim='nvim'
22 alias vimdiff='nvim -d'
23 export EDITOR=nvim
24
25 PS1='[\[\e[36;1m\]\u@\h \[\e[32;1m\]\w\[\e[m\]]\[\e[33m\]($(git symbolic-ref --quiet --short HEAD 2>/dev/null || git rev-parse --short HEAD 2>/dev/null))\n\[\e[m\]~~~>\$ '
26
27 ulimit -c unlimited
28
29 #export proxy_url=http://localhost:1080
30 #export http_proxy=$proxy_url
31 #export https_proxy=$proxy_url
32 #export HTTP_PROXY=$proxy_url
33 #export HTTPS_PROXY=$proxy_url
34
35 # fzf key bindings and completion
36 eval "$(fzf --bash)"
37 export FZF_CTRL_T_OPTS="--preview 'bat --style=numbers --color=always --line-range :500 {}'"
38
39 if [[ -z ${DISPLAY:-} && -z ${WAYLAND_DISPLAY:-} && ${XDG_VTNR:-} == 1 ]]; then
40 exec startx
41 fi