all repos — dotfiles @ bfb552cadd7c808c5c0d16243bded9c51c2dafcc

personal dotfiles

.bashrc (view raw)

 1#
 2# ~/.bashrc
 3#
 4
 5# If not running interactively, don't do anything
 6[[ $- != *i* ]] && return
 7
 8# vi mode
 9set -o vi
10
11# aliases
12alias ls='ls --color=auto --group-directories-first'
13alias ll='ls -lAh'
14alias cat='bat -p'
15alias ssh='TERM=rxvt ssh'
16alias config='/usr/bin/git --git-dir=$HOME/Documents/dotfiles --work-tree=$HOME'
17alias brc='nvim ~/.bashrc && source ~/.bashrc'
18alias vrc='nvim ~/.config/nvim/init.vim'
19alias v='nvim'
20alias fsl='fossil'
21alias mocp='mocp -M "~/.config/moc"'
22
23PS1='[\u@\h \W]\$ '
24
25# use gpg authentication key for ssh auth
26export SSH_AUTH_SOCK=$( gpgconf --list-dirs agent-ssh-socket )
27gpgconf --launch gpg-agent
28
29# fzf bindings and tweaks
30source /usr/share/fzf/key-bindings.bash
31source /usr/share/fzf/completion.bash
32export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git'
33export FZF_CTRL_T_COMMAND='$FZF_DEFAULT_COMMAND'
34
35keylookup() {
36    curl "http://hkps.pool.sks-keyservers.net/pks/lookup?op=get&search=0x$1"
37}
38
39FOSSILS_HOME=$HOME/Documents/Fossils
40
41fslcd() {
42    local fsl_checkout
43    fsl_checkout=$(fossil all ls -c | fzf +m) &&
44    cd "$fsl_checkout"
45}
46
47# fossil init script
48# modified version of one taken from 
49# https://www.fossil-scm.org/home/doc/trunk/www/server/openbsd/fastcgi.md
50
51source $HOME/.local/bin/finit
52
53# real one is there, but because it has some
54#personal information, i'll not include it, but it almost identical to
55#following:
56#
57#finit() {
58#    FINIT_REPO=$FOSSILS_HOME/$1.fossil
59#    fossil init $FINIT_REPO && \
60#        chmod 664 $FINIT_REPO && \
61#        fossil open $FINIT_REPO --workdir $HOME/Documents/$1 && \
62#        fossil user -R $FINIT_REPO password $USER $PASSWD && \
63#        fossil remote-url -R $FINIT_REPO https://$USER@domain.tld/$1 && \
64#        rsync --perms $FINIT_REPO $USER@domain.tld:/var/www/fossils/ \
65#        >/dev/null && \
66#        chmod 644 $FINIT_REPO
67#}
68
69# starship prompt
70eval "$(starship init bash)"