-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bashrc
75 lines (60 loc) · 1.58 KB
/
.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# exit if in interactive mode
[ -z "$PS1" ] && exit
# env
export TERM="xterm-256color" # getting proper colors
export HISTCONTROL=ignoredups:erasedups # no duplicate entries
# vi-mode
set -o vi
bind -m vi-command 'Control-l: clear-screen'
bind -m vi-insert 'Control-l: clear-screen'
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
### PROMPT
# This is commented out if using starship prompt
# PS1='[\u@\h \W]\$ '
### PATH
if [ -d "$HOME/.bin" ] ;
then PATH="$HOME/.bin:$PATH"
fi
if [ -d "$HOME/.local/bin" ] ;
then PATH="$HOME/.local/bin:$PATH"
fi
if [ -d "$HOME/Applications" ] ;
then PATH="$HOME/Applications:$PATH"
fi
export PATH="$PATH:/opt/crystal/bin:/opt/node/bin"
export PATH="$PATH:$(yarn global bin 2>/dev/null)"
# ignore upper and lowercase when TAB completion
bind "set completion-ignore-case on"
# git with copier
alias g="copier -c github_token 2>&1 > /dev/null && git"
# alias
alias t='tmux'
alias grep="grep --color=auto"
alias cat="bat --style=plain --paging=never --theme=TwoDark"
alias ls="exa -g -l --icons"
alias lsa='ll -la'
alias tree="exa -T"
alias vim='nvim'
alias yr='yarn run --ignore-engines'
# vim
function v () {
arg="$@"
if [[ $# == 0 ]]; then
arg='.'
fi
vim "$arg"
}
# prompt
eval "$(starship init bash)"
# package.json scripts
function packageScripts () {
if ! test -f ./package.json; then
echo "the package.json file does not exists in this pwd ($PWD)"
else
/bin/cat package.json | json-parser - '.scripts' \
| sed 's/{//g' \
| sed 's/}//g' \
| sed "s/'//g"
fi
}