This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-04-05
Channels
- # announcements (1)
- # beginners (72)
- # boot (4)
- # calva (35)
- # cider (8)
- # clara (13)
- # cljdoc (31)
- # cljs-dev (34)
- # clojure (64)
- # clojure-europe (1)
- # clojure-finland (3)
- # clojure-italy (23)
- # clojure-losangeles (3)
- # clojure-nl (35)
- # clojure-uk (19)
- # clojurescript (26)
- # cursive (19)
- # datomic (12)
- # duct (5)
- # editors (7)
- # emacs (25)
- # fulcro (40)
- # funcool (5)
- # jobs (2)
- # leiningen (3)
- # luminus (2)
- # lumo (3)
- # off-topic (19)
- # pathom (3)
- # planck (2)
- # reagent (6)
- # remote-jobs (4)
- # rum (1)
- # shadow-cljs (23)
- # spacemacs (6)
- # tools-deps (12)
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)
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 http://keboard.io 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.
Also macOS with no fiddling at all. But the new breed of Electron apps breaks that (e.g. slack)
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)
(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.
I feel dumb for not being able to find this, but how do I set custom identation for functions/macros?
It's the define-clojure-indent
stuff in https://github.com/clojure-emacs/clojure-mode#indentation-options