.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
34# ripped off from nixcasts' .bashrc
35pacs() {
36 sudo pacman -Syy $(pacman -Ssq | fzf -m --preview="pacman -Si {}" \
37 --preview-window=:hidden --bind=space:toggle-preview)
38}
39
40FOSSILS_HOME=$HOME/Documents/Fossils
41
42# fossil init script
43# modified version of one taken from
44# https://www.fossil-scm.org/home/doc/trunk/www/server/openbsd/fastcgi.md
45
46source $HOME/.local/bin/finit
47
48# real one is there, but because it has some
49#personal information, i'll not include it, but it almost identical to
50#following:
51#
52#finit() {
53# FINIT_REPO=$FOSSILS_HOME/$1.fossil
54# fossil init $FINIT_REPO && \
55# chmod 664 $FINIT_REPO && \
56# fossil open $FINIT_REPO --workdir $HOME/Documents/$1 && \
57# fossil user -R $FINIT_REPO password $USER $PASSWD && \
58# fossil remote-url -R $FINIT_REPO https://$USER@domain.tld/$1 && \
59# rsync --perms $FINIT_REPO $USER@domain.tld:/var/www/fossils/ \
60# >/dev/null && \
61# chmod 644 $FINIT_REPO
62#}
63
64# starship prompt
65eval "$(starship init bash)"