Giter Site home page Giter Site logo

Comments (6)

noctuid avatar noctuid commented on July 28, 2024

lispy-pair is not aware of evil at all, but I don't think that should be a problem. I normally only use it in insert state, but it works for me in normal state as well. Make sure that you are binding lispy-parens and not lispy-pair directly:

(evil-define-key 'normal lispyville-mode-map
  "(" #'lispy-parens)

If that's not the problem, let me know what happens when you try this.

If you want this specifically for wrapping, I could maybe provide a command that wraps one sexp by default (or acts like lispy-parens-auto-wrap) and doesn't insert the space before the opening delimiter.

from lispyville.

bpstahlman avatar bpstahlman commented on July 28, 2024
(evil-define-key 'normal lispyville-mode-map
  "(" #'lispy-parens)

That works, but if evil's evil-move-cursor-back option is at its default value of t, it isn't possible to jump past a parenthesized sexp at the end of a line (since the "move back" effectively puts point inside the sexp moved past), and this can result in a premature end to the traversal. Now that I know about evil-move-cursor-back, I'm considering setting it to nil, as I suspect the non-default setting would be less likely to cause breaking interactions with non-evil packages.

I haven't used Lispy/Lispyville long enough to have solidified my usage patterns yet, but I suspect that wrapping a non-parenthesized sexp is something I might want to do in normal mode. Of course, it's not hard to enter insert mode or mark the sexp, so it's just a nice-to-have...

Thanks for all your help. I'm sure I'll have more questions as I continue to use Lispy and Lispyville.

from lispyville.

noctuid avatar noctuid commented on July 28, 2024

I'm not sure I understand what you mean. The point is only moved back when exiting insert state, so it shouldn't affect any of the provided commands. If you jump to a closing paren at the end of then line, and then exit insert state, you'll still be on the paren. Personally I see this behavior as a non-intuitive workaround for a vim limitation and set evil-move-cursor-back to nil.

Adding wrap commands was planned from the start. It's probably one of the more useful additions, so I'll work on it next when I have the time.

On a side note, you mentioned that you like lispy-backbut wished C-i behavior was also present. I could add an option to have all the points lispy saves added to the evil jump list as well. Would you find that useful? Of course, the jump list doesn't store regions/selections, but I could potentially add that functionality as another option.

from lispyville.

bpstahlman avatar bpstahlman commented on July 28, 2024

I'm not sure I understand what you mean. The point is only moved back when exiting insert state, so it shouldn't affect any of the provided commands. If you jump to a closing paren at the end of then line, and then exit insert state, you'll still be on the paren.

Odd. I was commenting on a problem with C-M-f and Lispyville's L and H commands in normal state: specifically, they don't work as expected when evil-move-cursor-back is at its default value of t, since it's impossible for point to move past a closing paren at the end of the line in evil-normal-state. Not sure why I added it to that comment. I'd been talking about C-M-f on another issue, and perhaps I noticed it while looking into the wrap stuff. Sorry for the confusion...

The C-i behavior would definitely be nice to have (especially if it remembered the regions). Personally, I'm more likely to use a back button with reckless abandon if I know I have a forward button too... ;-) More wrapping functionality would be nice as well, though the current state of affairs isn't too bad, now that I know I can mark with v or V, then hit (. Were you thinking of adding the ability to wrap the current sexp (or multiple sexp's with a count) without marking first? I just noticed that v and V don't accept counts. That actually could be a useful feature: i.e., if I wanted to mark 3 sexps after point, I can always use Lispy's mark to mark the first one in the range, then slurp in the rest, but that's a fair number of keystrokes. Lispyville's v and V are so handy in evil-normal-state, it would be nice to be able simply to do (e.g.) 3 v. I notice lispy's M-m doesn't appear to support a count either. Ah well. Just thinking out loud...

from lispyville.

noctuid avatar noctuid commented on July 28, 2024

Ah yes, I thought myabe there was some problem with the wrapping. I think that should only be an issue for forward-sexp. I can mention it in the readme.

Were you thinking of adding the ability to wrap the current sexp (or multiple sexp's with a count) without marking first?

Yes, the wrap commands will wrap the current sexp by default.

For lispy-mark-symbol/M-m it could make sense to support a count that would slurp count -1 times. It would make the most sense to add this functionality directly to lispy. Maybe make an issue suggesting it there.

from lispyville.

bpstahlman avatar bpstahlman commented on July 28, 2024

Sounds good. Would be nice if the wrap commands supported a count as well, just like the existing lispy wrap commands.

And yes, I agree that lispy-mark-symbol is the most natural place for the mark count to be implemented.

from lispyville.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.