doomemacs/modules/editor/rotate-text
2021-10-18 01:43:37 +02:00
..
autoload.el feat(rotate-text): add enable & disable 2021-10-05 02:29:59 +02:00
packages.el Minor refactoring across the board 2021-05-23 22:09:07 -04:00
README.org docs(rotate-text): add README (#5654) 2021-10-18 01:43:37 +02:00

editor/rotate-text

Description

Provides a convenient way to rotate trough a set of related entities using a single key binding. There are both globally available sets as well as mode local once. For example the sequence enable and disable is globally available whereas the sequence public, protected and private is only available in c++ mode.

Maintainers

This module has no dedicated maintainers.

Module Flags

This module provides no flags.

Plugins

Prerequisites

This module has no prerequisites.

Features

With point on a word or symbol that is part of a sequence you can call rotate-text or rotate-text-backward to rotate to the next or previous item in the sequence. The list of items will wrap around as you cycle through them.

Configuration

To enable a set of items to cycle through globally, add the following to your configuration

;; in ~/.doom.d/config.el
(after! rotate-text
  (pushnew! rotate-text-words '("small" "medium" "large")))

To add a sequence to a specific mode, you can add something like the following to your configuration

;; in ~/.doom.d/config.el
(set-rotate-patterns! 'c++-mode
    :words '(("float" "double")))

When configuring a sequence of words or symbols that should be rotated through, it is important that all items are all lower case. The casing will be determined by the item that initiated the rotation. For example, Small will be replaced with Medium and SMALL will be replaced with MEDIUM using the example described above.