Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I fix the cursor to the middle of the screen in Emacs, so that the page moves, not the cursor?

I'd like to fix the cursor to the centre line of the screen, so that when I press Ctrl-N or Ctrl-P, the page itself moves up or down, and the cursor stays still.

Has anyone got any tips on how to achieve this?

Thanks

Ed

like image 339
Singletoned Avatar asked May 21 '09 11:05

Singletoned


3 Answers

Try centered-cursor mode:

http://www.emacswiki.org/emacs/centered-cursor-mode.el

If you're using MELPA, it's available by M-x package-install RET centered-cursor-mode.

like image 190
scottfrazer Avatar answered Oct 17 '22 04:10

scottfrazer


M-x scroll-lock-mode, which could be used to put the Scroll Lock key to good use too:

(global-set-key (kbd "<Scroll_Lock>") 'scroll-lock-mode)
like image 10
Laurynas Biveinis Avatar answered Oct 17 '22 05:10

Laurynas Biveinis


The EmacsWiki page on SmoothScrolling presents some possible solutions.

like image 4
bendin Avatar answered Oct 17 '22 05:10

bendin