Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6949591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:58:30+00:00 2026-05-27T13:58:30+00:00

I’d like to build an interface in Javascript where I collect key presses and

  • 0

I’d like to build an interface in Javascript where I collect key presses and send them to a remote vim instance and have the instance report back any changes. I’m quite confident I can implement all of the browser-server communication and javascript — I’m just not sure how to pass the data to vim and how to have it talk back to me.

Any pointers would be appreciated! Thanks

Edit: An initial implementation can be found on Github.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:58:30+00:00Added an answer on May 27, 2026 at 1:58 pm

    Take a look at TextAid (specifically the Perl server). Maybe you’ll find useful ideas.

    –RE-EDIT–

    Since I like your idea I’ve looked a bit further.

    Supposing Vim is compiled with +clientserver, you can launch vim like this:

    $ vim --servername MYSERVER /path/to/tempfile`
    

    on your remote box. Vim is launched in server mode and you can send it commands like:

    $ vim --servername MYSERVER --remote-send 'ihello<Esc>'
    

    to have:

    hello
    

    on the first line, if you send:

    $ vim --servername MYSERVER --remote-send 'A world<Esc>'
    

    you obtain:

    hello world
    

    If you send:

    $ vim --servername MYSERVER --remote-send 'yy5p'
    

    you obtain:

    hello world
    hello world
    hello world
    hello world
    hello world
    

    If you send:

    $ vim --servername MYSERVER --remote-send ':%s/hello/goodbye cruel<CR>'
    

    you obtain:

    goodbye cruel world
    goodbye cruel world
    goodbye cruel world
    goodbye cruel world
    goodbye cruel world
    

    which is kind of cool but you need to send back the new state of the buffer which you would do by writing the temporary file and sending its content back to the client after each command. That means a lot of read/write on your server. One could also write a macro that sends the content of the buffer to some external process on each “change”.

    –EDIT–

    If you had followed the link instead of dismissing my answer you would have seen that the extension above works by sending the content of the textarea to the Perl server via HTTP.

    I don’t think it matters at all if Vim is local or on a distant server.

    The server writes it into a temporary file that is then opened with Vim.

    When Vim writes the file, its content is then sent back to the extension by the server.

    Your piece of JS would do what the extension does: grab the content of the textarea, send it via an AJAX POST request to your server, wait for an answer and update the content of the textarea with it.

    Actually, I think that you could even use the script above as is. Or at least take it as a starting point for your own app.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have some data like this: 1 2 3 4 5 9 2 6
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
I've got a string that has curly quotes in it. I'd like to replace
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.