diff --git a/vifm/.config/vifm/vifmrc b/vifm/.config/vifm/vifmrc index f212d58..0cc00d4 100644 --- a/vifm/.config/vifm/vifmrc +++ b/vifm/.config/vifm/vifmrc @@ -149,18 +149,23 @@ command! run !! ./%f command! make !!make %a command! mkcd :mkdir %a | cd %a " command! vgrep nvim "+grep %a" -command! reload :write | restart +command! syncme :cd %D -command! FZFlocate : set noquickview +command! fzfhome : set noquickview \| let $FZF_PICK = term('locate $HOME | fzf 2>/dev/tty') \| if $FZF_PICK != '' \| execute 'goto' fnameescape($FZF_PICK) \| endif -command! FZFfind : set noquickview +command! fzf : set noquickview \| let $FZF_PICK = term('find | fzf 2>/dev/tty') \| if $FZF_PICK != '' \| execute 'goto' fnameescape($FZF_PICK) \| endif +command! fzfcd : set noquickview + \| let $FZF_PICK = term('find -type d | fzf 2>/dev/tty') + \| if $FZF_PICK != '' + \| execute 'cd' fnameescape($FZF_PICK) + \| endif " }}} " vifminfo {{{ " ------------------------------------------------------------------------------ @@ -246,14 +251,6 @@ qnoremap q nnoremap J tj nnoremap K tk -" Example of standard two-panel file managers mappings -nnoremap :!less %f -nnoremap :edit -nnoremap :copy -nnoremap :move -nnoremap :mkdir -nnoremap :delete - " toggle options command! toggle :execute 'set %a! | echo "%a" &%a' nnoremap tw :toggle wrap @@ -267,19 +264,38 @@ nnoremap te :execute ':tree! | echo ":tree"' nnoremap t nnoremap tt t -" Switch pane to same directory as opposite pane -nnoremap :cd %D - " zo shows hidden files, mimicking fold open in vim -- why does zc not close " again? nnoremap zc zm " external commands " extract currently selected file(s) -nnoremap gx :!atool -x %f +nnoremap xx :!atool -x %f +" compress currently selected file(s) +nnoremap xc :!atool -a %c:r.tar.gz %f +" archive currently selected file(s) +nnoremap xa :!atool -a %c:r.tar %f " combine selected PDFs into single one (named output.pdf) noremap gc :!pdftk %f cat output output.pdf +" fzf movements +nnoremap f :fzf +nnoremap c :fzfcd +nnoremap F :grep + +" allows preview to work for normal view and single pane view +noremap w : if &quickview && !layoutis('only') + \| view + \| else + \| if layoutis('only') + \| if &lines + 50 < &columns | vsplit | else | split | endif + \| endif + \| view! + \| execute 'qnoremap w q:view|only|qunmap wcr>' + \| execute 'wincmd w' + \| endif + \| + " }}} " Classify (Icons) {{{ " file types @@ -403,6 +419,8 @@ fileviewer *.gif " Images filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm + \ {View in vimiv} + \ vimiv %f, \ {View in sxiv} \ sxiv %f, \ {View in feh}