mileszs / ack.vim

Vim plugin for the Perl module / CLI script 'ack'
Other
3.08k stars 396 forks source link

Error opening tmp file on vim startup #115

Closed timabell closed 10 years ago

timabell commented 10 years ago

I've probably borked my install somehow but I can't figure out what's wrong. When I run vim it hangs, and when I hit ctrl-c I get the below error info:

$ vim
^C
Command terminated

Error detected while processing /home/tim/.vimbundles/ack.vim/plugin/ack.vim:
line   23:
E484: Cannot open file /tmp/vZxNMD0/0
Interrupted
Interrupt: Press ENTER or type command to continue

If I rm -rf /home/tim/.vimbundles/ack.vim/ then vim loads fine. If I re-clone ack.vim it breaks again. I had a look at the file mentioned and line 23 is https://github.com/mileszs/ack.vim/blob/master/plugin/ack.vim#L23 :

let s:ackprg_version = str2nr(matchstr(system(g:ackprg . " --version"),  '[0-9.]\+'))

which as far as my uneducated eyes can tell should work as the following works for me:

$ ack-grep --version
ack-grep 2.04
Running under Perl 5.14.2 at /usr/bin/perl

Copyright 2005-2013 Andy Lester.

This program is free software.  You may modify or distribute it
under the terms of the Artistic License v2.0.

Any ideas welcome. Apologies if this isn't the right place to report / ask. Thanks.

kassio commented 10 years ago

Hi @timabell, this is the better place to report, thank's for the reporting! :smile:

Did you changed your g:ackprg variable?

timabell commented 10 years ago

Thanks! I don't think I changed it. How do I check?

On 4 April 2014 14:43:50 BST, Kassio Borges notifications@github.com wrote:

Hi @timabell, this is the better place to report, thank's for the reporting! :smile:

Did you changed your g:ackprg variable?


Reply to this email directly or view it on GitHub: https://github.com/mileszs/ack.vim/issues/115#issuecomment-39565926

timabell commented 10 years ago

I think I know what I've done. I've remembered I was trying to get things to work differently for shell commands and I have a custom .vimrc https://github.com/timabell/dotmatrix/blob/master/.vimrc - going back to the hashrocket master un-breaks things so clearly I don't know what I'm doing. I'll close this as I don't think it's anything to do with ack.vim it's just the error that threw me.

Link to current version https://github.com/timabell/dotmatrix/blob/a50056f7a3fa86c1a17d71c6a7866dac83e24df8/.vimrc

timabell commented 10 years ago

narrowed it down to this line in my .vimrc that's breaking things:

let $BASH_ENV="~/.bashrc"

Comment it out and it works again. https://stackoverflow.com/questions/8841116/vim-not-recognizing-aliases-when-in-interactive-mode/18901595#18901595

kassio commented 10 years ago

That strange.. If you get how it was blowing up ack.vim, please let me know.

timabell commented 10 years ago

Okay I've narrowed it down and I don't think it's anything to do with ack.vim. It's probably just the first thing to run an external command when I start vim.

I'm loading my proper bash environment when I run commands so I can do more things with "!" in vim - https://github.com/timabell/dotmatrix/blob/master/.vimrc#L25 and this in turn loads rbenv (which is entirely my own fault) using eval https://github.com/timabell/dotmatrix/blob/master/.bashrc#L44 and if I comment out this line the hang goes away.

I don't yet know why this hangs (my vim fu is not nearly that strong yet). I won't report further unless you are really curious but if you want to know more you could always follow my dotmatrix repo which will get a fix if I can figure it out.