mikavilpas / evil-lispy

precision Lisp editing with Evil and Lispy
79 stars 5 forks source link

`i` behaves differently, when sexp is marked #18

Open abcdw opened 7 years ago

abcdw commented 7 years ago

i have different meaning, when I mark something( and I have to use f. It seems inconsistent. Probably it's necessary to remap i to lispy-flow in "mark-mode".

mikavilpas commented 7 years ago

Yep, I agree. It's pretty confusing. I'll see what I can do about it. Thanks for reporting!

mikavilpas commented 7 years ago

Hmm actually I don't kind of understand any longer. Could you describe your issue with some example?

abcdw commented 7 years ago
(do|
  (something)
  (here))

try to do following: ) i m l i and ) i m l f

mikavilpas commented 7 years ago

Hmm.. Here's what happens for me in the first case:

(do|
  (something)
  (here))

;; ) i m l i

(do
  (something)
  (here)|)
;; the (do) form is selected until |, leaving the final ")" unselected

For the second case,

(do|
  (something)
  (here))

;; ) i m l f

(do|
  (something)
  (here))
;; the "do" symbol is selected

The first case works as I expect it to, although I don't think it's correct to leave the final ) out of the selection.

As for the second case, it's a bit surprising I agree. I looked it up, and it seems this is actually a feature of lispy: http://oremacs.com/lispy/#lispy-tab . So if the region is active, it is actually supposed to jump and select the car of the form.

mikavilpas commented 7 years ago

In my use case I rarely use f to fix indentation. What I use instead is https://github.com/Malabarba/aggressive-indent-mode

It corrects the indentation as I type, so I don't have to think about it. Do you think it could work for you as well?

Here's my config for using it: https://github.com/sp3ctum/spacemacs/blob/mika/.spacemacs#L420

abcdw commented 7 years ago

In my opinion first case should work like second case, because current behavior is useless, at least for me.

On Sat, Mar 4, 2017, 11:29 AM Mika Vilpas notifications@github.com wrote:

In my use case I rarely use f to fix indentation. What I use instead is https://github.com/Malabarba/aggressive-indent-mode

It corrects the indentation as I type, so I don't have to think about it. Do you think it could work for you as well?

Here's my config for using it: https://github.com/sp3ctum/spacemacs/blob/mika/.spacemacs#L420

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sp3ctum/evil-lispy/issues/18#issuecomment-284137001, or mute the thread https://github.com/notifications/unsubscribe-auth/ABKYNxN85jJzcxyMSTSWSccY-LO-WwSgks5riSDYgaJpZM4MJuKs .

--

Best regards, Andrew Tropin

mikavilpas commented 7 years ago

It seems to me this is an issue with lispy itself.

It could be rebound to another key, but it would require extra complexity.. it seems to me like lispy doesn't actually use a different keymap when the region is active. Instead each command handles the case individually and I don't see a good way to customize this.

If you'd like to continue the discussion, can you clarify what it is that you're actually trying to accomplish?

abcdw commented 7 years ago

Ok. lispy seems to have a little bit strange behavior, when mark is activated. For me, when sexp is marked it will be nice to mark inner sexp with lispy-flow. I thought that lispy-flow does that job and you just forgot to remap i to lispy-flow in "marking mod", but I was wrong. lispy-flow doesn't care about proper marking of sexp.

It strange, but lispy-special-tab does what I expect from lispy-flow, except one small thing: it always mark first sexp. ((first| sexp) (second sexp))

) m l f and ) m h f do the same thing.

Probably it more intuitive behavior and in "marking mode" lispy-flow should do what lispy-special-tab does(maybe with improves of case above).

Sorry for confusing.