summaryrefslogtreecommitdiff
path: root/.bashrc
blob: bd79696c5bdd5a96bb7fcea4813907a16c1417dd (plain)
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
# If not running interactively, don't do anything
[[ $- != *i* ]] && return

HISTCONTROL=ignoreboth
HISTSIZE=1000
HISTFILESIZE=2000

shopt -s histappend
shopt -s checkwinsize

PATH="$HOME/bin:$PATH"
PATH="$HOME/.local/bin:$PATH"
PATH="$HOME/.dotnet/tools:$PATH"
export PATH

export EDITOR=vim
export VISUAL=vim
export PAGER=most

source '/usr/share/fzf/key-bindings.bash'
source '/usr/share/fzf/completion.bash'

alias q='exit'
alias c='clear'
alias h='history'
alias cl='c;l'
alias p='cat'
alias k='kill'
alias null='/dev/null'
alias r='ranger'
alias nf='neofetch'
alias pf='pfetch'

alias ls='exa'
alias l='exa -1'
alias la='exa -1a'
alias lt='exa -T'
alias lh="exa -1dI '.|..' .*"

cd_up() {
    case $1 in
        *[!0-9]*)
            cd $( pwd | sed -r "s|(.*/$1[^/]*/).*|\1|i" )
            ;;
        *)
            cd $(printf "%0.0s../" $(seq 1 $1));
            ;;
    esac
}
alias '..'='cd_up'
alias ghd='cd ~/Documents/github'
alias aau='cd ~/Documents/uni/5\ Semester'
alias game='cd ~/Documents/github/2018shock/'

cpy() { readlink -en $1 | xclip -sel clipboard; }

alias g='git'
alias gs='git status'
alias lg='git log'
alias com='git commit'
alias sth='git stash'
alias clone='git clone'
alias u='git add -u'
alias gdf='git diff'
alias gpl='git pull'

alias config='/usr/bin/git --git-dir=/home/adam/.cfg/ --work-tree=/home/adam'
alias cs='config status'
alias clg='config log'
alias ccom='config commit'
alias csth='config stash'
alias cu='config add -u'
alias cdf='config diff'
alias cpl='config pull'
alias cvim='GIT_DIR=$HOME/.cfg GIT_WORK_TREE=$HOME vim'

alias loadbash='source ~/.bashrc'
alias bashrc='vim ~/.bashrc'
alias vimrc='vim ~/.vim/vimrc'
alias nvimrc='cd $XDG_CONFIG_HOME/nvim;nvim .'
alias i3config='vim $XDG_CONFIG_HOME/i3/config'
alias startup='vim $XDG_CONFIG_HOME/i3/init'

alias luamake=/home/adam/Documents/github/lua-language-server/3rd/luamake/luamake

eval "$(starship init bash)"