Copy and paste text in midnight commander (MC) via putty in Linux
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?
Solution 1:
I would do it like this:
- switch to block selection mode by pressing F3
- select a block
- switch off block selection mode with F3
- press Ctrl+F which will open
Save block
dialog - press Enter to save it to the default location
- open the other file in the editor, and navigate to the target location
- press Shift+F5 to open
Insert file
dialog - 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.
Solution 2:
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.