Modify to communicate with Vim via client-server functionality #282

Open
brendanjerwin opened this Issue Jul 15, 2012 · 5 comments

Comments

Projects
None yet
3 participants
@brendanjerwin

See: http://vimdoc.sourceforge.net/htmldoc/remote.html

Currently it seems that PeepOpen is shelling vim/macvim to get it to open the file. That is why they always open in a new window/tab.

Using the client-server functionality of Vim (the server name could be sent to PeepOpen when it is launched from Vim) it should be possible to call a function in Vim with the path of the file to be opened.

Once that change is done then many other Vim related issues/feature requests could be implemented:

  • Open in current buffer
  • Open in split
  • Open in new tab

The launching command would send a hint to PeepOpen, and when PeepOpen calls back it could provide that hint back, allowing the appropriate dispatch.

@brendanjerwin

This comment has been minimized.

Show comment Hide comment
@brendanjerwin

brendanjerwin Jul 15, 2012

This script can be used to help ensure that a reasonable server name is set:

#!/bin/bash

mvim --servername "${PWD##*/}" .

This script can be used to help ensure that a reasonable server name is set:

#!/bin/bash

mvim --servername "${PWD##*/}" .
@brendanjerwin

This comment has been minimized.

Show comment Hide comment
@brendanjerwin

brendanjerwin Jul 15, 2012

Here is a simple example of sending a command to a running instance:

mvim --servername VIM --remote-send ":echo 'hello from the outside'<CR>"

Here is a simple example of sending a command to a running instance:

mvim --servername VIM --remote-send ":echo 'hello from the outside'<CR>"

@EDmitry

This comment has been minimized.

Show comment Hide comment
@EDmitry

EDmitry May 19, 2013

Looks like this was requested many times (even patch provided) but unfortunately was never implemented :( That's sad.

EDmitry commented May 19, 2013

Looks like this was requested many times (even patch provided) but unfortunately was never implemented :( That's sad.

@ghost ghost assigned topfunky May 20, 2013

@topfunky

This comment has been minimized.

Show comment Hide comment
@topfunky

topfunky May 20, 2013

Owner

I've experimented with this in the past and wasn't able to get it to work reliably.

Would everyone need to launch vim or mvim with the script that sets the name of the server? I'd like to make this work without changing developers' existing workflows.

However, this could make a way for PeepOpen to work with terminal vim, which would be really cool. It could be enough to make me switch from Emacs to Vim. ;-)

Owner

topfunky commented May 20, 2013

I've experimented with this in the past and wasn't able to get it to work reliably.

Would everyone need to launch vim or mvim with the script that sets the name of the server? I'd like to make this work without changing developers' existing workflows.

However, this could make a way for PeepOpen to work with terminal vim, which would be really cool. It could be enough to make me switch from Emacs to Vim. ;-)

@topfunky

This comment has been minimized.

Show comment Hide comment
@topfunky

topfunky May 20, 2013

Owner

Also, MacVim already has a setting that basically fixes the main problem by opening files in the current window:

https://peepcode.com/system/uploads/2010/PeepOpen-Help/editors%20-%20macvim.html

Owner

topfunky commented May 20, 2013

Also, MacVim already has a setting that basically fixes the main problem by opening files in the current window:

https://peepcode.com/system/uploads/2010/PeepOpen-Help/editors%20-%20macvim.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment