You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The :mapcommand takes a "mode" argument that restricts the availability of the mapping. As well as the obvious modes (insert, normal) and some UI-based modes (prompt, menu, user) there's specific modes for the various normal-mode commands that are prefixes: goto, view, and object. A user can add a mapping (with a docstring) to those modes, and the mapping will show up alongside the built-in/official mappings, so plugins can extend Kakoune in a way that feels completely normal and familiar.
However, there's one normal-mode prefix that does not accept custom mappings: the "combine selections" menu that appears after you press <a-z> or <a-Z>.
The specific list of changes requested by this issue are:
the :map command should accept a new "mode" ("combine_selections"? "combsel"?) that represents the "combine selections" menu
mappings in the "combine_selections" mode should have access to the %val{count} and %val{register} expansions (like mappings in "object" do)
mappings will probably need an additional %val{combine_direction} expansion to distinguish between <a-z> (from register) and <a-Z> (to register)
Usecase
People coming to Kakoune for the first time frequently expect the "combine selections" menu to do mathematical-style set operations (union, intersection, left-subtraction, right-subtraction) on the set of selected characters:
However, the existing items in the combine selections menu don't work like that. There's good reasons why they don't work like that, but experimenting with different kinds of selection operations is difficult because they must be implemented in C++.
If custom mappings could be added to the "combine selections" menu, people could implement different selection operations themselves. If any of those experiments turned out to be particularly useful, they could be ported to C++ later.
The text was updated successfully, but these errors were encountered:
Feature
The
:map
command takes a "mode" argument that restricts the availability of the mapping. As well as the obvious modes (insert, normal) and some UI-based modes (prompt, menu, user) there's specific modes for the various normal-mode commands that are prefixes: goto, view, and object. A user can add a mapping (with a docstring) to those modes, and the mapping will show up alongside the built-in/official mappings, so plugins can extend Kakoune in a way that feels completely normal and familiar.However, there's one normal-mode prefix that does not accept custom mappings: the "combine selections" menu that appears after you press
<a-z>
or<a-Z>
.The specific list of changes requested by this issue are:
:map
command should accept a new "mode" ("combine_selections"? "combsel"?) that represents the "combine selections" menu%val{count}
and%val{register}
expansions (like mappings in "object" do)%val{combine_direction}
expansion to distinguish between<a-z>
(from register) and<a-Z>
(to register)Usecase
People coming to Kakoune for the first time frequently expect the "combine selections" menu to do mathematical-style set operations (union, intersection, left-subtraction, right-subtraction) on the set of selected characters:
However, the existing items in the combine selections menu don't work like that. There's good reasons why they don't work like that, but experimenting with different kinds of selection operations is difficult because they must be implemented in C++.
If custom mappings could be added to the "combine selections" menu, people could implement different selection operations themselves. If any of those experiments turned out to be particularly useful, they could be ported to C++ later.
The text was updated successfully, but these errors were encountered: