4 ms·
I find this part very compelling vi basic grammar is verb followed by object; it’s nice because it matches well with the order we use in English, "delete w
by galkk 3y ago
I find this part very compelling
vi basic grammar is verb followed by object; it’s nice because it matches well with the order we use in English, "delete word". On the other hand, it does not match well with the nature of what we express: There is only a handful of verbs in text editing (delete, yank, paste, insert… ), and they don’t compose, contrarily to objects which can be arbitrarily complex, and difficult to express. That means that errors are not handled well. If you express your object wrongly with a delete verb, the wrong text will get deleted, you will need to undo, and try again.
Kakoune’s grammar is object followed by verb, combined with instantaneous feedback, that means you always see the current object (In Kakoune we call that the selection) before you apply your change, which allows you to correct errors on the go.
Unfortunately, I'd rather see this as an alternative input mode in vim/vscode/nvim than separate editor, so I won't need to throw away all knowledge/plugins/dotfiles accumulated over time, than switching to completely new editor. Baggage is hard.
- ambicapter 3y agoI love the way he is basically modelling the way we interact with an editor as a grammar, or in mathematical terms. It's so interesting what kinds of designs you can come up with when you can successfully apply a different way of thinking about it.
- celeritascelery 3y agoHere is an interesting take on why the kakoune approach may not be an improvement over vim. Definitely well thought out. https://github.com/noctuid/dotfiles/blob/master/emacs/editing.org#why-not-kakoune https://github.com/noctuid/dotfiles/blob/master/emacs/editin...
- davidatbu 3y agoAs a heavy user of neovim who's been curious about the "noun-verb" approach to modal editing, this link was an excellent read!
- nequo 3y agoEmacs has Meow which implements model editing with the Kakoune grammar: https://github.com/meow-edit/meow https://github.com/meow-edit/meow
- 3oH2y869 3y ago+1 for Meow. Vim doesn't make sense to me, but Meow does.
- cwp 3y agoI dig this too. It's what I loved about Quicksilver - it had simple grammar that went direct object, verb, (optionally) indirect object. That tied nicely into the plugin system, which gave it tremendous flexibility. Successors like Alfred, Google Bar and Raycast are trying to recreate the unix command line and it doesn't work nearly as well.
- jacknews 3y agoYou can get this to some extent with visual mode in (neo)vi(m).
- galkk 3y agoThe point is not the immediate visual feedback, but change "direction". Delete 3 words is dw3 vs 3Wd. To some extent this is similar to common SQL criticism of order of SELECT x FROM y, where some people say that FROM y SELECT y would be more clear.
- jacknews 3y agoctrl-v 3w d shift-v 3j y v ib c etc
- cerved 3y agodon't you mean d3w?
- galkk 3y agoYou're right, typo :(
- jodrellblank 3y agoPeople say this about data.method() vs function(data) and about PowerShell using Verb-Noun when they want Noun-Verb. It's pretty clearly either a personal preference, or a thing where different contexts read better one way or the other. Why can't we make things which work either way?
- lenkite 3y agoAfter having tried both, I prefer verb-object for editing operations any day. Especially since its more natural to add a number for repeating. And its excellent for macros.
- srijan4 3y agoThe first part of this https://karthinks.com/software/fifteen-ways-to-use-embark/ https://karthinks.com/software/fifteen-ways-to-use-embark/ also talks about how inverting action and object can be useful, and how Emacs's embark package makes it possible to even go back and forth between object and action as needed.
- lumb63 3y agoThere are a lot of operations in vim that I don’t need or want to see the selection. Sometimes it would be useful, and if I think so, I use visual mode instead.