1

I am trying to execute ack from vim. But for some reason vim decides to stop after executing ack. How can I stop vim from stopping?

(on some systems what I call ack is called ack-grep)

What I am doing in vim:

:!ack something

what happens is this:

$vim myfile.myextension

somefile.someext
356:              : this line contains something and somewhat

[1]+  Stopped                 vim chatconfig.js

When I run fg it says this:

vim myfile.myextension

Press ENTER or type command to continue

And when I press enter it returns to vim.

What I expect to happen is this:

$vim myfile.myextension

somefile.someext
356:              : this line contains something and somewhat

Press ENTER or type command to continue

so without the fg thing.

I have a workaround, by piping ack to something silly:

:!ack something | grep -v "asdasdasd"

But I would like to just know the trick, which is automatically happening when piping to grep.

Vim7.4, Ubuntu 15.10, ack 2.14

2
  • Try :!ack --flush something. BTW, ack works fine from vim for me. ack 2.14, vim 7.4, debian sid. Also BTW did you read the section in the ack man page about Vim integration? – cas Apr 13 '16 at 10:15
  • @cas, Thanks, but the --flush option did not help. Thanks for pointing out vim integration, that looks like a workable situation. – Veda Apr 13 '16 at 11:02
1

I had this hack in my vimrc:

set shellcmdflag=-ic

to get bash aliases to work in vim. This caused the described behaviour. By piping ack to another process ack will be runned non-interactive.

Solution, delete the hack.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.