Skip to content

Use () around <Plug> mappings#179

Open
djpohly wants to merge 1 commit into
tpope:masterfrom
djpohly:plug-mappings
Open

Use () around <Plug> mappings#179
djpohly wants to merge 1 commit into
tpope:masterfrom
djpohly:plug-mappings

Conversation

@djpohly
Copy link
Copy Markdown

@djpohly djpohly commented May 30, 2026

<Plug> is merely a special keycode, so <Plug>Commentary is a prefix of e.g. <Plug>CommentaryLine, which means you have to wait for 'timeoutlen' before the former mapping takes place to make sure you're not actually going to enter the latter. (Type "gcLine" from Normal mode, watch the 'showcmd' output and see what gets called!)

It's common practice to use parentheses to prevent one mapping from prefixing another, so that's the fix suggested here. (Another option would be a terminator, as suggested in :help using-<Plug>.)

May be related to the issue seen in #105, given that it was affected by changes to 'timeoutlen'.

(Upgrade notes: users will need to make a small update to their configuration if they have anything mapped to <Plug> sequences. Alternatively, the old mappings could be left in place alongside the new ones, with the note that this issue will remain until you update.)

<Plug> is merely a special keycode, so "<Plug>Commentary" is a prefix of
e.g. "<Plug>CommentaryLine", which means you have to wait for
'timeoutlen' before the former mapping takes place to make sure you're
not actually going to enter the latter.  (Type "gcLine" from Normal
mode, watch the 'showcmd' output and see what gets called!)

It's common practice to use parentheses to prevent one mapping from
prefixing another, so that's the fix suggested here.  (Another option
would be a terminator, as suggested in ":help using-<Plug>".)

May be related to the issue seen in tpope#105, given that it was affected by
changes to 'timeoutlen'.
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