I开发者_如何学编程 am looking for a functionality similar to Ctrl-l in Emacs. What it does is, for example, if you are editing the second-last line in the visible editor window and you hit Ctrl-L
, the current line will move to the center of the editor screen.
This works regardless of the file end. Most of the time, if one is creating a new file, they would be at the last line, adding more content to the file. Continually staring at the bottom of the screen is hurting my neck.
- Go to Window > Preferences > General > Keys
- Filter the commands to find 'Recenter'
- Add preferred binding (I have Ctrl+Shift+B)
- Select 'Editing Text' in the When dropdown.
Edit: unfortunately, if the cursor is at the end of the file, and you try to "recenter", it won't work because there is nothing left to show below the cursor.
精彩评论