Any *Doom Emacs* users use any safe structural editing
modes here? If yes, how do you configure it?
I removed smartparens in favor of paredit. Works pretty well for me.
> I removed smartparens in favor of paredit. Why though? you could just do M-x sp-use-paredit-bindings
For the reason that was mentioned earlier: smartparens allows me to unbalance parens a little too easily. I find that paredit makes that a bit more difficult.
Is there a package that prevents me from deleting parens in normal mode?
@juan.ignacio848 smartparens in strict mode prevents deletion of parens where that would make them unbalanced. smartparens is included in Spacemacs (a simple config to set to strict mode). There seems to be an issue using smartparens in Doom for some people.
It seems to be working with evil-paredit in Doom
I'm still deciding between Doom and Spacemacs (and cursive which is the one I usually use ๐ )
doom's upgrade experience, fast startup, and responsive maintainer is why I use it over spacemacs
spacemacs would break for me enough that I just stopped upgrading once I got a known working version
I use doom. As for safe editing, I use it. Iโts pretty much auto configured. I added in my config the following:
(add-hook! smartparens-mode
(evil-cleverparens-mode)
(evil-unimpaired-mode)
(smartparnes-strict-mode))
Since smartparens is enabled by default (AFAIK) Keep in mind that Iโm an emacs noob so this my be overkill/incorrect - YMMV
would i need to install evil-cleverparens-mode
for it?
dont think that exists by default? I too am just starting out with Doom
Yup - just add it to packages.el in your doom directory
I also added unimpared - you can just delete it if you donโt use it (itโs from my vim days)
I added
(package! evil-cleverparens)
in packages.el
and
(add-hook! smartparens-mode
(evil-cleverparens-mode)
(smartparens-strict-mode))
in config.el
but i can still delete the closing braces, what i am missing?what i want is the
(spacemacs/toggle-evil-safe-lisp-structural-editing-on-register-hooks)
like behaviour. But cant find its source to copy too ๐
after changing packages.el you should run doom upgrade
and restart emacs in order to get your new packages
yeah i did that
I should not be able to delete closing parens, braces right?
do SPC h m
and check if the mode is activated. and you can delete closing braces you just can't unbalance them using bulk delete commands like dd
ah, the mode is activated. the spacemacs one doesnt let me delete the closing ones in addition to this too. was hoping i can get that behavior here too
might be worth looking at what spacemacs uses for settings to get that
For me, deleting occurs, but it deletes both the opening AND the closing parens - thus keeping my s-expression balanced
@nirrub does it work for example in (def a (+ 1 2)) and I delete the ) after 2? The one before + is deleted too? Or only if the sexp is empty? The first case is not possible in spacemacs.
@corasaurus-hex that was my intent too. But failing to find where that could be defined
there's also lispy in doom, and there's evil-smartparens out there as well. you can explore to see what works how you want
Or I guess I will reset my head and muscles and just follow doom ๐ really liking its snappy speeds and lean features, specially compared to spacemacs. Thanks for the pointers @corasaurus-hex
no prob, glad to help!
Sounds like smart-parens is not in strict mode, if you can delete parens and leave them unbalanced.
After modifying config files you have to do doom refresh :)
@romain yes i did that pretty much after every change ๐
@jr0cket where can i find the impl of (spacemacs/toggle-evil-safe-lisp-structural-editing-on-register-hooks)
?
@romain still I'm able to delete the closing braces and leave it unbalanced. These are all the changes I made in config.el:
(add-hook! smartparens-mode
(smartparens-global-strict-mode))
it says the strict mode is on and also I cannot _add a ) back after i have unbalanced it. it says cannot do that in strict mode ๐I believe that toggle code is generated by other code, so no explicit code to copy.
ah okay
Are you deleting close parens in Evil insert mode or Evil normal mode
in insert mode
Very strange then. Unless something is broken with the package, then it sounds like something is conflicting with something else in doom or another package. I am just guessing now (not a doom user)
yeah im beginning to think so too. I have asked this on their discord channel now. fingers crossed! Thanks for the help @jr0cket
Maybe Try to reach henrik on doomโs discord?