fcopy

Created: 2012-03-22 02:12
Updated: 2018-07-08 16:51
License: gpl-2.0

README.md

fcopy.el

Introduction

fcopy starts fcopy-mode, a minor mode to copy text; first, set the paste point, and next look for the text to copy. The past point is the point where fcopy-mode start. One stroke commands are provided to search and copy the text. Copy commands automatically back the cursor to the past point, insert the text, and exit fcopy-mode.

Install fcopy

Put this in your .emacs file:

(autoload 'fcopy "fcopy" "Copy lines or region without editing." t)

Usage of fcopy

M-x fcopy brings you into Funny Copy mode. The place where you get in fcopy-mode is the paste point; the text you choose to copy will be inserted.

You can exit Funny Copy in 2 ways. C-g exits Funny Copy and takes your cursor back to the paste point. q just exits and does not move.

Moving Commands

Some 1-stroke key commands are prepared, like view-mode. f, b, n, p, a, e are in common with C-f, C-b, C-n, C-p, C-a, C-e, respectively.

C-f (C-b)
forward (backward) char.
f (b)
forward (backward) word.
n (p)
next (previous) line with skipping blank lines.
a (e)
beginning (end) of line.
A (E)
beginning (end) of sentence.
N (P)
next (previous) paragraph.
SPACE (BackSpace)
scroll up (down).
s (r)
forward (backward) incremental search.
S (R)
forward (backward) incremental search with regexp.
< (>)
beginning (end) of buffer.
g
Go to line
o
Other buffer
, (comma)
Pop mark ring

Copy Commands

Copy commands take us back to the past point, insert copy text, and exit Funny Copy.

. (period)
Set mark
k
copy the rest of the current line like C-k. If you type k just after entering fcopy-mode, Funny Copy copies text from above line.
RET
copy region like M-w. If mark is not active, copy the whole current line. With prefix arg, remove the white spaces around the copy text.
M-RET
copy rectangle.
w
copy word.
c
copy char.
C or Shift-Space
copy block text. Block text means text that separated by spaces. For example, one-to-one is regarded as 3 words by Emacs. However, for Funny Copy, it is regarded as one block.
( (left parenthesis)
copy text between the parens (ex. (...), {...}, [...], <...>). You should use this command in the parens, of course. If you don't need to copy the parens around text, use ) (right parenthesis) instead.
' (single quote)
copy text surrounded by the same chars (ex. '...', "...", $...$). You should use this command in the chars, of course. If you don't need to copy the chars around text, use " (double quote) instead.
; (semi-colon)
copy comments. Comment pattern is depended on major mode.

If you want not to copy text, but to cut, toggle delete flag with C-d. You can see a delete mark :d in mode line.

If you want modify the copy text before paste it, toggle modify flag with typing m. You can see a modify mark :m in mode line. When modify flag is on, modify buffer is opened before inserting the text. You can modify the text with replacement and insert the modified text with C-cC-c. See the commentary section in fcopy.el for details.

Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more