meow icon indicating copy to clipboard operation
meow copied to clipboard

Repeat meow-beginning/end-of-thing

Open velppa opened this issue 3 years ago • 6 comments

Using meow-beginning/end-of-thing and then repeat opens a dialog again, but my expectation was that it would repeat without confirmation. The use-case is to "move up by paragraphs", by [p''''''. How to approach this, I guess either via using BEACON mode or exposing meow-beginning/end-of-thing as keymaps and then bind functions to they keys here?

velppa avatar Dec 13 '21 18:12 velppa

What you pointed out is a problem in Meow. Also discussed here.

Adding repeat support for thing commands doesn't make sense. since most of them are not expandable. In the previous dicussion, I mentioned a few ideas. Currently, my idea for this purpose is:

(meow-normal-define-key
 '("{" . backward-paragraph)
 '("}" . forward-paragraph)
 '("]" . meow-end-of-thing)
 '("[" . meow-beginning-of-thing))

(add-to-list 'meow-char-thing-table (cons ?{ 'paragraph))
(add-to-list 'meow-char-thing-table (cons ?} 'paragraph))

To backward select paragraph, use [ { { { {. To forward select paragraph, use ] } } } }. To backward (and include current paragraph) use . { { { { To forward (and include current paragraph) use , } } } }

How about this? I'm still considering, and I won't make this a default.

DogLooksGood avatar Dec 13 '21 19:12 DogLooksGood

I also think it would be great if there was quick way to extend paragraph selection.

What I use right now is:

  1. . p
  2. ; (optional, if I want to reverse cursor)
  3. M-{ or M-} (emacs' native move paragraph keybind)

But pressing all this can be a bit much.

skmd0 avatar Dec 16 '21 23:12 skmd0

@skmd0 What about my suggestion above? It's available at the moment.

  1. You don't have to reverse, the direction of meow-inner-of-thing, meow-bounds-of-thing are different. , p will go forward and . p will go backward. Behaviors controlled by variable meow-thing-selection-directions.
  2. You can have multiple keys mapping to the same thing.

DogLooksGood avatar Dec 17 '21 05:12 DogLooksGood

I am just describing how I am personally selecting multiple paragraphs. It was not direct reply to your suggestion. I posted it just in case it maybe helps someone.

Sometimes I press , when I wanted ., in that case I reverse the cursor with ;. That's why I added optional.

Edit: @DogLooksGood oh sorry, you meant what I think of your suggestion. Yeah I think it's pretty good! I will add it to my personal config and try it out.

skmd0 avatar Dec 17 '21 06:12 skmd0

(meow-normal-define-key
 '("{" . backward-paragraph)
 '("}" . forward-paragraph)
 '("]" . meow-end-of-thing)
 '("[" . meow-beginning-of-thing))

I tested this and I think it feels good to use!


(add-to-list 'meow-char-thing-table (cons ?{ 'paragraph))
(add-to-list 'meow-char-thing-table (cons ?} 'paragraph))

But I think this is kind of pointless. For example line in thing selection is l while in normal mode selection is x. Probably no need to have 3 different characters for specifing paragraph.

How about this? I'm still considering, and I won't make this a default.

Why not add it to pre-defined layouts? Waiting for more feedback?

skmd0 avatar Dec 17 '21 07:12 skmd0

In different keyboard layouts, keys for line are different. In case for the differences, char <-> thing is mapped by thing name. I have no idea what is the best, because it depends on how users set their keybindings.


image

I have three keys for line, my beginning/end is < and >. So I can << or >>.

DogLooksGood avatar Dec 17 '21 07:12 DogLooksGood