meow-edit / meow

Yet another modal editing on Emacs / 猫态编辑
GNU General Public License v3.0
1.07k stars 128 forks source link

General improvements #224

Closed MagicRB closed 1 year ago

MagicRB commented 2 years ago

I've a few ideas, on how to make meow better. I'm a former Evil user, so it may just be evil-isms, but I think they'd improve meow nonetheless.

DogLooksGood commented 2 years ago

Hi, thanks for your suggestions. I have some explanation here:

meow-yank and friends, could, when something is selected, replace selection. For this one, we have meow-replace. Since in meow it's very common to have a selection, so modification commands will have consist behavior no matter there's a selection or not.

meow-append should imo open insert one char to the right, like in evil meow-append will switch to insert at the end of selection. Since when you don't have a selection, that is zero-width. So the beginning and the end are the same place.

Could you elaborate more about your first suggestion?

eshrh commented 2 years ago

the more i think about it, the more i also feel like some kind of surround-manipulation would be good.

  1. Define some alist of pairs.
  2. Given a selection, 3 commands that a. Remove the first and last char (this is actually a little annoying right now) b. Add a char around the selection, being smart about pairs (made a bit better by paredit/smartparens) c. do a then c.

I say these three should be put behind a single hydra-like interface similar to bounds and inner. I don't see how surround functionality can be added using the thing abstraction, maybe I'm missing some idea though.

mclearc commented 2 years ago

the more i think about it, the more i also feel like some kind of surround-manipulation would be good.

I'm not sure whether you know of this package but https://github.com/cute-jumper/embrace.el does all of this and works very well with meow. If you end up not implementing this in meow itself it might be worth putting a link in the readme so people who want that functionality can easily add it.

eshrh commented 2 years ago

Wow, that's a really great package! just installed it and this is exactly the functionality I was looking for, thanks!

Personally, I think some variation of the embrace idea should be implemented in meow, but now I don't really have any urgency because this does everything i need :)

MagicRB commented 2 years ago

Sorry for not getting back, I'm in the middle of my finals (starting to sound like an excuse lol) anyway. Yeah embrace.el looks really good! I'll try it out too. BTW great package!

trev-dev commented 1 year ago

I like Embrace, but it does require expand-region to work. Using some principles form Embrace I've started writing my own "surround" adaptation in an effort to keep things light and simple.

If it's of any interest to people here, let me know.

eshrh commented 1 year ago

@trev-dev definitely post it! Sounds neat: #273

  1. There has been plenty of discussion on this, still under debate it seems

2 exists, and 3 has also been discussed elsewhere