-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofile.template
113 lines (98 loc) · 3.04 KB
/
profile.template
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
#!/bin/bash
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# include .secrets if it exists
SECRETS="$HOME/.secrets"
if [ -f "$SECRETS" ]; then
echo "Including secrets from $SECRETS"
. $SECRETS
fi
# generic environment variables
add_to_path() {
export PATH=$PATH:$1
}
export DOTFILES_DIR="$HOME/.config"
export SCRIPTS_DIR="$DOTFILES_DIR/i3/scripts"
export PROJECTS="$HOME/PROGRAMMERING/projects"
export LD_LIBRARY_PATH=$GOPATH/src/github.com/zubairhamed/canopus/openssl/
export GOROOT="/opt/homebrew/Cellar/go/1.17.6/libexec/"
add_to_path "$GOROOT/bin"
add_to_path "$GOPATH/bin"
add_to_path "$GOPATH/bin"
add_to_path "$HOME/bin:$HOME/.local/bin"
add_to_path "/snap/bin"
add_to_path "/opt/homebrew/bin"
# shortcuts
alias highlight="ack --passthru"
alias c="clear"
alias p="cd $PROJECTS"
alias a="atom"
alias aa="atom -a"
alias py="python"
alias py3="python3"
alias sc="cd $SCRIPTS_DIR"
alias terminalBackground="gsettings set io.elementary.terminal.settings background $@"
alias gogit="cd $GOPATH/src/github.com"
alias plantuml="java -jar $HOME/PROGRAMMERING/plantuml/plantuml.jar $@"
alias docker-kill="docker kill $(docker ps -q)"
# git shortcuts
alias gmne="gm --no-edit --no-ff $@"
alias gpt="git push && git push --tags"
alias tags="glo | grep -oP '(?<=tag: ).*(?=\))'"
# config files
alias secrets="$EDITOR $HOME/.secrets; source $HOME/.profile"
alias i3conf="atom $DOTFILES_DIR/i3"
alias makeconf="vim $DOTFILES_DIR/Makefile"
alias snippets="aa $HOME/.atom/snippets.cson"
profile() {
cd $DOTFILES_DIR
git pull origin master &&
atom --wait profile.template &&
git add "profile.template" &&
git commit --edit &&
git push &&
make profile
cd -
}
alias untar="tar -zxvf $@"
# network & postgres
alias fixnet="sudo systemctl restart NetworkManager.service"
alias pg="sudo -u postgres psql"
github-open() {
uri="https://github.com/"$(git remote -v | grep -Pi $1 | grep -oPi '((?<=github.com:)|(?<=github.com/))\w*\/.*(?=\.git \(fetch\))')
google-chrome $uri
}
prune_git() {
git fetch -p &&
git branch --merged >/tmp/merged-branches &&
vim /tmp/merged-branches &&
xargs git branch -d </tmp/merged-branches
}
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/opt/homebrew/Caskroom/miniforge/base/bin/conda' 'shell.zsh' 'hook' 2>/dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/opt/homebrew/Caskroom/miniforge/base/etc/profile.d/conda.sh" ]; then
. "/opt/homebrew/Caskroom/miniforge/base/etc/profile.d/conda.sh"
else
export PATH="/opt/homebrew/Caskroom/miniforge/base/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
# if [ -n "$ZSH_VERSION" ]; then
# terminalBackground "rgba(37, 46, 50, 0.95)"
# fi
unalias z 2>/dev/null
z() {
[ $# -gt 0 ] && _z "$*" && return
cd "$(_z -l 2>&1 | fzf --height 40% --nth 2.. --reverse --inline-info +s --tac --query "${*##-* }" | sed 's/^[0-9,.]* *//')"
}
echo "$(date +%d.%m.%Y) | $(date +%T)"