martanne / vis

A vi-like editor based on Plan 9's structural regular expressions
Other
4.2k stars 258 forks source link

Use object-verb order like Kakoune, in other words reverse order #1014

Closed GReagle closed 1 year ago

GReagle commented 2 years ago

I really like Kakoune's idea of puting the object first and it being automatically highlighted, then typing in the action command like 'd' for delete. Much more interactive and clear. Would you consider this change for vis? This is the way that x already works so it would be more consistent too.

from https://github.com/mawww/kakoune/wiki/Migrating-from-Vim delete a word: vim: dw kak: wd

mcepl commented 2 years ago

https://github.com/martanne/vis/wiki/Differences-from-Kakoune

I think the author is fully aware of differences and he doesn’t seem to be interested in change.

erf commented 2 years ago

You could perhaps make your own kak keybindings in the config.h or using the Lua API.

GReagle commented 2 years ago

You could perhaps make your own kak keybindings in the config.h or using the Lua API.

I assume that changing the verb-object order is not possible just by changing keybindings. However, that does give me the idea of making the change into a new mode.

deepcube commented 2 years ago

On Sat Jun 18, 2022 at 7:14 AM MDT, GReagle wrote:

I really like Kakoune's idea of puting the object first and it being automatically highlighted, then typing in the action command like 'd' for delete. Much more interactive and clear.

Not exactly the same, but if you hit v first to enter visual mode then all your motions will add to the selection. In vi if you wanted to delete 3 words you'd have to know that before starting and either d3w or 3dw. In Kakoune (as I understand it) you can interactively select so if you didn't know how many words to delete you could wWWd, with wWW highlighting those 3 words. In vis you can get a very similar behavior with vwwwd. It's not exactly the same but it does open the door to the interactive editing style you're talking about.

GReagle commented 2 years ago

Very useful deepcube, thank you! Perhaps close the issue.