Hacker News new | past | comments | ask | show | jobs | submit login
Emacs: C-l and C-L: Do you know the difference?
1 point by distcs on Jan 9, 2023 | hide | past | favorite
C-l (Ctrl+l) scrolls the window so that the line the cursor is on is centered at the middle of the window. On the second invocation of C-l it puts the current line at the top. On the third invocation of C-l it puts the current line at the bottom.

Documentation:

  C-l runs the command recenter-top-bottom (found in global-map), which
  is an interactive compiled Lisp function in ‘window.el’.

  It is bound to C-l.

  (recenter-top-bottom &optional ARG)

  Scroll the window so that current line is in the middle of the window.
  Successive invocations scroll the window in a cyclical order to put
  the current line at certain places within the window, as determined by
  ‘recenter-positions’.  By default, the second invocation puts the
  current line at the top-most window line, the third invocation puts it
  on the bottom-most window line, and then the order is reused in a
  cyclical manner.

  With numeric prefix ARG, move current line ARG lines below the window top.
  With plain C-u, move current line to window center.
C-L does exactly the same. Emacs translates C-L to C-l and the same behavior is seen.



Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: