Skip to content

feat: add app-specific line break handling for o and +o in insert mode - #130

Merged
rcmdnk merged 1 commit into
masterfrom
shift_enter
Aug 2, 2026
Merged

feat: add app-specific line break handling for o and +o in insert mode#130
rcmdnk merged 1 commit into
masterfrom
shift_enter

Conversation

@rcmdnk

@rcmdnk rcmdnk commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Some applications, such as ChatGPT, use Enter to send a message and require Shift+Enter or Ctrl+Enter to insert a line break.

In Normal mode, vim_ahk currently sends Enter when executing o or O. In these applications, this may send the current message instead of opening a new line.

This PR adds the VimShiftEnter and VimCtrlEnter application groups and uses the appropriate key combination when handling o and O.

For now, these groups are hard-coded, so users need to edit the vim_ahk script directly to add or change applications.

Current list:

    ; Shift-Enter to insert line break in these applications
    GroupAdd("VimShiftEnter", "ahk_exe ChatGPT.exe") ;
    GroupAdd("VimShiftEnter", "ahk_exe Claude.exe") ;
    GroupAdd("VimShiftEnter", "ahk_exe Cursor.exe") ;
    GroupAdd("VimShiftEnter", "ahk_exe slack.exe") ;
    GroupAdd("VimShiftEnter", "ahk_exe ms-teams.exe") ;
    GroupAdd("VimShiftEnter", "ahk_exe Teams.exe") ; Old version
    GroupAdd("VimShiftEnter", "ahk_exe Discord.exe") ;
    GroupAdd("VimShiftEnter", "ahk_exe WhatsApp.exe") ;
    GroupAdd("VimShiftEnter", "ahk_exe Zoom.exe") ;
    GroupAdd("VimShiftEnter", "ahk_exe PhoneExperienceHost.exe") ;
    GroupAdd("VimShiftEnter", "ahk_exe LINE.exe") ;

    ; Control-Enter to insert line break in these applications
    ; No corresponding applications

Making these groups configurable from the settings window would be useful. However, adding more application-specific options there would make the window increasingly complex, while several other settings also remain hard-coded. A separate configuration mechanism may eventually be needed to manage these settings (#129).

Partially addresses #128.

@rcmdnk
rcmdnk merged commit ab1f857 into master Aug 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant