-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.spicy.bashrc
More file actions
44 lines (37 loc) · 1.12 KB
/
.spicy.bashrc
File metadata and controls
44 lines (37 loc) · 1.12 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
# Hi and welcome to my bashrc
# Install instructions for this are in the readme
# sha1 hash an entire directory
# https://stackoverflow.com/questions/545387/linux-compute-a-single-hash-for-a-given-folder-contents
function hashdir
{
# Doesn't take empty dirs / permission into account
find "$1" -type f -print0 | sort -z | xargs -0 sha1sum | sha1sum;
}
# Git "quicksave" for bad habits that die hard :)
function gitquick
{
# Do some cool stuff & exit this script on errors
# (it's a trap!!!)
trap '
last_error_code=$?;
trap - ERR;
echo "something went wrong - error code $last_error_code";
return $last_error_code;
' ERR;
# Stash & unstash working dir
git stash push -u -m "$1"
sleep 0.5
git stash apply
trap - ERR;
}
# Aliases
# Because who uses emacs?
alias info="info --vi-keys"
alias make="make -j$(nproc)"
# To fix ctrl+s not working to scroll forward in ctrl+r reverse-i-search:
# https://stackoverflow.com/questions/12373586/how-to-reverse-i-search-back-and-forth
stty -ixon
# Biiiiig history
HISTSIZE=500000
HISTFILESIZE=500000
# vim: set filetype=bash :