diff options
| -rw-r--r-- | alias | 3 | ||||
| -rw-r--r-- | vimrc | 26 |
2 files changed, 28 insertions, 1 deletions
| @@ -184,6 +184,7 @@ alias ce='crontab -e' | |||
| 184 | 184 | ||
| 185 | # lf | 185 | # lf |
| 186 | alias r='_lf_cd' | 186 | alias r='_lf_cd' |
| 187 | alias 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 |
| 294 | alias thunder.pull='rsync -a --delete pham@topo.tw:~/.thunderbird/ ~/.thunderbird/' | 295 | alias thunder.pull='rsync -a --delete pham@topo.tw:~/.thunderbird/ ~/.thunderbird &' |
| 295 | 296 | ||
| 296 | # misc | 297 | # misc |
| 297 | alias foo='echo bar > foo && echo File foo is created && ls -lh foo' | 298 | alias foo='echo bar > foo && echo File foo is created && ls -lh foo' |
| @@ -206,3 +206,29 @@ Plug 'suan/vim-instant-markdown', {'for': 'markdown'} | |||
| 206 | 206 | ||
| 207 | " Initialize plugin system | 207 | " Initialize plugin system |
| 208 | call plug#end() | 208 | call plug#end() |
| 209 | |||
| 210 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | ||
| 211 | " => lf | ||
| 212 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | ||
| 213 | " Use lf as file selector | ||
| 214 | function! 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! | ||
| 231 | endfunction | ||
| 232 | command! -bar LF call LF() | ||
| 233 | " Override NERDTree comes with amix/vimrc | ||
| 234 | map <leader>nn :LF<cr> | ||