coolwanglu / neovim-e

Electron UI for Neovim
MIT License
271 stars 29 forks source link

Paste not working in OSX #29

Open norcalli opened 9 years ago

norcalli commented 9 years ago

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, 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.

coolwanglu commented 9 years ago

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

gglanzani commented 9 years ago

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

norcalli commented 9 years ago

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 notifications@github.com 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

coolwanglu commented 9 years ago

Did you set :set paste?

norcalli commented 9 years ago

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.

vito-c commented 9 years ago

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.

justinmk commented 9 years ago

This is a nvim bug, not neovim-e.