summaryrefslogtreecommitdiff
path: root/.bash_aliases
blob: 5ec230d1f5738861053f1f055f37680a2b29fd0a (plain)
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
alias books="cd $HOME/Documents/books"
alias calcurse="calcurse -D ~/.config/calcurse"
alias cdgo="cd $HOME/code/go/src/github.com/HelixBePraised"
alias code="cd $HOME/code"
alias dox="cd $HOME/Documents"
alias dl="cd $HOME/Downloads"
alias gs="git status"
alias jojo="cd $HOME/Documents/books/manga/jojos_bizarre_adventure"
alias ll="ls -lAh"
alias ls="ls -A --color=auto --group-directories-first"
alias music-dl="youtube-dl -x --audio-format mp3 "
# alias music="cd $HOME/Music"
alias pix="cd $HOME/Pictures"
alias ranger="ranger_cd"
alias site="cd ~/code/jacksontaylor.xyz"
alias up="cd ../"
alias vim="nvim"
alias wiki="nvim +VimwikiIndex"

# Function to cd to last open dir in ranger
ranger_cd() {
	temp_file="$(mktemp -t "ranger_cd.XXXXXXXXXX")"
	ranger="${1:-ranger}"
	if [ -n "$1" ]; then
	    shift
	fi
	"$ranger" --choosedir="$temp_file" -- "${@:-$PWD}"
	return_value="$?"
	if chosen_dir="$(cat -- "$temp_file")" && [ -n "$chosen_dir" ] && [ "$chosen_dir" != "$PWD" ]; then
	    cd -- "$chosen_dir"
	fi
	rm -f -- "$temp_file"
	return "$return_value"
}