neovim-e icon indicating copy to clipboard operation
neovim-e copied to clipboard

Paste not working in OSX

Open norcalli opened this issue 9 years ago • 7 comments

I'm not sure about other OS's, but paste isn't working in any capacity for me. I believe it's just a no-op because of the default menu.

Regardless of the default menu, <D-v> is sent to neovim, but neovim doesn't handle <D-...> mappings it seems because doing nmap <D-v> hi and then map < shows that it's registering it as individual keystrokes and not one key combination.

I can add a handler to respond to cmd-v from the menu, but I'm not sure how paste is implemented in neovim, and I would like to do it the official way if there is a msgpack endpoint.

norcalli avatar Mar 19 '15 15:03 norcalli

neovim uses pbcopy and pbpaste http://neovim.org/doc/user/nvim_clipboard.html

coolwanglu avatar Apr 06 '15 14:04 coolwanglu

@coolwanglu @norcalli Will we then be able to have it easily? Is there still work to be done?

gglanzani avatar May 09 '15 08:05 gglanzani

I implemented it on my branch, but I think mine is outdated now. I did it the way neovim did it which is to use and and set mappings for different modes  and pretend the input with those keystrokes to trigger in the right mode. That's why there was a bug for a bit about those characters showing up in paste a while back.

Thank you,Ashkan Kiani

On Sat, May 9, 2015 at 1:04 AM, Giovanni [email protected] wrote:

@coolwanglu @norcalli Will we then be able to have it easily? Is there still work to be done?

Reply to this email directly or view it on GitHub: https://github.com/coolwanglu/neovim-e/issues/29#issuecomment-100445169

norcalli avatar May 09 '15 08:05 norcalli

Did you set :set paste?

coolwanglu avatar May 09 '15 08:05 coolwanglu

Sorry I was going to sleep last night. On the paste trigger, I do @ui.emit "input", "<f37>#{text}<f36>" and previously I defined

    @command 'inoremap <f37> <f36>'
    @command 'nnoremap <f37> <f36>o'
    @command 'set pastetoggle=<f36>'

where @command is just a @session.request "vim_command", [cmd], (err, resp) =>.

This should make it so that the paste command triggered inserts the text in each mode. Obviously I chose the behaviour of it pasting on a new line and choosing to stay in insert mode.

norcalli avatar May 09 '15 23:05 norcalli

When I go to insert mode then run cmd v I get my pasted text wrapped in <F37> However when I run "+p I get the correct pasted text.

vito-c avatar Aug 31 '15 16:08 vito-c

This is a nvim bug, not neovim-e.

justinmk avatar Aug 31 '15 16:08 justinmk