noctuid / lispyville

lispy + evil = lispyville

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stupid question(s)

sondr3 opened this issue · comments

Hey, so I'm just starting to get into some Lisp and Scheme programming (going through The Little Schemer) and finally wanted to try out Lispy (and Lispyville). However since I haven't really seriously programmed in either I have some questions about them.

First off, I use Evil and was wondering how it works with Insert. I haven't used Paredit so I'm not sure how it would work with it, but when you press i into insert mode, it goes into Lispy-mode whenever I'm over a ( and so on, and regular insert mode whenever I'm not. However, I'm curious as to what power users would use when they are in either mode to jump to its other insert mode.

So say I've been writing some code normally but want to change it with Lispy, is there a way to directly jump from insert mode in Evil to Lispy-mode, or do I exit to normal mode, find a paranthesis and then go into Lispy-mode? And for the other way, when I'm done manipulating things with Lispy, is there a way to jump directly into regular insert mode?

Sorry if I'm asking in the wrong place, but since this package caters directly to people who use Evil and Lispy I figured I'd ask here.

If you are using the default lispy bindings, you can use [ and ] in insert state to get into special (jump to a paren). I'd recommend using the same key or a similar key in both insert and normal states to get to special.

is there a way to jump directly into regular insert mode?

Just move away from the paren. Depending on where you want to start inputting new text, lispy may have a more efficient way to jump there immediately (e.g. lispy-ace-char). Did you have a specific example in mind?

When I press either [ or ] when I'm in Evil insert mode it just inserts [] as I would expect, it doesn't throw me into lispy-mode. I could probably just create a keybind with General.el for it. And I'm a bit of a dummy, how do you move away from it once you're in lispy-mode, I just keep moving around my lisp code instead 😄

[ and ] are bound by default by lispy; are you unbinding them?

Lispy calls these locations (e.g. before an opening delimiter or after a closing delimiter) special (lispy-mode is enabled regardless). You can move away by pressing any movement key bound in insert mode that isn't bound for special (e.g. left, right). Certain lispy actions will also exit special (like lispy-ace-char, bound to Q by default).

commented

@noctuid Hope you don't mind me hijacking this thread with a similar (but maybe different) question.

Trying out Lispy now, I was wondering what you'd recommend to have insert-state bindings stay untouched by lispy but emacs-state bindings can be modified.

I find it a little awkward (at least mentally) insert-state can be configured in such a way where pressing keys don't insert the actual letters on screen. I've been toying with making lispyville motions go to emacs state instead of insert state.

I'm assuming there's an easy way to do this but I haven't tried too hard to look into it.

Do you recommend doing ^ or sticking with the lispy bindings in insert state anyways?

Sure, you could do something like bind the keys to self-insert-command in insert state for lispy-mode-map. That said, lispy isn't modal in the same way vim is. The point of lispy is to use these locations for commands because letters never need to be inserted at them. Making this change seems unnecessarily complicated to me.

I'm going to go ahead and close this issue. Feel free to ask more questions here though or open a new issue if you have any other specific questions.