Closed (fixed)
Project:
Vim Plugin For Drupal
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
17 May 2013 at 14:31 UTC
Updated:
11 Jan 2015 at 03:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
benjifisherHm, that sounds hard.
Just brainstorming here, I guess we could run the command in the background and pipe the output to a temporary file, then open the file in a new buffer. Getting it to auto-update is a problem.
There may be some entirely different method that works on Windows. Something like start, right?
Why not just do this in a terminal window? Is your goal never to leave vim, or is it really useful to search the output from the drush command?
If you track me down at DrupalCon, we can try to work on this.
Comment #2
kostajh commentedYes, this could just be done in a terminal window, but it would be nice to be able to stay in Vim.
Couple of things that may be relevant:
I won't be at DrupalCon unfortunately.
Comment #3
kostajh commentedIt turns out that this is really simple with vim-dispatch. See https://github.com/kostajh/drupal.vim/commit/e5ec14e587982ecd39466d1c475...
Comment #4
benjifisher@kostajh:
Can we talk some time about merging the two forks of this project? If there is one thing I hate, it is duplication of effort, and extracting a patch from your GitHub project in order to apply it to this project is not a good workflow.
I started with your commit e5ec14e5 and made some changes:
if ... else ... endif endfunI usedif ... return endif ... endfun. Personal preference: I do not like large sections of conditional code.'statusline'definition to the top of the function.exe 'Dispatch'.' drush ' . a:commandtoexe 'Dispatch drush' a:command. It should really beexecute(spelled out) for consistency.'statusline'in the vim-dispatch branch (see below).I tested with
:Drush pmland:Drush help. (First I installed vim-dispatch and restarted vim.) It seems to me that I still had to wait until the command was done before I could continue working. Is there some configuration I have to make for vim-dispatch to do what you want?I commented out the
'statusline'setting because it seems to apply to the window in which I started instead of the window containing the drush output. That seems like a bug to me. Is there some way to set the status line on the quickfix window?Comment #5
kostajh commented@benjifisher I'm happy to to merge the changes I made back into this project. I had emailed you about 6 months ago but never heard back, and figured having my changes in GitHub would be better than a bunch of patches to my local plugin :-)
Are you using tmux? vim-dispatch won't do much for you otherwise. I'm on IRC as kostajh, send me a message and we can discuss merging.
Comment #6
rodrigoaguileraI tried to test this patch
First I had no dispatch vim plugin, running a long drush task blocks vim until it ends.
Applied this patch and I got the same behavior.
Installed https://github.com/tpope/vim-dispatch
And when I run the drush long task I'm brought back to what I had in the terminal emulator. Then I go back to vim with and additional window open with the output of the command (with extra information about output with colors, rubish)
Also installed tmux but nothing changed from the previous behaviour.
I think it needs more explanation about what is expected from this change.
@kostajh:
I would be happy also to concentrate the efforts here. Appart from this feature do you have more improvements in your fork?
Can you open an issue for them?
Comment #7
kostajh commented@rodrigoaguilera Yeah, you need to be using tmux and vim-dispatch for this feature to work. And, it really does work! You can run a long running task (e.g. drush ws --tail) and not have your editor blocked. I'm unpublishing my fork because I'm no longer using Vim - Emacs + evil-mode convert here :-) Good luck!
Comment #8
rodrigoaguileraOk
What I wasn't doing is running the session inside tmux. Now I see it in action.
Comment #9
benjifisherI guess this does not really need documentation. If you have vim-dispatch installed, then probably you know to use it with tmux or similar. If you do not have it installed, then the patch does not do any harm.