6

I would like to copy and paste multiple lines in the command line text editor nano on OSX Mountain Lion 10.8.5

Alt-6 and Ctrl-U do not work as on other platforms.

codecowboy
  • 3,262

4 Answers4

10

The problem is that in Mac Terminal, the alt key doesn't work unless you change the Terminal Preferences to enable Use Option as Meta key. Then alt+6 will work properly to copy.

Another choice is to use the ESC key instead of alt. So do ESC+6.

wisbucky
  • 5,165
4

You may be able to cut multiple lines into a buffer using Ctrl-K, and paste them back in using Ctrl-U.

Note that this does not copy the text onto your OS X clipboard, but uses a buffer inside of nano (or the shell?) to perform the actions.

Eddie Kelley
  • 3,278
1

If you'd like to paste text from clipboard just use Cmd + V - works well

0

In my case my clipboard was getting bracketed.

Typing reset in the terminal window (or Cmd+R) fixed my issue and allowed me to paste in nano with Cmd+V as usual.

agarza
  • 2,274