Recenter lines in source file

I found this question from some time ago by searching if RStudio IDE has this functionality.
I am looking for ways to have Cmd + L recenter the source file so that the current line is in the middle - is this possible somehow either via keyboard shortcut or via some snippet magic ?
Thank you in advance for any help or comments.

Ok i think i figured this out :slight_smile: Rstudio IDE offers to switch the keybindings to Emacs ones. I did this and looked through the modify keybindings map and found Center selection bound to Ctrl + L.

:exclamation: In the RStudio IDE default keybindings map this shortkey is available but clashes with the default for Clear console. My solution was to bind:

  • clear selection to Cmd + L
  • recenter screen (center selection) to Ctrl + L

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.