expez / evil-smartparens

Evil integration for Smartparens
GNU General Public License v3.0
134 stars 17 forks source link

Slurpage and Barfage #19

Closed arunisaac closed 9 years ago

arunisaac commented 9 years ago

Are slurpage and barfage not implemented? There is no mention of it in README.md and I am unable to figure out how to do it with evil-smartparens.

Slurpage and barfage would be very nice to have.

Thanks!

expez commented 9 years ago

We're extending smartparens here, not replacing it. Just bind the smartparens functions for barfing in slurping to your favorite keybindings :)

arunisaac commented 9 years ago

Yes, I understand that. But, it would be nice if evil-smartparens came with the smartparens functions bound to vim-like keybindings. So, an user wouldn't have to think about smartparens at all, and just start using evil-smartparens, as though it were a stand-alone package.

expez commented 9 years ago

[...] bound to vim-like keybindings

And what would those be? All bindings are taken. All choices I make are likely to make me happy but piss everyone else off, or perhaps worse be some compromise which makes everyone slightly unhappy.

Here are the bindings I currently use, copied from my .emacs.d. I'm quite happy with them but probably these aren't the keybindings you'd choose for yourself.

(defun my-smartparens-mode-hook ()
  (turn-on-sp-navigate-consider-stringlike)
  (evil-smartparens-mode 1)
  (fill-keymap evil-normal-state-local-map
               (kbd "C-t") 'sp-transpose-sexp
               "[" (lambda (&optional arg) (interactive "P") (sp-wrap-with-pair "["))
               "{" (lambda (&optional arg) (interactive "P") (sp-wrap-with-pair "{"))
               "(" (lambda (&optional arg) (interactive "P") (sp-wrap-with-pair "("))
               "H" 'sp-backward-up-sexp
               "L" 'sp-up-sexp
               "C-9" 'sp-backward-barf-sexp
               "C-0" 'sp-forward-barf-sexp
               "M-9" 'sp-backward-slurp-sexp
               "M-0" 'sp-forward-slurp-sexp))

(fill-keymap sp-keymap
             "M-s" 'sp-splice-sexp
             "M-S" 'sp-split-sexp
             "M-j" 'sp-join-sexp

             "M-o" 'sp-down-sexp
             "M-u" 'sp-backward-down-sexp

             "M-l" 'sp-forward-sexp
             "M-h" 'sp-backward-sexp
             "M-k" 'sp-splice-sexp-killing-backward-or-around
             "M-K" 'sp-splice-sexp-killing-forward
             "C-k" 'sp-kill-sexp
             "M-c" 'sp-convolute-sexp)

I get what you're saying but I don't want to spend any time on this when smartparens already provides a pretty good set of default keybindings which anyone can enable.

arunisaac commented 9 years ago

Yeah, I understand. Choosing keybindings that work for all is always unpleasant business. Anyway, thanks for showing me your keybindings. It gives me some idea about what kind of keybindings to use for myself.

I will close this issue now.