blob: 5f73b513a2c28a86b5fea2e0cb39565c9602528c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
# ~/.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
# add GOBIN
if [ -d "$HOME/go/bin" ] ; then
PATH="$PATH:$HOME/go/bin"
fi
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
export 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)
export HISTSIZE=10000
export HISTFILESIZE=20000
export HISTTIMEFORMAT='[%F_%X]: '
export TIMEFORMAT='%3R'
export LS_COLORS='fi=37:di=1;97:ln=90:mh=90:ex=3;2;37:no=1;97:mi=90:ow=91'
export GREP_COLOR='1;91'
export LESSSECURE=1
export SUDO_EDITOR='/usr/local/bin/rvim'
#set TERM
export TERM="xterm-256color"
# Pretty-print man(1) pages, which doesn't do anything
export LESS_TERMCAP_mb=$'\E[1;91m'
export LESS_TERMCAP_md=$'\E[1;91m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_so=$'\E[1;93m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_us=$'\E[1;92m'
# use colorls if it's installed, plain old ls otherwise
alias ls='colorls -G'
# if command -v colorls > /dev/null ; then
# LS='colorls -G'
# 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 = "-v" ]]; 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
}
# mpv func
function yta() {
mpv --ytdl-format=bestaudio ytdl://ytsearch:"$*"
}
# GPG
# added this for mutt (https://openports.se/mail/mutt)
export GPG_TTY=$(tty); eval $(gpg-agent --daemon)
# 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'
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
export EDITOR=/usr/local/bin/vim
export PARINIT="rTbgqR B=.,?_A_a Q=_s>|" # for the filtering program par (check man par)
source ~/perl5/perlbrew/etc/bashrc
|