문제

Here is my .vimrc for Ack, But it can't search .go files, I'd like add .go support.

let g:ackprg="ack-grep -H --nocolor --nogroup --column"

function! Ack(args)

let grepprg_bak=&grepprg
exec "set grepprg=" . g:ackprg
execute "silent! grep " . a:args
botright copen
let &grepprg=grepprg_bak
exec "redraw!"

endfunction

command! -nargs=* -complete=file Ack call Ack(<q-args>)
도움이 되었습니까?

해결책

Since version 1.94, ack has support for the Go language built-in.

$ ack --help type
...
    --[no]go           .go

You can explicitly enable it by passing --go, but it should be included in the search by default.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top