aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHsieh Chin Fan <typebrook@gmail.com>2021-04-08 10:30:20 +0800
committerHsieh Chin Fan <typebrook@gmail.com>2021-04-08 10:30:20 +0800
commite334ad55d9459382241bb12eb90b0705afd04d81 (patch)
treecb04200eedbc9efee733ddc684f3acc9b493bedc
parentfeff9da066006c502c92da88f777e9585b1c0ea3 (diff)
update
-rw-r--r--alias3
-rw-r--r--vimrc26
2 files changed, 28 insertions, 1 deletions
diff --git a/alias b/alias
index 4856ad5..10cee1c 100644
--- a/alias
+++ b/alias
@@ -184,6 +184,7 @@ alias ce='crontab -e'
184 184
185# lf 185# lf
186alias r='_lf_cd' 186alias r='_lf_cd'
187alias l='_lf_cd'
187_lf_cd() { 188_lf_cd() {
188 tempfile=$(mktemp -t tmp.XXXXXX) 189 tempfile=$(mktemp -t tmp.XXXXXX)
189 lf --last-dir-path $tempfile 190 lf --last-dir-path $tempfile
@@ -291,7 +292,7 @@ image_horizontal() {
291} 292}
292 293
293# thunderbird 294# thunderbird
294alias thunder.pull='rsync -a --delete pham@topo.tw:~/.thunderbird/ ~/.thunderbird/' 295alias thunder.pull='rsync -a --delete pham@topo.tw:~/.thunderbird/ ~/.thunderbird &'
295 296
296# misc 297# misc
297alias foo='echo bar > foo && echo File foo is created && ls -lh foo' 298alias 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'}
206 206
207" Initialize plugin system 207" Initialize plugin system
208call plug#end() 208call plug#end()
209
210"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
211" => lf
212"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
213" Use lf as file selector
214function! LF()
215 let temp = tempname()
216 exec 'silent !lf -selection-path=' . shellescape(temp)
217 if !filereadable(temp)
218 redraw!
219 return
220 endif
221 let names = readfile(temp)
222 if empty(names)
223 redraw!
224 return
225 endif
226 exec 'edit ' . fnameescape(names[0])
227 for name in names[1:]
228 exec 'argadd ' . fnameescape(name)
229 endfor
230 redraw!
231endfunction
232command! -bar LF call LF()
233" Override NERDTree comes with amix/vimrc
234map <leader>nn :LF<cr>