qmk/modules/getreuer/select_word
2025-03-18 22:27:19 +01:00
..
introspection.h import https://github.com/getreuer/qmk-modules.git 2025-03-18 22:27:19 +01:00
qmk_module.json import https://github.com/getreuer/qmk-modules.git 2025-03-18 22:27:19 +01:00
README.md import https://github.com/getreuer/qmk-modules.git 2025-03-18 22:27:19 +01:00
select_word.c import https://github.com/getreuer/qmk-modules.git 2025-03-18 22:27:19 +01:00
select_word.h import https://github.com/getreuer/qmk-modules.git 2025-03-18 22:27:19 +01:00

Select Word

Modulegetreuer/select_word
Version2025-03-07
MaintainerPascal Getreuer (@getreuer)
LicenseApache 2.0
Documentation https://getreuer.info/posts/keyboards/select-word

This is a community module adaptation of Select Word for selecting words and lines, assuming conventional text editing hotkeys.

Use

Add the following to your keymap.json:

{
    "modules": ["getreuer/select_word"]
}

Then use one or more of the following keycodes in your layout:

Keycode Short alias Description
SELECT_WORD SELWORD Forward word selection. Or with Shift, line selection.
SELECT_WORD_BACK SELWBAK Backward word selection.
SELECT_WORD_LINE SELLINE Line selection.

Press SELWORD to select the current word. Press it again to extend the selection to the following word. The effect is similar to word selection (W) in the Kakoune editor. Or for line selection, press SELWORD with shift to select the current line, and press it again to extend the selection to the following line.

Mac hotkeys

Different hotkeys are needed to perform word and line selection on Mac OS. There are several ways that Select Word can be configured to send the appropriate hotkeys:

  • To hardcode to Mac hotkeys, define in your config.h file:

    #define SELECT_WORD_OS_MAC
    
  • If OS Detection is enabled, Select Word uses it determine which kind of hotkeys to send.

  • For direct control, define in config.h:

    #define SELECT_WORD_OS_DYNAMIC
    

    Then in keymap.c, define the callback select_word_host_is_mac(). Return true for Mac hotkeys, false for Windows/Linux.

See the Select Word documentation for further configuration options and details.