From e3bbee81de559c1b4dea7a83d46da3b4e00cc2a8 Mon Sep 17 00:00:00 2001 From: la-ninpre Date: Mon, 12 Jul 2021 16:27:52 +0300 Subject: move to GNU stow approach on managing dotfiles --- bash/.bash_profile | 11 +++++++++++ bash/.bashrc | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 bash/.bash_profile create mode 100644 bash/.bashrc (limited to 'bash') diff --git a/bash/.bash_profile b/bash/.bash_profile new file mode 100644 index 0000000..27b8539 --- /dev/null +++ b/bash/.bash_profile @@ -0,0 +1,11 @@ +# +# ~/.bash_profile +# + +export PATH="${PATH}:$HOME/.gem/ruby/2.7.0/bin:$HOME/.local/bin" +export EDITOR="nvim" +export TERMINAL="alacritty" +export BROWSER="brave" +export TESSDATA_PREFIX=/usr/share/tessdata + +[[ -f ~/.bashrc ]] && . ~/.bashrc diff --git a/bash/.bashrc b/bash/.bashrc new file mode 100644 index 0000000..0fe0b47 --- /dev/null +++ b/bash/.bashrc @@ -0,0 +1,54 @@ +# +# ~/.bashrc +# + +# If not running interactively, don't do anything +[[ $- != *i* ]] && return + +# vi mode +set -o vi + +# aliases +alias ls='ls --color=auto --group-directories-first' +alias ll='ls -lAh' +alias cat='bat -p' +alias mocp='mocp -M "~/.config/moc"' +alias ssh='TERM=rxvt ssh' # fix alacritty term issues +alias ..='cd ..' + +# see https://www.atlassian.com/git/tutorials/dotfiles +# and https://youtu.be/tBoLDpTWVOM +alias config='/usr/bin/git --git-dir=$HOME/Documents/dotfiles --work-tree=$HOME' + +alias brc='nvim ~/.bashrc && source ~/.bashrc' +alias vrc='nvim ~/.config/nvim/init.vim' + +alias v='nvim' +alias fsl='fossil' + +PS1='[\u@\h \W]\$ ' + +# use gpg authentication key for ssh auth +SSH_AUTH_SOCK=$( gpgconf --list-dirs agent-ssh-socket ) +export SSH_AUTH_SOCK +gpgconf --launch gpg-agent + +# fzf bindings and tweaks +source /usr/share/fzf/key-bindings.bash +source /usr/share/fzf/completion.bash +export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git' +# shellcheck disable=SC2016 +export FZF_CTRL_T_COMMAND='$FZF_DEFAULT_COMMAND' + +FOSSILS_HOME=$HOME/Documents/Fossils +export FOSSILS_HOME + +# quickly cd into fossil repo +fslcd() { + _fsl_checkout=$(fossil all ls -c | fzf +m) + cd "$_fsl_checkout" || return +} + +# starship prompt +eval "$(starship init bash)" + -- cgit v1.2.3