Jump to content
cdpath

Edit clipboard within MacVim

Recommended Posts

This workflow simply:

1. save clipboard to a temporary file

2. open that temp file with MacVim

3. Waiting for you to finish editing (by default, you have 30s to edit)

4. Send edited content to clipboard

 

GitHub repo, download from GitHub

 

 

Edited by cdpath

Share this post


Link to post

Couple of suggestions:


  • The source code of your workflow isn't in the repo, only the Python script it uses. That makes it hard for people to make pull requests.
  • Why don't you use the /usr/local/bin/mvim -f <filepath> command to open the file? This waits until the user closes the window, so you know when the user has actually finished editing the file.

 

Share this post


Link to post
4 hours ago, deanishe said:

Couple of suggestions:

 

  • The source code of your workflow isn't in the repo, only the Python script it uses. That makes it hard for people to make pull requests.
  • Why don't you use the /usr/local/bin/mvim -f <filepath> command to open the file? This waits until the user closes the window, so you know when the user has actually finished editing the file.

 

 

 

1. I've updated source codes in GitHub

2. 'cos I don't know :ph34r:. I've rewrite the workflow according to your advice.

 

Thank you!

Share this post


Link to post
16 hours ago, deanishe said:

Couple of suggestions:

 

  • The source code of your workflow isn't in the repo, only the Python script it uses. That makes it hard for people to make pull requests.
  • Why don't you use the /usr/local/bin/mvim -f <filepath> command to open the file? This waits until the user closes the window, so you know when the user has actually finished editing the file.

 

 

 

Found a issue with MacVim 8.0 on macOS Sierra. When I `:wq` to finish editing, MacVim process still exists, and this workflow hang over there until I CMD-Q MacVim itself. So I have to use the following one to make sure MacVim is done, which, of cause will affect other MacVim window (if there is one).
 

/usr/local/bin/mvim -f $filename && killall MacVim

 

Is there a better way out?

 

Thank you in advance!

Share this post


Link to post

Hmm. On my machine, the command returns when I close the window it opened (i.e. I can leave other MacVim windows open and the application running).

 

Share this post


Link to post
On 8/1/2017 at 10:12 PM, deanishe said:

Hmm. On my machine, the command returns when I close the window it opened (i.e. I can leave other MacVim windows open and the application running).

 

 

I found a setting in MacVim,  'Quit MacVim' after last window closes. Now it works.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...