5 ms·
After running :terminal, is there a way to yank text from my editor window and paste it into the terminal? Likewise, is there a way to copy text from the output
by emacsvimlover 8y ago
After running :terminal, is there a way to yank text from my editor window and paste it into the terminal? Likewise, is there a way to copy text from the output of a command (run in the terminal) and paste it into the other window?
- Elidrake24 8y agoFor Mac OS, I'd suggest sharing the default storage buffer with the clipboard: http://vim.wikia.com/wiki/Mac_OS_X_clipboard_sharing http://vim.wikia.com/wiki/Mac_OS_X_clipboard_sharing
- jdc0589 8y agoprobably a good idea, but I've always gotten by with selecting text, then just `:!pbcopy && pbpaste` when I need to get something TO the system clipboard.
- bartbes 8y agoYou can go to terminal-normal mode using ctrl-w N, and then you can select and yank as usual. To paste, you can use ctrl-w " <register>. Also see :help terminal.
- dpelle 8y agoIn a terminal window, you can type CTRL-W N (with upper case N) to switch the terminal to normal mode, where you can then move in the buffer and copy things in the terminal buffer using regular vim commands. You can go back to typing commands in the terminal by typing i or a (as when going in insert mode). You can paste in the terminal using CTRL-W " followed by the register name. See :help terminal
- emacsvimlover 8y agoThanks all!
- e12e 8y agoThe default keybindings are ctrl-w "" (assuming you want to paste from " register - or * to paste from clipboard: ctrl-w " * ). It's a shortcut for pasting.