-
Notifications
You must be signed in to change notification settings - Fork 0
/
useful_bash.sh
41 lines (33 loc) · 1.42 KB
/
useful_bash.sh
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
export PATH="$HOME/.local/share/bob/nvim-bin:$HOME/.local/bin:$HOME/go/bin:$PATH"
export GOPATH=$HOME/go
function vimgrep_and_open() {
rg -i --vimgrep "$@" | nvim -q -
}
function replace_rg_with_vg_and_open() {
replaced=$(history 2 | head -n 1 | sed 's/[[:space:]]*[0-9]*[[:space:]]*rg/vg/')
eval $replaced | nvim -q -
}
alias vc='cd ~/.config/nvim && vim'
alias vim='nvim'
alias vimdiff="nvim -d"
alias kx='SHELL= kubectx'
alias ks='SHELL= kubens'
alias gs='git switch "$(git branch --all | fzf | sed s,remotes\/origin\/,, | tr -d '[:space:]')"'
alias dev='cd /mnt/c/dev'
alias rg='rg -i'
alias vg='rg -i --vimgrep'
alias vgg='vimgrep_and_open'
alias rr='replace_rg_with_vg_and_open'
alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
alias bat='bat --paging=never'
alias xclip="xclip -selection c"
# rg ENV -l | xargs sed -i 's/ENV/something/' for find and replace
# rg -p foo | less -R for paging rg results
# rg --hidden --glob '!.git' --glob '!.vs' 2.7.3 for including hidden files with ignored globs
eval "$(fzf --bash)"
export EDITOR=nvim
export PATH=~/.nvm/versions/node/v20.9.0/bin:$PATH
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
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
eval "$(zoxide init bash)"