dsemy.com [Home] [Up]

Next: , Up: Customization


4.1 ID display

By default, the ID of each tracked window is displayed as a mode line lighter. This behavior is controlled by swsw-display-lighter.

Additionally, (custom) display functions could be added to swsw-mode-hook. These functions should enable ID display when swsw-mode is enabled, and disable ID display when swsw-mode is disabled. They can also make use of swsw-before-command-hook and swsw-after-command-hook (see See Window commands) to display IDs only during window selection. See the description and implementation of swsw-mode-line-display-function and swsw-mode-line-conditional-display-function below for more information.

It is also possible to use swsw-format-id directly in e.g. mode-line-format, although details vary depending on how and where you want the IDs to be displayed.

— User Option: swsw-display-lighter

Whether or not to show a mode line lighter. A non-nil value means show a mode line lighter. A value of nil means don't show a mode line lighter. By default, t is used.

— User Option: swsw-mode-hook

Hook run when enabling or disabling swsw-mode.

— User Option: swsw-id-format

Format string for the window ID. Used in the mode line lighter, and display functions may use this format string to display the ID, but they can also ignore it. The string should contain a single occurrence of %s, which will be replaced by the ID. By default, " <%s>" is used.

— Function: swsw-format-id window

Format an ID string (according to swsw-id-format) for WINDOW.

— Function: swsw-mode-line-display-function

Reference implementation of a “simple” display function, displaying window IDs at the beginning of the mode line. Display window IDs if swsw-mode is enabled, and disable displaying window IDs if swsw-mode is disabled. This display function respects swsw-id-format.

— Function: swsw-mode-line-conditional-display-function

Reference implementation of a conditional display function, displaying window IDs at the beginning of the mode line during window selection. Add a hook to swsw-before-command-hook which displays window IDs on the mode line and add a hook to swsw-after-command-hook which hides window IDs from the mode line if swsw-mode is enabled, and remove those hooks if swsw-mode is disabled. This display function respects swsw-id-format.