Giter Club home page Giter Club logo

Comments (5)

AndrewRadev avatar AndrewRadev commented on July 28, 2024

I'm the author of vimrunner, a project that also tries to drive Vim using the --remote interface.

My solution is to just always use --remote-expr for anything that requires confirmation, since it waits to return output. You can run normal-mode mappings by triggering --remote-expr with either feedkeys() or normal!, and you can run commands like :write by defining a vim-level function that executes the command.

The relevant code for commands is here. The VimrunnerEvaluateCommandOutput function is defined in Vimscript and also tries to capture any output from the command. I've had various issues with that and silent!, but that may not be interesting to you.

from vroom.

dbarnett avatar dbarnett commented on July 28, 2024

Awesome, thanks! We were evaluating that approach, but hit some snags with special key codes, continued lines, and error handling and haven't finished getting something working yet. But glad to know it's feasible.

from vroom.

AndrewRadev avatar AndrewRadev commented on July 28, 2024

Yeah, escaping can be annoying when you pass things around a bunch of strings that are then given to arguments to functions that are then sent through the remote interface. I would suggest you browse through the relevant Vimrunner code, since it seems to be working well in practice (even so, I'd appreciate reports of any bugs/inconsistencies you notice in there :)).

from vroom.

AndrewRadev avatar AndrewRadev commented on July 28, 2024

Ah, also, just noticed you mentioned error handling. I may sit down and write a lengthy explanation of what I remember of my own problems/solutions in that area, but I'll see if I find the time.

from vroom.

dbarnett avatar dbarnett commented on July 28, 2024

One special case I noticed is it seems to have trouble with executing shell commands in the foreground (with :!) that make it take slightly longer than our default neovim delay (example: https://travis-ci.org/github/bazelbuild/vim-bazel/jobs/756778325).

from vroom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.