Navigating In View Mode

Emacs view mode is one of things that might seem superfluous at first glance. After all, you can always just visit a file and use the normal navigation commands to view the file. But there’s a lot to be said for a read-only file viewer—think less, more, or other pager utilities—that let’s you page through the file without worrying about accidentally introducing a change.

The normal view mode protocol is to use Space and Delete to scroll forward and backward like Ctrl+v and Meta+v do. It’s a nice and convenient way of viewing a file that you don’t want to edit.

Charles Choi agrees with all that but wants a richer protocol. For instance, if he’s in an Org file, he’d like the movement to be forward and backward to the next heading. Once you make that leap, you realize that other file types could also benefit from specialized navigation commands. He has a post that explores the idea of file type naviation in view mode.

He presents some code to do this for several file types and it would be no problem to add other file types as well. Even if you don’t know Elisp, it would be easy to follow the cases he presents to add your own.

View mode is an underused feature of Emacs and Choi’s enhancements make it even better. Take a look at his post and see if you don’t agree.

This entry was posted in General and tagged . Bookmark the permalink.