LinuxBasics.org

The community that helps people to run Linux

rss
Table of Contents

Copy and Paste Without Mouse in Console Editors

For a general overview of copy and paste in Linux, visit this page.

Joe

In joe to copy and paste, you must first mark the block. This is similar to hilighting with the mouse.

If you press “Ctrl-k m” instead, you move the text rather than simply copying it.

You can open more than one file in joe and copy and paste from one file to the next.

Another sort of copy and paste is to insert a file into the current text.

The contents of the file will be placed at the cursor of the file you are editing.

Vi/Vim

With vi you do “yank” and “put.” When you open the file in vi, you are in command mode. If you have already entered Insert mode prior to the copy and paste, you will need to first go into Command mode again. ESC key gets you there.

In vi you can have more than one file open at a time in split windows. That way you can yank and paste from one file to another.

To copy and paste from one file to the other

Emacs

My favorite way of copying text in emacs is by means of the “kill-ring”.

To delete a line in emacs, press ctrl-k (“kill”). Press it twice, and the cr/lf-character that marks the line-end will also be killed. But the data you kill is not discarded right away. It is stored in the so called “kill-ring”. Thus you can think of it as the “cut” command in GUI-applications.

Ctrl-y (“yank”) then inserts the contents of the kill-ring into the file at the current cursor position. You can yank the same kill-ring multiple times at different positions in the file.

The kill-ring is emptied if you kill something after moving the cursor.

After a short while of practicing, you will be able to perform cut, copy and paste operations just as quick as with the mouse in a GUI.

There is a way of marking regions and cut/copy/paste them in emacs, but I never use them. I just love the kill-ring. :)


Copyright (c) by the authors.
Prior to editing, authors agreed to license their contributions by the terms of the GPL.
See our licensing page for details.


Linux® is a registered trademark of Linus Torvalds.


 
  tutorials/using/editors/copy_paste.txt · Last modified: 2008/07/20 19:08

LinuxBasics.org

Start Linux-Course Tutorials Linux Links Security Blog Forum E-mail List Search Online Chat

Site-Info

Help Get in Touch Making of LBo

Wiki-Control

Powered by

Linux Apache DokuWiki Mailman RUTE ht://Dig