Fork me on GitHub

Any opinions on using parinfer on Emacs? It seems like the promoted plugin is experimental WRT “smart-mode”


I find Parinfer very distracting in practice. For myself, learning slurp, barf, delete and raise in paredit or smartparents was relatively low effort and is mostly all that is needed. I can also use smartparents for all the programming language, even non lisps


I got a new keyaboard which (by accident) has no arrow keys. So my paredit keybindings stopped working (I’ve since rebound them). Thought I’d try parinfer, I liked it when I was trying it out in other editors (using the smart mode)


TIL about smartparens being available to other languages. I’d have to investigate.


@orestis happy hacking keyboard?


No, just some PCB from kbdfans — but they sent me the wrong one without arrow keys


I use Evil mode in Emacs, so only need to use specific arrow keys in the few things I do outside of Emacs. Since using Spacemacs my keyboard usage has been much more effective in minimising hand move and works very well with the reduced physical keys on my model01 keyboard.


I use Vim keybinding pretty much everywhere: - browser: Vimium - OSX: hammerspoon with Spacehammer - Linux: EXWM


No need to move to vim keybindings to get rid of arrow keys usage, emacs default movements keys are fine too. I guess it's a matter of preference.


as a bonus emacs movement keys work everywhere on linux with some minor fiddling

☝️ 8

Also macOS with no fiddling at all. But the new breed of Electron apps breaks that (e.g. slack)

👍 4

check out adjust-parens too, it's basically an on-demand version of Parinfer's enforced indent mode


Ya, I personally prefer Holy mode as well. And I have quite a few custom keybindings. But I guess if you don't want to fiddle with customization as much, Evil is good, since Vim has a lot of default bindings to a lot of good editor commands.


And I use smartparens and pairinfer both. Only parinfer has a wrap around command, so I use it for that.


;; Enable moving between windows using S-left, S-right, S-up, S-down.
  (when (fboundp 'windmove-default-keybindings)

  ;; Make windmove work in org-mode.
  ;; Will only work when not in a context where org uses S-<arrow>:
  (add-hook 'org-shiftup-final-hook 'windmove-up)
  (add-hook 'org-shiftleft-final-hook 'windmove-left)
  (add-hook 'org-shiftdown-final-hook 'windmove-down)
  (add-hook 'org-shiftright-final-hook 'windmove-right)

  ;; Make M-left/right/up/down global shortcuts for forward, backward, up
  ;; and down sexp. Normally, it's C-M-left/right/up/down, but I bind that to
  ;; linux next/prev desktop. So I needed to find a replacement shortcut for
  ;; them in emacs.
  (global-set-key (kbd "M-<left>") 'backward-sexp)
  (global-set-key (kbd "M-<right>") 'forward-sexp)
  (global-set-key (kbd "M-<up>") 'backward-up-list)
  (global-set-key (kbd "M-<down>") 'down-list)

  ;; Make `C-c d` a global shortcut for duplicating the current line or region.
  (global-set-key (kbd "C-c d") 'spacemacs/duplicate-line-or-region)

  ;; Make M-( , M-[ and M-{ global shortcuts to wrap following sexp
  ;; in respective brackets.
  (global-set-key (kbd "M-(") 'paredit-wrap-round)
  (global-set-key (kbd "M-[") 'paredit-wrap-square)
  (global-set-key (kbd "M-{") 'paredit-wrap-curly)

  ;; Make M-r a global shortcut for raising sexp over parent.
  (global-set-key (kbd "M-r") 'sp-raise-sexp)

  ;; Make M-S-up/down global shortcuts for expanding and contracting region.
  (global-set-key (kbd "M-S-<up>") 'er/expand-region)
  (global-set-key (kbd "M-S-<down>") 'er/contract-region)

  ;; Make C-S-up/down global shortcuts for moving a line up or down.
  (global-set-key (kbd "C-S-<up>") 'move-text-line-up)
  (global-set-key (kbd "C-S-<down>") 'move-text-line-down)


I don't find I ever need slurp and barf with this setup. And it's more intuitive to me then slurp and barf


Oh, how can you do things without slurp/barf? I just went with the “animated guide to paredit” and I’m just using these two. And sometimes I raise sexp by accident :)


I mean. I can wrap things in sexp, I can unwrap things. And I can move the cursor up/down/left/right of sexpr.


That's all you need


I don't personally find slurping and barfing to be useful given the above commands.


I still sometimes use split and join


But that's rare too


I feel dumb for not being able to find this, but how do I set custom identation for functions/macros?


Thanks very much!