From e334ad55d9459382241bb12eb90b0705afd04d81 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Thu, 8 Apr 2021 10:30:20 +0800 Subject: update --- vimrc | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'vimrc') 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