# ~/.bashrc: executed by bash(1) for non-login shells. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) # for examples # If not running interactively, don't do anything #case $- in # *i*) ;; # *) return;; #esac # Use vi if not vim case "$(command -v vim)" in */vim) VIM=vim ;; *) VIM=vi ;; esac # set PATH so it includes user's private bin if it exists if [ -d "$HOME/bin" ] ; then PATH="$HOME/bin:$PATH" fi # don't put duplicate lines or lines starting with space in the history. # See bash(1) for more options HISTCONTROL=ignoreboth # append to the history file, don't overwrite it shopt -s histappend # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) HISTSIZE=1000 HISTFILESIZE=20000 # use colorls if it's installed, plain old ls otherwise if command -v colorls > /dev/null ; then LS='colorls' else LS='ls' fi # check the window size after each command and, if necessary, # update the values of LINES and COLUMNS. shopt -s checkwinsize PS1="\h:\w \u$ " # Alias definitions. if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi # enable programmable completion features (you don't need to enable if ! shopt -oq posix; then if [ -f /usr/share/bash-completion/bash_completion ]; then . /usr/share/bash-completion/bash_completion elif [ -f /etc/bash_completion ]; then . /etc/bash_completion fi fi # source funcs and completion for f in ~/.bash_completion.d/*; do source $f; done for f in ~/.bash_functions.d/*; do source $f; done # use GPG to encrypt files secret () { output=~/Downloads/"${1}".$(date +%s).enc gpg --encrypt --armor --output ${output} -r matt@matthewlemon.com "${1}" && echo "${1} -> ${output}" } reveal () { output=$(echo "${1}" | rev | cut -c16- | rev) gpg --decrypt --output ${output} "${1}" && echo "${1} -> ${output}" } # journal funcs todj () { CMD=cat if [[ $1 = "-vim" ]]; then CMD=vim fi $CMD $(find /home/lemon/Notes/journal -name "*$(date '+%Y-%m-%d')*") } tj () { if [[ -z $1 ]]; then echo "Please give me your message in quotes." fi echo $1 | _tj } tjclip () { if [[ -z $1 ]]; then echo "Please give me your message in quotes." fi echo "$1: $(xclip -o -selection clipboard)." | _tj } # GPG agent settings (https://github.com/hammerheadlemon/YubiKey-Guide) # See Replace Agents section export GPG_TTY="$(tty)" #export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) #gpgconf --launch gpg-agent # FZF export FZF_DEFAULT_COMMAND='ag -g ""' export FZF_CTRL_T_COMMAND=$FZF_DEFAULT_COMMAND export FZF_ALT_C_COMMAND=$FZF_DEFAULT_COMMAND export FZF_DEFAULT_OPTS='--color info:108,prompt:109,spinner:108,pointer:168,marker:168' #set TERM export TERM="xterm-256color" [ -f ~/.fzf.bash ] && source ~/.fzf.bash EDITOR=/usr/local/bin/vim