aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortdro <tdro@users.noreply.github.com>2020-08-08 22:06:06 -0400
committertdro <tdro@users.noreply.github.com>2020-08-08 22:06:06 -0400
commit39c5787e53dcd1302e31f45495d8a698bbd1c2ef (patch)
tree27b3b1e82df59eda33f7a610d31163aa8d3653cf
parent00c49d9b06e837e6ead192bfae256892d48b2c0e (diff)
downloaddotfiles-39c5787e53dcd1302e31f45495d8a698bbd1c2ef.tar.gz
dotfiles-39c5787e53dcd1302e31f45495d8a698bbd1c2ef.tar.bz2
dotfiles-39c5787e53dcd1302e31f45495d8a698bbd1c2ef.zip
.local/bin/fzf: Namespacing
-rw-r--r--.bash_profile25
-rwxr-xr-x.local/bin/fzf-doc (renamed from .local/bin/fdoc)6
-rwxr-xr-x.local/bin/fzf-file2
-rwxr-xr-x.local/bin/fzf-file-mark (renamed from .local/bin/fmark)0
-rwxr-xr-x.local/bin/fzf-man (renamed from .local/bin/fman)0
-rw-r--r--.vimrc8
6 files changed, 22 insertions, 19 deletions
diff --git a/.bash_profile b/.bash_profile
index e3fad15..c44ca37 100644
--- a/.bash_profile
+++ b/.bash_profile
@@ -27,23 +27,24 @@ export PATH="$HOME/.local/bin:$PATH"
# general exports
export EDITOR=vim
-export TERMINAL=urxvt
-export MANPAGER="vim -M +MANPAGER -"
-export PROMPT_COMMAND='cd .; history -a; history -n;'
-export HISTSIZE=
+export FZF_DIRECTORY_MARKS=$HOME/Documents/.fzf-marks
+export FZF_FILE_MARKS=$HOME/Documents/.fzf-fmarks
+export HISTCONTROL=ignoreboth:erasedups
export HISTFILESIZE=
+export HISTSIZE=
export HISTTIMEFORMAT="%d/%m/%y %T "
-export HISTCONTROL=ignoreboth:erasedups
-
+export ICEAUTHORITY="$XDG_CACHE_HOME/ICEauthority"
+export INPUTRC="$XDG_CONFIG_HOME/inputrc"
+export LESSHISTFILE="$XDG_CACHE_HOME/less.history"
+export MANPAGER="vim -M +MANPAGER -"
+export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npmrc"
+export PROMPT_COMMAND='cd .; history -a; history -n;'
export SUDO_ASKPASS="$HOME/.local/bin/rofi-askpass"
+export TERMINAL=urxvt
+export WEECHAT_HOME="$XDG_CONFIG_HOME/weechat"
+export XDG_CACHE_HOME="$HOME/.cache"
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
-export XDG_CACHE_HOME="$HOME/.cache"
-export LESSHISTFILE="$XDG_CACHE_HOME/less.history"
-export INPUTRC="$XDG_CONFIG_HOME/inputrc"
-export ICEAUTHORITY="$XDG_CACHE_HOME/ICEauthority"
-export WEECHAT_HOME="$XDG_CONFIG_HOME/weechat"
-export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npmrc"
# themes
export DESKTOP_SESSION=gnome
diff --git a/.local/bin/fdoc b/.local/bin/fzf-doc
index 66d4594..f30f23e 100755
--- a/.local/bin/fdoc
+++ b/.local/bin/fzf-doc
@@ -1,6 +1,6 @@
#!/bin/sh -eu
-fdoc_preview() {
+fzf_doc_preview() {
file=$1
extension=${file##*.}
case "$extension" in
@@ -10,14 +10,14 @@ fdoc_preview() {
esac
}
-[ "${1-}" = "--preview" ] && fdoc_preview "${2-}" && exit;
+[ "${1-}" = "--preview" ] && fzf_doc_preview "${2-}" && exit;
grep -lRi \
--include=*.md \
--include=*.txt \
--include=*.html \
"${1-.}" /etc/documentation \
- | fzf --preview "fdoc --preview {}" \
+ | fzf --preview "fzf-doc --preview {}" \
| while read -r doc
do
diff --git a/.local/bin/fzf-file b/.local/bin/fzf-file
new file mode 100755
index 0000000..8580595
--- /dev/null
+++ b/.local/bin/fzf-file
@@ -0,0 +1,2 @@
+#!/bin/sh -eu
+fzf < "$FZF_FILE_MARKS" | xargs -I{} sh -c "vim {}";
diff --git a/.local/bin/fmark b/.local/bin/fzf-file-mark
index 8a306c6..8a306c6 100755
--- a/.local/bin/fmark
+++ b/.local/bin/fzf-file-mark
diff --git a/.local/bin/fman b/.local/bin/fzf-man
index 0d7e7ba..0d7e7ba 100755
--- a/.local/bin/fman
+++ b/.local/bin/fzf-man
diff --git a/.vimrc b/.vimrc
index 1506b2f..8a98508 100644
--- a/.vimrc
+++ b/.vimrc
@@ -155,8 +155,8 @@ nmap <Leader>mm :Maps<cr>
nmap <Leader>ma :Marks<cr>
" Search documentation under cursor
-nmap <Leader>dm :execute ':term ++close fman ' . expand('<cword>')<cr>
-nmap <Leader>di :execute ':term ++close fdoc ' . expand('<cword>')<cr>
+nmap <Leader>dm :execute ':term ++close fzf-man ' . expand('<cword>')<cr>
+nmap <Leader>di :execute ':term ++close fzf-doc ' . expand('<cword>')<cr>
nmap <Leader>dt :execute ':term dict -h localhost -d dict-moby-thesaurus-latest ' . expand('<cword>')<cr>
" Load and save sessions
@@ -203,9 +203,9 @@ nmap <Leader>op :History<cr>
nmap <Leader>oc :History:<cr>
nmap <Leader>ol :Locate<space>
nmap <Leader>ot :execute '! urxvt -cd ' . expand('%:p:h') . ' &'<cr><cr>
-nmap <Leader>od :call fzf#run({'options': ['--preview', 'ls {}'], 'source': "cut -d' ' -f3 $HOME/Documents/.fzf-marks", 'sink': 'cd', 'down': '20%'})<cr>:pwd<cr>
+nmap <Leader>od :call fzf#run({'options': ['--preview', 'ls {}'], 'source': "cut -d' ' -f3 $FZF_DIRECTORY_MARKS", 'sink': 'cd', 'down': '20%'})<cr>:pwd<cr>
nmap <Leader>oo :call fzf#run({'options': ['--preview', 'head -20 {}'], 'source': 'rg --files --hidden \|\| find . -type f -printf "%P\n"', 'sink': 'e', 'down': '20%'})<cr>
-nmap <Leader>of :call fzf#run({'options': [], 'source': "cat $HOME/Documents/.fzf-fmarks", 'sink': 'e', 'down': '20%'})<cr>:pwd<cr>
+nmap <Leader>of :call fzf#run({'options': [], 'source': "cat $FZF_FILE_MARKS", 'sink': 'e', 'down': '20%'})<cr>:pwd<cr>
" View function documentation
nmap <Leader>vdp