-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsharedrc
157 lines (117 loc) · 3.53 KB
/
sharedrc
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
#######
# ENV #
#######
# - SCALA BUILD TOOL -
# Tell sbt to not use any other repositories than the ones specified in ~/.sbt/repositories
SBT_OPTS_VAL="-Dsbt.override.build.repos=true"
export SBT_OPTS=$SBT_OPTS_VAL
# Tell sbt launcher where to read the ivy credentials, so that is uses them when fetching new SBT versions
export SBT_CREDENTIALS="$HOME/.ivy2/.credentials"
alias ondebug='export SBT_OPTS="$SBT_OPTS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"'
alias offdebug='SBT_OPTS="$SBT_OPTS_VAL"'
# - RUSTUP -
# Find where Rust should be
# source $HOME/.cargo/env
# - NODE VERSION MANAGER -
# export NVM_DIR="$HOME/.nvm"
# . "/usr/local/opt/nvm/nvm.sh"
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# [ -f ~/.fzf.bash ] && source ~/.fzf.bash
############
# DROP-INS #
############
if [ -x "$(command -v exa)" ]; then
alias ls="exa"
# sane default "exa -bghHliS"
alias lsa="ls --all --long --binary --header --time modified --git"
else
alias lsa="ls -alhG"
fi
if [ -x "$(command -v nvim)" ]; then
alias vim="nvim"
fi
if [ -x "$(command -v emacs-25.2)" ]; then
alias emacs=emacs-25.2
fi
if [ -x "$(command -v ccat)" ]; then
alias cat='ccat --bg="dark"'
fi
#########
# UTILS #
#########
alias subf="subl --command toggle_full_screen" # (sub)lime (f)ullscreen
alias htopp="sudo htop --delay=300"
alias begone-thot="rm -rf"
# https://stackoverflow.com/a/25620447/5835579
docx() { unzip -p $1 word/document.xml | sed -e 's/<[^>]\{1,\}>//g; s/[^[:print:]]\{1,\}//g' }
docxn() { unzip -p $1 word/document.xml | sed -e 's/<\/w:p>/\n/g; s/<[^>]\{1,\}>//g; s/[^[:print:]\n]\{1,\}//g' }
###############
# FAT FINGERS #
###############
alias ripgrep="rg"
alias rgrep="rg"
alias clip-copy="pbcopy"
alias clip-paste="pbpaste"
alias fff="fzf"
##########
# FIXES ##
##########
# unalias mysql
##########
# PYTHON #
##########
alias localhost="python3 -m http.server"
alias workon="source .venv/bin/activate"
alias workoff="deactivate"
alias makevenv="python3 -m venv .venv && source .venv/bin/activate"
##############
# CONTAINERS #
##############
alias nots="jupyter notebook --script"
alias notc="jupyter nbconvert"
#######
# GIT #
#######
# Git commit all prime
alias gcap="git commit --all --verbose"
# Git diff colour word
alias gdcw="git diff --word-diff=color"
alias gdwc="git diff --word-diff=color"
alias git-precommit="git diff --cached --diff-algorithm=minimal -w"
# http://gggritso.com/human-git-aliases
alias git-branches="git branch -a"
alias git-tags="git tag"
alias git-stashes="git stash list"
alias git-unstage="git reset -q HEAD --"
alias git-discard="git checkout --"
alias git-uncommit="git reset --mixed HEAD~"
alias git-amend="git commit --amend --verbose"
alias git-nevermind="!git reset --hard HEAD && git clean -d -f"
alias git-adog="git log --all --decorate --oneline --graph"
alias git-graph2="git log --graph -10 --branches --remotes --tags --format=format:'%Cgreen%h %Creset• %<(75,trunc)%s (%cN, %cr) %Cred%d' --date-order"
# http://gitless.com/
alias git-cloak="git update-index --assume-unchanged"
alias git-uncloak="git update-index --no-assume-unchanged"
#######
# GCC #
#######
alias gcc-uq="gcc -Wall -pedantic -std=gnu99"
# http://stackoverflow.com/questions/3375697/useful-gcc-flags-for-c
alias gcc-norm="
clang \
-Wall \
-Wextra \
-Wpedantic \
-Wshadow \
-Wstrict-prototypes \
-Wmisleading-indentation \
" # (c)ompile (C) (n)ormal (f)lags
alias gcc-strict="
ccwf \
-Wundef \
-Wfloat-equal \
-Wpointer-arith \
-Wcast-align \
-Wwrite-strings \
-Waggregate-return \
" # (c)ompile (C) (s)trict (f)lags