# ~/.bashrc # colouring terminal export PS1='\[\033[38;5;174m\]\u\[\033[38;5;187m\]@\h\[\033[00m\]:\[\033[38;5;174m\] \w \[\033[00m\]\$ ' # colouring ls eval $( dircolors -b $HOME/.config/dircolours) # set vi mode for bash set -o vi # aliases alias ls='ls --color' alias la='ls -lah' alias gf='git fetch' alias gd='git diff' alias gl='git log' alias gpl='git pull' alias gps='git push' alias ga='git add' alias gst='git status' alias gck='git checkout' alias gcm='git commit' alias gcl='git clone' alias gb='git branch' alias gr='git reset' alias grm='git rm' alias lg='lazygit' # starting ssh-agent if [ -z "$SSH_AUTH_SOCK" ] ; then eval `ssh-agent -s` 2>&1 >/dev/null fi # nnn config export NNN_OPTS="eEr" export NNN_COLORS='#a744b322' export NNN_FCOLORS='dfdfdf6c0000df42bbbaba5f' export NNN_TRASH=1 export NNN_ARCHIVE="\\.(7z|a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|rar|rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)$" export NNN_BMS='b:~/bilder;d:~/downloads;D:~/dokumente;v:~/videos;m:~/musik;c:~/.config;M:/mnt/' export NNN_PLUG='t:opennewterm;i:imgview;m:nmount' # nnn cd on quit n () { # Block nesting of nnn in subshells if [ -n $NNNLVL ] && [ "${NNNLVL:-0}" -ge 1 ]; then echo "nnn is already running" return fi # The default behaviour is to cd on quit (nnn checks if NNN_TMPFILE is set) # To cd on quit only on ^G, remove the "export" as in: # NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd" # NOTE: NNN_TMPFILE is fixed, should not be modified NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd" # Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn # stty start undef # stty stop undef # stty lwrap undef # stty lnext undef nnn "$@" if [ -f "$NNN_TMPFILE" ]; then . "$NNN_TMPFILE" rm -f "$NNN_TMPFILE" > /dev/null fi } # vimwiki vw () { if [[ $# == 0 ]] then git -C ~/dokumente/wiki pull nvim ~/dokumente/wiki/index.md git -C ~/dokumente/wiki add -A git -C ~/dokumente/wiki commit -m "autosync-$(date +%FT%T)" git -C ~/dokumente/wiki push elif [[ $1 == 'g' ]] then git -C ~/dokumente/wiki ${@:2} else echo 'Usage: vw [g] [args ...]' fi }