Copy and paste text in midnight commander (MC) via putty in Linux

by Den   Last Updated June 28, 2017 18:01 PM

I use Midnight Commander (MC) editor over putty to edit files

I want to know how to copy text from one file, close it then open another file and paste it?

If it is not possible with Midnight Commander, is there another easy way to copy and paste specific text from different files?

Answers 6

I would do it like this:

  1. switch to block selection mode by pressing F3
  2. select a block
  3. switch off block selection mode with F3
  4. press Ctrl+F which will open Save block dialog
  5. press Enter to save it to the default location
  6. open the other file in the editor, and navigate to the target location
  7. press Shift+F5 to open Insert file dialog
  8. press Enter to paste from the default file location (which is same as the one in Save block dialog)

NOTE: There are other environment related methods, that could be more conventional nowadays, but the above one does not depend on any desktop environment related clipboard, (terminal emulator features, putty, Xorg, etc.). This is a pure mcedit feature which works everywhere.

March 12, 2015 22:40 PM

IF you're using putty in either Xorg or Windows (i.e terminal within a gui) , it's possible to use the "conventional" right-click copy/paste behavior while in mc. Hold the shift key while you mark/copy.

May 26, 2015 13:17 PM

To copy: (hold) Shift + Select with mouse (copies to clipboard)

To paste in windows: Ctrl+V

To paste in another file in PuTTY/MC: Shift + Ins

Other hotkeys here.

Midnight Commander tutorial here.

April 28, 2016 08:13 AM

Putty has ability to copy-paste. In mcedit, hold Shift and select by mouse

June 06, 2016 06:37 AM

  1. Hold down the Shift key, and drag the mouse through the text you want to copy. The text's background will become dark orange.
  2. Release the Shift key and press Shift+Ctrl+c. The text will be copied.
  3. Now you can paste the text to anywhere you want by pressing Shift+Ctrl+v, even to the new page in MC.
February 15, 2017 04:09 AM

According to help in MC:

Ctrl+Insert copies to the mcedit.clip, and Shift+Insert pastes from mcedit.clip.

It doesn't work for me, by some reason, but by pressing F9 you get a menu, Edit > Copy to clipfile - worked fine.

April 11, 2018 13:20 PM

Related Questions

How to right-click to paste in mcedit

Updated July 05, 2017 03:01 AM