-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bashrc
73 lines (56 loc) · 1.57 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# ~/.bashrc
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
# keybinds
bind -x '"\C-l":clear'
# ----------- env variables -----------
export VISUAL=nvim
export EDITOR=nvim
# config
export BROWSER="firefox"
# directories
export REPOS="$HOME/Repos"
export GITUSER="fajkoson"
export GHREPOS="$REPOS/github.com/$GITUSER"
export DOTFILES="$GHREPOS/dotfiles"
export SCRIPTS="$DOTFILES/scripts"
# dotnet
export DOTNET_ROOT="$HOME/dotnet"
# get rid of mail notifications
unset MAILCHECK
# ---------- path configuration -------
PATH="$DOTFILES:${PATH:+${PATH}:}$SCRIPTS:$HOME/.local/bin:$HOME/dotnet"
export PATH
# -------------- history --------------
export HISTFILE=~/.histfile
export HISTSIZE=25000
export SAVEHIST=25000
export HISTCONTROL=ignorespace
# -------------- functions ------------
# This function is stolen from rwxrob
clone() {
local repo="$1" user
local repo="${repo#https://github.com/}"
local repo="${repo#[email protected]:}"
if [[ $repo =~ / ]]; then
user="${repo%%/*}"
else
user="$GITUSER"
[[ -z "$user" ]] && user="$USER"
fi
local name="${repo##*/}"
local userd="$REPOS/github.com/$user"
local path="$userd/$name"
[[ -d "$path" ]] && cd "$path" && return
mkdir -p "$userd"
cd "$userd"
echo gh repo clone "$user/$name" -- --recurse-submodule
gh repo clone "$user/$name" -- --recurse-submodule
cd "$name"
} && export -f clone
# promt
eval "$(starship init bash)"
# source .bash_aliases if it exists
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi