mikavilpas / evil-lispy

precision Lisp editing with Evil and Lispy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`i` behaves differently, when sexp is marked

abcdw opened this issue · comments

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".

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

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

(do|
  (something)
  (here))

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

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.

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

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?

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.