views:

40

answers:

1

Hi,

I'm editing a file with very long lines in Emacs. I've turned on line truncating, and I want to quickly see the last words in each line quickly.

So I move to the end of the first line, then when I press C-n it takes me to the next line and the horizontal position is not lost. But when I do C-v, it takes me to the beginning of first line in the next page i.e., the horizontal position is getting lost.

Is there a workaround for this?

Thanks for any help.

+1  A: 

You could implement C-v in terms of C-n, something like this:

(defun scroll-up-keep-position ()
  (interactive)
  (next-line (window-height)))
(global-set-key [(control v)] 'scroll-up-keep-position)
Nicholas Riley
Great, Thanks! <filler for 15 chr limit>
Sahasranaman MS