Show
Ignore:
Timestamp:
10/05/08 11:59:35 (5 years ago)
Author:
from_kyushu
Message:

quickrun.vim更新

Location:
dotfiles/vim/from_kyushu/.vim
Files:
1 added
1 modified

Legend:

Unmodified
Added
Removed
  • dotfiles/vim/from_kyushu/.vim/plugin/quickrun.vim

    r20558 r20761  
    2323    call append(0, '') 
    2424    execute 'silent! read !' quicklaunch_command 
     25    silent 1 delete _ 
     26  setlocal nomodifiable 
     27endfunction 
     28 
     29function! s:quicklaunch_list() 
     30  if !exists('g:quicklaunch_commands') 
     31    echo 'no command registered' 
     32    return 
     33  endif 
     34  call s:open_result_buffer('quicklaunch_list') 
     35  setlocal modifiable 
     36    silent % delete _ 
     37    call append(0, '') 
     38    for i in range(10) 
     39      if exists('g:quicklaunch_commands[i]') 
     40        call append(line('$'), i . ': ' . g:quicklaunch_commands[i]) 
     41      else 
     42        call append(line('$'), i . ': <Nop>') 
     43      endif 
     44    endfor 
    2545    silent 1 delete _ 
    2646  setlocal nomodifiable 
     
    7292 
    7393function! s:open_result_buffer(quickrun_command) 
    74   let bufname = printf('*quickrun* %s', a:quickrun_command) 
     94  let bufname = printf('[quickrun] %s', a:quickrun_command) 
    7595 
    7696  if !bufexists(bufname) 
     
    122142  execute "silent! nmap <unique> <Leader>" . i . "  <Plug>(quicklaunch-" . i . ")" 
    123143endfor 
     144nnoremap <silent> <Plug>(quicklaunch-list)  :<C-u>call <SID>quicklaunch_list()<Return> 
     145silent! nmap <unique> <Leader>l  <Plug>(quicklaunch-list) 
    124146 
    125147augroup plugin-quickrun