-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmybashrc
More file actions
78 lines (56 loc) · 1.78 KB
/
mybashrc
File metadata and controls
78 lines (56 loc) · 1.78 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/sh
# remove annoying message macos
export BASH_SILENCE_DEPRECATION_WARNING=1
export XDG_CONFIG_HOME="$HOME/.config"
# Add .local/bin path
export PATH=$PATH:~/.local/bin
# Add cargo/rust binaries
export PATH=$PATH:~/.cargo/bin
# this is to avoid problems with ctrl-s ctrl-q
stty -ixon
export OLD_TERM=$TERM
export TERM=xterm-256color
export EDITOR="/usr/bin/vim"
# get repo completion
#. ~/Dev/repo.bash_completion/repo.bash_completion
if [ -z ${ZSH_NAME+x} ]; then
# color prompt green and bold cyan for bash
PS1='\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[00;32m\]\u@\h\[\033[00m\]:\[\033[01;36m\]\w\[\033[00m\]\$ ';
else
# zsh prompt
PROMPT='%F{green}%n@%m%f %F{blue}%~%f $ '
fi
alias glog="git log --oneline"
# Add snaps
export PATH=$PATH:/snap/bin
# Add default go path
export PATH=$PATH:~/go/bin
# Add custom personal path
export PATH=~/.bin:$PATH
# Avoid duplicates in history
export HISTCONTROL=ignoredups
# Common aliases
alias ls='ls --color=auto'
alias l=ls
alias ll="ls -l"
alias la="ls -a"
if [[ `uname` == 'Darwin' ]]
then
# Aliases for macOS
alias python=python3
alias pip=pip3
# Assuming this is zsh, add this to allow vscode terminal to work correctly, as
# explained https://github.com/microsoft/vscode-docs/issues/5221#issuecomment-1061081538
bindkey -e
# This is for the delete key to work in zsh in vscode terminal
bindkey "^[[3~" delete-char
# Prompt in macOS will have different colours. Rationale: this is likely a laptop, so
# it makes sense to distinguish it compared to remote machines.
# for colours, check https://wiki.archlinux.org/title/zsh
PROMPT='%B%F{037}%n@%m%f %b%F{072}%~%f $ '
setopt histignorealldups
fi
# Ripgrep config
export RIPGREP_CONFIG_PATH="$HOME/.ripgreprc"
# Accelerate HF transfer
export HF_XET_HIGH_PERFORMANCE=1