0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

VIMから秀丸Grepを呼び出す

Last updated at Posted at 2017-11-28

VIMから秀丸Grepを呼び出す

「なにやってんだろう」って、VimScript書きながら100回は唱えたかな

  • 苦しみ
    • Windowsのランチャーアプリからgrepを呼び出した時、カレントがランチャーアプリのフォルダになる
    • 上記の解決方法がよくわからない
    • 上記理由で、vimからgrep呼び出すとパス入力が億劫
    • 上記理由で、Grepだけ秀丸を使っている
    • もっと良い方法があれば、教えてください
"call hidemall grep"{{{
if has('win32')
  nnoremap <silent> <leader>H :<c-u>call <SID>HidemaruGrep()<CR>

  function! s:HidemaruGrep()
    let l:word = input('Search:')
    let l:ftype= input('Extension(.txt):')
    if l:ftype == ""
        let l:ftype = "*"
    else
        let l:ftype = "*" . l:ftype
    endif

    let l:targetfile  = expand("%:p")
    let l:lastfolderid = strridx(targetfile,"/")
    let l:targetfolder = l:targetfile[0:l:lastfolderid] . l:ftype

    let l:cmd = '!"C:\Program Files (x86)\Hidemaru\Hidemaru.exe" /gu, "' . l:targetfolder . '"' . l:word
    silent execute l:cmd
  endfunction
endif
"}}}

0
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?