forked from maks/config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaksrc
72 lines (61 loc) · 2.56 KB
/
maksrc
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
export APPS=$HOME/apps
export JAVA_HOME=$APPS/android-studio/jre
export ANDROID_PATH=$APPS/Android/Sdk
export NODE_HOME=$APPS/node
export FLUTTER=$HOME/fvm/default
export FLUTTER_DEVTOOLS=$FLUTTER/.pub-cache/bin
export DART_PATH=/opt/apps/dart-sdk
## For Dart pub installed exe's:
export PUB_CACHE_PATH="$HOME/.pub-cache/bin"
export RUST_BINS_PATH=$HOME/.cargo/bin
export PATH=$HOME/bin:$JAVA_HOME/bin:$PATH:$ANDROID_PATH/platform-tools:$ANDROID_PATH/tools:$NODE_HOME/bin:$DART_PATH/bin:$FLUTTER/bin:$FLUTTER_DEVTOOLS:$RUST_BINS_PATH:$PUB_CACHE_PATH
. $HOME/config/adb.bash_complete
export EDITOR=vim
. $HOME/config/bash_aliases
#disable capslock - to renable use: setxkbmap -option
#setxkbmap -option ctrl:nocaps
#stop silly missing packages command from running
unset command_not_found_handle
function latest() { def=5; LINES=${2:-$def}; ls -ths $1 |head -n $LINES ;}
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
# username@Machine ~/dev/dir[master]$ # clean working directory
# username@Machine ~/dev/dir[master*]$ # dirty working directory
function _git_prompt() {
local git_status="`git status -unormal 2>&1`"
if ! [[ "$git_status" =~ Not\ a\ git\ repo ]]; then
if [[ "$git_status" =~ nothing\ to\ commit ]]; then
local ansi=42
elif [[ "$git_status" =~ nothing\ added\ to\ commit\ but\ untracked\ files\ present ]]; then
local ansi=43
else
local ansi=44
fi
if [[ "$git_status" =~ On\ branch\ ([^[:space:]]+) ]]; then
branch=${BASH_REMATCH[1]}
test "$branch" != master || branch=' '
else
# Detached HEAD. (branch=HEAD is a faster alternative.)
branch="(`git describe --all --contains --abbrev=4 HEAD 2> /dev/null ||
echo HEAD`)"
fi
echo -n '\[\e[0;37;'"$ansi"';1m\]'"$branch"'\[\e[0m\] '
fi
}
function _prompt_command() {
PS1="`_git_prompt`"' \[\e[1;34m\]\w \$\[\e[0m\] '
}
PROMPT_COMMAND=_prompt_command
# Open a man page in vim
vman () {
MANWIDTH=150 MANPAGER='col -bx' man $@ | vim -R -c "set ft=man" -
}
# For AOSP building
export USE_CCACHE=1
# need to do this for git gnome-keyring helper, nromamly only for ssh sessions, but for some reason not working in desktop 16.04 either...
# if [[ -z $DBUS_SESSION_BUS_ADDRESS ]]; then
# if [[ -f ~/.dbus/session-bus/$(dbus-uuidgen --get)-0 ]]; then
# source ~/.dbus/session-bus/$(dbus-uuidgen --get)-0
# export DBUS_SESSION_BUS_ADDRESS
# fi
# fi