57 lines
1.9 KiB
Plaintext
57 lines
1.9 KiB
Plaintext
# Complex aliasses
|
|
## Open notes folder in nvim then return
|
|
function notes() { cd $HOME/Notes; nvim; cd -; };
|
|
function sb() { cd $HOME/second-brain/; git pull; nvim; git add .; git commit; git push; cd -; };
|
|
|
|
## Open work folder with fuzzy finder
|
|
function work() {
|
|
work_dirs=( "$HOME/clones" "$HOME/sandbox" "$HOME/TA/" )
|
|
echo $work_dirs
|
|
echo "------"
|
|
work_dirs=( $(find $work_dirs -maxdepth 0 -type d 2> /dev/null) )
|
|
echo $work_dirs
|
|
goto=""
|
|
if [ ! -z $1 ]; then
|
|
goto=$(find $work_dirs -maxdepth 1 -mindepth 1 -type d | fzf -f $1)
|
|
fi
|
|
|
|
if [ -z "$goto" -o $(wc -l <<< "$goto") -ne 1 ]; then
|
|
goto=$(find $work_dirs -maxdepth 1 -mindepth 1 -type d | fzf --query=$1 --preview "tree -C -L 2 {}")
|
|
fi
|
|
|
|
[ -z $goto ] && return
|
|
if [ -z $TMUX ]; then
|
|
tmux new -A -s "$(basename -- $goto)" -c "$goto"
|
|
else
|
|
tmux new -d -s "$(basename -- $goto)" -c "$goto"
|
|
tmux switch-client -t "$(basename -- $goto)"
|
|
fi
|
|
}
|
|
|
|
# simple
|
|
alias clj='rlwrap java -cp ~/Clojure/clojure-1.8.0.jar clojure.main'
|
|
alias ll='ls -l'
|
|
alias la='ls -A'
|
|
alias l='ls -CF'
|
|
alias gpwd='pwd | xclip -i -selection clipboard'
|
|
alias cdclip="cd \$(xclip -o -selection clipboard)"
|
|
alias clipi='xclip -i -selection clipboard'
|
|
alias clipo='xclip -o -selection clipboard'
|
|
alias ssh-agent='ssh-agent -t 1h'
|
|
alias saa='eval $(ssh-agent) && ssh-add'
|
|
alias tm='tmux new -A'
|
|
alias exfs='sudo zpool import external'
|
|
alias uexfs='sudo zpool export external'
|
|
alias socks='ssh -D 8081 -C -q -N home-server'
|
|
alias gmonitor='while [ true ] ; do nvidia-smi; nvidia-settings -q gpucoretemp | grep gpu; sensors| grep CPU; sleep 1; clear; done'
|
|
alias code='code-oss'
|
|
alias conda-activate='source /opt/anaconda/bin/activate'
|
|
alias conda-deactivete='source /opt/anaconda/bin/deactivate'
|
|
alias venv='python -m venv'
|
|
alias venv2='python2 -m venv'
|
|
alias venv3='python3 -m venv'
|
|
alias dotvenv='source .venv/bin/activate'
|
|
alias todo='rusty-tasks'
|
|
alias ccat='bat'
|
|
alias we='watchexec'
|