noctuid / lispyville

lispy + evil = lispyville

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using lispyville operators as drop-in replacements

yyadavalli opened this issue · comments

Hi,

Can the lispyville operators be used as drop-in replacements for evil operators using defalias like

(defalias 'evil-delete 'lispyville-delete)

Do you foresee any issues with doing that?

Thanks for the wonderful package.

PS: I'm trying to use lispyville in non-lispy modes same as #54

There is the formatting issue mentioned in that issue currently (e.g. delete does prettification that only makes sense for lisp modes). It may be annoying if you don't want to use safe operations always. You may need to configure lispy-left and lispy-right per-mode if you want lispyville to handle other delimiters. Performance will also be worse for larger selections (though the operators will not try to handle regions over the configured threshold safely). Other than that, it should be okay, but I haven't tried it myself, so there may be some other annoyances.

Also, I wouldn't alias evil-delete, I would bind [remap evil-delete] 'lispyville-delete.

Thanks, for the info.

Wouldn't the remap be same as lispyville-mode with key-theme operators?

The reason I wanted an alias is https://github.com/Somelauw/evil-org-mode calls evil-delete directly and a remap wouldn't help in those cases.

Also it would be really awesome if we can generalize all operators and have a global-minor-mode in the same vein as smartparens-global-strict-mode, that does the safe operations.

Yes, but you could use lispyville-mode with a different configuration for lisp modes (more than just operators) and just bind the operators globally if you wanted.

I'm not confident it's a good idea to change all calls to evil-delete. Where is evil-org-mode using evil-delete where you would want it to use lispyville-delete? If you do want to try that, I'd suggest using advice with :override instead, so that it's easier to undo.

I'm planning on having a global minor mode for non-lisp modes at some point when I get rid of the lisp-specific functionality in the operators.

I'm planning on having a global minor mode for non-lisp modes at some point when I get rid of the lisp-specific functionality in the operators.

That would be awesome.

The main use case was my config file which is in org-mode and I have src blocks. It is partly a bad habit of mine to not open a org-src edit buffer, which will do the right thing. But in general I think safe operators are the better way.

I have never used :override but I will try that.

Thanks a lot for your advice.

The main use case was my config file which is in org-mode and I have src blocks.

You could also try polymode if you haven't already.