summaryrefslogtreecommitdiff
path: root/.bashrc
diff options
context:
space:
mode:
Diffstat (limited to '.bashrc')
-rw-r--r--.bashrc18
1 files changed, 15 insertions, 3 deletions
diff --git a/.bashrc b/.bashrc
index bd2bc25..a9d47d9 100644
--- a/.bashrc
+++ b/.bashrc
@@ -10,11 +10,14 @@ export NOTES_DIR="$HOME/notes"
export TERM="screen-256color"
export GREP_COLOR='mt=00;38;5;166'
export CM_HISTLENGTH=50
-# my scripts on PATH
+export BAT_THEME="Solarized (dark)"
+#my scripts on PATH
export PATH=/usr/local/bin:$PATH
export PATH=$PATH:$HOME/bin
export PATH=$PATH:$HOME/bin/bash-scripts
+tre() { command tre "$@" -e && source "/tmp/tre_aliases_$USER" 2>/dev/null; }
+
# set vi mode but keep control l
set -o vi
bind -m vi-command 'Control-l: clear-screen'
@@ -60,7 +63,7 @@ shopt -s cdable_vars
export FZF_DEFAULT_OPTS="
--color dark,hl:33,hl+:37,fg+:235,bg+:136,fg+:254
--color info:254,prompt:37,spinner:108,pointer:235,marker:235
- --no-mouse --height 70% -1 --multi --inline-info --preview='[[ \$(file --mime {}) =~ binary ]] && echo {} is a binary file || (bat --style=numbers --color=always {} || cat {}) 2> /dev/null | head -300' --preview-window='right:hidden:wrap' --bind='f3:execute(bat --style=numbers {} || less -f {}),f2:toggle-preview,ctrl-d:half-page-down,ctrl-u:half-page-up,ctrl-a:select-all+accept,ctrl-y:execute-silent(echo {+} | wl-copy),ctrl-x:execute(rm -i {+})+abort'"
+ --no-mouse --height 70% -1 --multi --inline-info --preview='[[ \$(file --mime {}) =~ binary ]] && echo {} is a binary file || (bat --style=numbers --color=always {} || cat {}) 2> /dev/null | head -300' --preview-window='right:wrap' --bind='f3:execute(bat --style=numbers {} || less -f {}),f2:toggle-preview,ctrl-d:half-page-down,ctrl-u:half-page-up,ctrl-a:select-all+accept,ctrl-y:execute-silent(echo {+} | wl-copy),ctrl-x:execute(rm -i {+})+abort,ctrl-j:down,ctrl-k:up'"
if type rg &> /dev/null; then
export FZF_DEFAULT_COMMAND='rg --files --no-ignore-vcs --hidden'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
@@ -144,6 +147,11 @@ function f() {
${EDITOR:-vim} "$(rg -l $1 ${2:-.} | fzf --preview="bat {}" --preview-window=right:70%:wrap)";
}
+function fg(){
+ ${EDITOR:-vim} "$(grep -nr $1 ${2:-.} | fzf --preview="bat {}" --preview-window=right:70%:wrap)";
+}
+
+
#fuzzy find file names only
function ff() {
ag -g "$1" ${2:-.} | fzf --preview="bat {}" --preview-window=right:70%:wrap
@@ -153,6 +161,10 @@ function ff() {
function @td() {
rg -l $1 ${2:-~/gtd} | fzf --preview="bat {}" --preview-window=right:70%:wrap
}
+# converts HTML to markdown using pandoc, run on a folder of files and get markdown
+function htmltotext(){
+ find . -name \*.html -type f -exec pandoc -f html -t markdown -o {}.txt {} \;
+}
function tolux() {
scp $3 $1 lxf:/home/lxf/$2
@@ -562,7 +574,7 @@ if [ -x /usr/bin/dircolors ]; then
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
- alias egrep='egrep --color=auto'
+ alias egrep='grep -E --color=auto'
fi
# enable programmable completion features