From e334ad55d9459382241bb12eb90b0705afd04d81 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Thu, 8 Apr 2021 10:30:20 +0800 Subject: update --- alias | 3 ++- vimrc | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/alias b/alias index 4856ad5..10cee1c 100644 --- a/alias +++ b/alias @@ -184,6 +184,7 @@ alias ce='crontab -e' # lf alias r='_lf_cd' +alias l='_lf_cd' _lf_cd() { tempfile=$(mktemp -t tmp.XXXXXX) lf --last-dir-path $tempfile @@ -291,7 +292,7 @@ image_horizontal() { } # thunderbird -alias thunder.pull='rsync -a --delete pham@topo.tw:~/.thunderbird/ ~/.thunderbird/' +alias thunder.pull='rsync -a --delete pham@topo.tw:~/.thunderbird/ ~/.thunderbird &' # misc alias foo='echo bar > foo && echo File foo is created && ls -lh foo' diff --git a/vimrc b/vimrc index 2a15d63..24d142d 100644 --- a/vimrc +++ b/vimrc @@ -206,3 +206,29 @@ Plug 'suan/vim-instant-markdown', {'for': 'markdown'} " Initialize plugin system call plug#end() + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" => lf +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Use lf as file selector +function! LF() + let temp = tempname() + exec 'silent !lf -selection-path=' . shellescape(temp) + if !filereadable(temp) + redraw! + return + endif + let names = readfile(temp) + if empty(names) + redraw! + return + endif + exec 'edit ' . fnameescape(names[0]) + for name in names[1:] + exec 'argadd ' . fnameescape(name) + endfor + redraw! +endfunction +command! -bar LF call LF() +" Override NERDTree comes with amix/vimrc +map nn :LF -- cgit v1.2.3-70-g09d2