Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/misohena/phscroll

Enable partial horizontal scroll in Emacs
https://github.com/misohena/phscroll

emacs emacs-lisp org-mode

Last synced: about 2 months ago
JSON representation

Enable partial horizontal scroll in Emacs

Awesome Lists containing this project

README

        

#+TITLE: Partial Horizontal Scroll in Emacs

* About

This elisp enables horizontal scrolling in specified parts of buffer even in line-wrapping mode (truncate-lines is nil).

[[file:./phscroll-screenshot.gif]]

* Usage

1. Load phscroll.el (require 'phscroll)
2. Select a region you want to horizontal scroll
3. M-x phscroll-region

Other commands:

- M-x phscroll-delete-all : Delete all scrolling area in the current buffer
- M-x phscroll-delete-at : Delete a scrolling area at point
- M-x phscroll-update-at : Update (redraw) a scrolling area at point

The following keys are available in scrolling area:

- C-x < (M-x phscroll-scroll-left)
- C-x > (M-x phscroll-scroll-right)
- C-l (M-x phscroll-recenter-top-bottom)
- C-S-l (M-x phscroll-recenter-left-right)

* In org-mode

The following elisp enables horizontal scrolling in table parts of org-mode documents. By setting org-startup-truncated to nil, other parts will be displayed in wrapping.

#+begin_src emacs-lisp
(setq org-startup-truncated nil)
(with-eval-after-load "org"
(require 'org-phscroll))
#+end_src

Tips:
- To turn off the effect of phscroll, use M-x org-phscroll-mode.
- To scroll the current position of the screen to the left edge, press C-S-l twice.

* Known Issues

- Incorrect display when viewing the same area from multiple windows with different widths
- Incorrect display when used with various text properties and overlays.
- Performance degradation

phscroll forcibly realizes partial horizontal scrolling, which is not possible originally. It's interesting that it's still somewhat usable, but ideally Emacs should have a text property that controls line wrapping.