-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[enhancement] issues using lispyville in non-lispy modes #54
Comments
Are you referring to the closing delimiter It might be a good idea for lispyville to keep a list of known lisp modes and override certain settings buffer-locally for non-lisp modes. Related snippet from my current config: (setq lispyville-lisp-modes
(append lispy-elisp-modes
lispy-clojure-modes
'(scheme-mode racket-mode lisp-mode common-lisp-mode hy-mode)))
(evil-define-key 'normal lispyville-mode-map
[remap evil-indent]
(lambda () (interactive)
(call-interactively
(if (memq major-mode lispyville-lisp-modes)
#'lispyville-prettify
#'evil-indent)))) |
yes.
BTW, it's easier to conditionally ;; https://github.com/noctuid/evil-guide#preventing-certain-keys-from-being-overridden
(general-override-mode)
(general-define-key
:keymaps 'override
:prefix "SPC"
:states '(normal motion visual)
","
(general-predicate-dispatch 'evil-indent
;; pred def ...
(memq major-mode lispyville-lisp-modes) 'lispyville-prettify)) Or use general's |
The main thing I would support in non-lisp modes would be the safe operators. They are written in a fairly generic way and could work with custom delimiter pairs. Things like slurping/barfing and things that rely on lispy wouldn't be supported for the most part (though lispy does support some functionality in non-lisp modes, like eval). I've considered adding a separate minor mode for non-lisp modes. The function, comment, and string text objects (and corresponding motions) will be fully generic and moved to another package (I basically have them working already in a major-mode agnostic way).
Yeah, there is code for this directly in |
Just heard about the incremental parser tree-sitter and its emacs bindings, on Emacs-China. Excited about how we can make lispy{,ville} available everywhere someday with tools like these. Dynamic module seems to be making many things possible. |
Continuing discussion in #53
lispyville-delete
lispyville-up-list
automatically prettifies code, pulling things after{
to the same line, which is unwanted. (Not usingprettify
key theme but bindinglispyville-prettify
orevil-indent
depending on major mode fixesevil-indent
.)idea: Maybe provide option to not prettify anything after delete etc.? Or, option to override the internal prettify mechanism with normal indent?
y y
onconsole.log(`hello, ${name}`)
, when pasting, the second`
will be missing.The text was updated successfully, but these errors were encountered: