-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bashrc
59 lines (47 loc) · 1.25 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
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
export SNIP_PAGER="bat"
export PAGER="most"
export EDITOR="nvim"
export VISUAL="nvim"
# Go forward in Git commit hierarchy, towards particular commit
# Usage:
# gofwd v1.2.7
# Does nothing when the parameter is not specified.
gofwd() {
git checkout $(git rev-list --topo-order HEAD.."$*" | tail -1)
}
cfmt() {
touch $1.formatted
clang-format $1 > $1.formatted
mv $1.formatted $1
}
# Usage:
# mcfmt <name pattern>
mcfmt() {
find . -name "$1" -type f -exec bash -c 'echo formatting "$0" && clang-format "$0" > "$0".2 && mv "$0".2 "$0"' {} \;
}
sadconv() {
rm -rf html
mkdir html
find . -name "*.sad" -type f -exec sh -c 'echo Converting $0 && sadhtml $0 && mkdir -p html/$(dirname $0) && mv $0.html html/$0.html' {} \;
}
gitsafe() {
git config --global --add safe.directory $(pwd -P)
}
# Go back in Git commit hierarchy
# Usage:
# goback
alias goback='git checkout HEAD~'
alias mmpv='mpv --no-video'
alias runter='shutdown now'
alias ls='exa --color=auto -l --icons'
alias fixkeyboard='sudo g810-led -a ffffff'
source /usr/share/git/completion/git-prompt.sh
PS1='[\u@\h \W]\$ '
pasfetch
pasmotd cyan bold underline
source ~/.local/share/blesh/ble.sh