Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run vim command after VimuxRunCommand. #162

Open
metasansana opened this issue Oct 31, 2017 · 5 comments · Fixed by #182
Open

Run vim command after VimuxRunCommand. #162

metasansana opened this issue Oct 31, 2017 · 5 comments · Fixed by #182

Comments

@metasansana
Copy link

Is this supported?

Say I want to run a lint vim plugin after I use VimRunCommand to build some files of BufWrite. I tried chaining them but vim does not wait for the shell command to complete before moving on to the next command in the chain.

Example:

autocmd BufWritePost,FileWritePost *.ts :execute 'VimuxRunCommand "make test"' | TsuGeterr
@leostera
Copy link
Member

Hi @metasansana I don't think this is something that is currently supported since the plugin simply sends the commands over to tmux and doesn't really know when the commands have been finished.

You may want to look into writing an async job that will do this for you. See here for a quick intro: http://andrewvos.com/writing-async-jobs-in-vim-8

@metasansana
Copy link
Author

Thanks @Ostera I'll check it out.

@alerque
Copy link
Member

alerque commented Feb 14, 2021

This should be a really easy fix, I think vimscript has a simple way to make commands chainable.

@alerque
Copy link
Member

alerque commented Feb 14, 2021

Yes and no. Setting up the commands so that you can use them in a chain is easy. I just setup a PR for that and it will close this issue shortly. The flip side of the coin is that @Ostera is right that the Vimux command will just do its thing and then move on. If you want to setup actions after certain shell results (either success or failure) you will need to chain them as part of the shell command you are launching. Passing some callback function to VIM from your other shell is kind of out of scope for this plugin. At that point you aren't interacting with Tmux so much as vim vs. your shell commands.

If there is anything we can do to facilitate an easier callback system I'd be happy to consider it, but given that the default usage is to leave the runner pane open I don't think there is a way to do this without hacking up a different set of commands that would no longer be async like Vimux is.

@alerque
Copy link
Member

alerque commented Feb 18, 2021

This caused a serious regression and I'm backing it out for now, see issue in #185 and reverting part of this feature in #186.

@alerque alerque reopened this Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants