[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How can I move my cursor 80 characters with a key binding?
From: |
Stawrul |
Subject: |
Re: How can I move my cursor 80 characters with a key binding? |
Date: |
Sun, 25 Dec 2005 23:26:37 +0100 |
>
> Does anyone know an easier way to cursor around a very long line?
I'm pretty frustrated with how I can't simply hit the up arrow and
move up to the previous line on the screen (which is actually part
of the same very long line), but it's an improvement over PICO which
always adds a carriage return at the edge of the screen. I use the
Terminal program in Mac OS X which doesn't seem to allow mouse
input.
>
You should try longlines-mode. In this mode returns inserted by the
user are "hard" returns. The returns inserted by the filling
functions, which prevent the lines from running off the screen, are
"soft" returns. Soft returns are automatically removed when the text
is saved to disk. You can navigate through single long line
displayed in several lines as through many short lines, by hitting
up/down arrow or C-p, C-n (like in PICO). To use this mode you need
longlines.el file. If you use EmacsFromCVS you already have it. In
other case you can download it from http://cvs.savannah.gnu.org/
viewcvs/emacs/emacs/lisp/longlines.el
Add something like this to your ~/.emacs:
(require 'longlines)
(global-set-key "\C-c\C-q" 'longlines-mode)
(global-set-key "\C-cq" 'refill-mode)
Then open a file and hit C-c C-q and C-c q to turn on both modes.
Hit M-q at a long line to break it with "soft" returns. You can
write a function to automatically break all lines (search at
emacswiki.org)
Stawrul