.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'
21
22PS1='[\u@\h \W]\$ '
23
24# use gpg authentication key for ssh auth
25export SSH_AUTH_SOCK=$( gpgconf --list-dirs agent-ssh-socket )
26gpgconf --launch gpg-agent
27
28# fzf bindings and tweaks
29source /usr/share/fzf/key-bindings.bash
30source /usr/share/fzf/completion.bash
31export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git'
32export FZF_CTRL_T_COMMAND='$FZF_DEFAULT_COMMAND'
33
34keylookup() {
35 curl "http://hkps.pool.sks-keyservers.net/pks/lookup?op=get&search=0x$1"
36}
37
38FOSSILS_HOME=$HOME/Documents/Fossils
39
40fslcd() {
41 local fsl_checkout
42 fsl_checkout=$(fossil all ls -c | fzf +m) &&
43 cd "$fsl_checkout"
44}
45
46# fossil init script
47# modified version of one taken from
48# https://www.fossil-scm.org/home/doc/trunk/www/server/openbsd/fastcgi.md
49
50source $HOME/.local/bin/finit
51
52# real one is there, but because it has some
53#personal information, i'll not include it, but it almost identical to
54#following:
55#
56#finit() {
57# FINIT_REPO=$FOSSILS_HOME/$1.fossil
58# fossil init $FINIT_REPO && \
59# chmod 664 $FINIT_REPO && \
60# fossil open $FINIT_REPO --workdir $HOME/Documents/$1 && \
61# fossil user -R $FINIT_REPO password $USER $PASSWD && \
62# fossil remote-url -R $FINIT_REPO https://$USER@domain.tld/$1 && \
63# rsync --perms $FINIT_REPO $USER@domain.tld:/var/www/fossils/ \
64# >/dev/null && \
65# chmod 644 $FINIT_REPO
66#}
67
68# starship prompt
69eval "$(starship init bash)"