-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bashrc
127 lines (113 loc) · 4.08 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
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
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific environment
if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]; then
PATH="$HOME/.local/bin:$HOME/bin:$PATH"
fi
export PATH
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# User specific aliases and functions
if [ -d ~/.bashrc.d ]; then
for rc in ~/.bashrc.d/*; do
if [ -f "$rc" ]; then
. "$rc"
fi
done
fi
###############################################################################
### Adjustments by David Pelkmann
###############################################################################
###############################################################################
# + Individual Exports
# +--+ getting proper colors
#export TERM="xterm-256color"
# +--+ neovim as standard editor
export EDITOR=nvim
# +--+ set manpager
# | uncomment the program you want to have as manpager
# +--+ use bat as manpager
#export MANPAGER="sh -c 'sed -e s/.\\\\x08//g | bat -l man -p'"
# +--+ use nvim as manpager
export MANPAGER="nvim +Man!"
###############################################################################
# + system_mindset - Dotfile Management via git bare
# | 1. source: https://www.youtube.com/watch?v=tBoLDpTWVOM
# | 2. source: https://www.atlassian.com/git/tutorials/dotfiles
sm_dir=$HOME/.config/sm/
alias sm='/usr/bin/git --git-dir=${sm_dir}system_mindset/ --work-tree=$HOME'
# +--+ manually managed, so not show other files in $HOME
sm config --local status.showUntrackedFiles no
# +--+ update modified, deleted and new files to commit
alias sm_stage-changes='sm add $(sm status | grep "modified\|deleted\|new file" | sed "s/.*://")'
# +--+ remove updated files
alias sm_unstage-changes='sm reset --mixed'
# +--+ add tig support
sm config tig.status-show-untracked-files false
alias sm_tig='GIT_DIR=${sm_dir}system_mindset/ GIT_WORK_TREE=$HOME tig'
###############################################################################
# + System Command Aliases
# | If the name of an alias also referes to a program name, you can access this
# | program a starting backslash.
# +--+ ls
alias ls='lsd --human-readable --long --group-dirs first'
# +--+ nvim
alias nv='nvim'
# +--+ micromamba
alias mm='micromamba'
# +--+ tmux
alias tmls='tmux list-sessions'
alias tmas='tmux attach-session -t'
alias tmks='tmux kill-session -t'
# +--+ python environment program aliases
alias pymux='/home/dpelkmann/anaconda3/envs/pymux/bin/pymux'
alias ptpython='/home/dpelkmann/anaconda3/envs/ptpython/bin/ptpython'
alias pyvim='/home/dpelkmann/anaconda3/envs/pyvim/bin/pyvim'
# +--+ ranger
rr_kitty_rename() {
if [ "$TERM" == "xterm-kitty" ]; then
kitty @ set-tab-title ranger
ranger
else
ranger
fi
}
alias rr=rr_kitty_rename
# +--+ kitty tab rename
alias ktr='kitty @ set-tab-title'
###############################################################################
# + Startup
# | commands to display when starting a terminal session
# + -- + fastfetch
#fastfetch
# + -- + launch ssh-agent with its own "key space" - see man page
eval "$(ssh-agent -s)" >/dev/null
###############################################################################
# + Command Line Prompt
# | uncomment the prompt you want
# +--+ starship prompt configuration
eval "$(starship init bash)"
# +--+ powerline prompt configuration
#if [ -f `which powerline-daemon` ]; then
# powerline-daemon -q
# POWERLINE_BASH_CONTINUATION=1
# POWERLINE_BASH_SELECT=1
# . /usr/share/powerline/bash/powerline.sh
#fi
###############################################################################
unset rc
# >>> mamba initialize >>>
# !! Contents within this block are managed by 'micromamba shell init' !!
export MAMBA_EXE='/home/dpelkmann/.local/bin/micromamba'
export MAMBA_ROOT_PREFIX='/home/dpelkmann/micromamba'
__mamba_setup="$("$MAMBA_EXE" shell hook --shell bash --root-prefix "$MAMBA_ROOT_PREFIX" 2>/dev/null)"
if [ $? -eq 0 ]; then
eval "$__mamba_setup"
else
alias micromamba="$MAMBA_EXE" # Fallback on help from micromamba activate
fi
unset __mamba_setup
# <<< mamba initialize <<<