Fork me on GitHub
#emacs
<
2017-02-16
>
amdt00:02:37

Does anyone have experience with Parinfer? https://shaunlebron.github.io/parinfer/

amdt00:02:53

I use Paredit but gave Parinfer a go the other day and just couldn’t get the hang of it.

amdt00:02:58

It probably didn’t help that the implementation I tried seemed incomplete. https://github.com/DogLooksGood/parinfer-mode

tianshu01:02:22

@amdt Hi, what problem you met?

amdt01:02:52

One thing I had trouble with was changing indentation: the tab key did nothing.

tianshu01:02:15

@amdt Since emacser's TAB key is highly customized, I didn't make indent with TAB by default. If you use company to auto complete, and trigger it with TAB. here's my configuration(use with paredit).

(use-package parinfer
  :bind
  (:map parinfer-mode-map
   ("C-'" . parinfer-toggle-mode)
   ("M-r" . parinfer-raise-sexp)
   ("<tab>" . parinfer-smart-tab:dwim-right-or-complete)
   ("S-<tab>" . parinfer-smart-tab:dwim-left))
  :config
  (parinfer-strategy-add 'default 'newline-and-indent)
  (parinfer-strategy-add 'instantly
    '(parinfer-smart-tab:dwim-right
      parinfer-smart-tab:dwim-right-or-complete
      parinfer-smart-tab:dwim-left))
  :init
  (require 'ediff)
  (setq ediff-window-setup-function 'ediff-setup-windows-plain)
  (setq parinfer-lighters '(" Parinfer:Ind" . " Parinfer:Par"))
  (setq parinfer-extensions '(defaults pretty-parens smart-tab smart-yank paredit))
  (setq parinfer-auto-switch-indent-mode-when-closing t)
  (add-hook 'emacs-lisp-mode-hook 'parinfer-mode)
  (add-hook 'clojure-mode-hook 'parinfer-mode))

tianshu01:02:19

If your company will popup automatically, use ("<tab>" . parinfer-smart-tab:dwim-right-or-complete) instead of ("<tab>" . parinfer-smart-tab:dwim-right)

amdt01:02:15

I see. I don’t use company-mode or customise my tab key at all.

amdt01:02:43

How do you use Parinfer and Paredit together? I wouldn’t have expected them to complement each other.

tianshu01:02:52

you can try this

(use-package parinfer
  :bind
  (:map parinfer-mode-map
   ("C-'" . parinfer-toggle-mode)
   ("M-r" . parinfer-raise-sexp)
   ("<tab>" . parinfer-smart-tab:dwim-right)
   ("S-<tab>" . parinfer-smart-tab:dwim-left))
  :config
  (parinfer-strategy-add 'instantly
    '(parinfer-smart-tab:dwim-right
      parinfer-smart-tab:dwim-left))
  :init
  (setq parinfer-extensions '(defaults pretty-parens smart-tab smart-yank paredit))
  (add-hook 'emacs-mode-hook 'parinfer-mode)
  (add-hook 'clojure-mode-hook 'parinfer-mode))
I use paredit and parinfer together, paredit's command will always keep your code in right indentation, so there's no particular compatible issue.

tianshu01:02:34

I don't enable paredit-mode directly, because it have some hooks that will affect parinfer. I just do (require 'paredit), then bind paredit commands. there's the implementation in parinfer. I didn't bind all commands. but it's easy to do that https://github.com/DogLooksGood/parinfer-mode/blob/master/parinfer-ext.el#L121

Kira Sotnikov09:02:24

Which way is better to implement windows and mac os support at same time?

Kira Sotnikov09:02:40

Create 2 different init and load it depends from a platform

Kira Sotnikov09:02:06

or wrap each platform dependent part to condition with platform check?

Kira Sotnikov09:02:32

My goal is same config on windows and macos laptops

sooheon09:02:49

@mattly it’s a bit late, but I like your theme. Also if I’m not mistaken that’s the Input font, which is all I use, so our aesthetic senses must really line up :)

qqq09:02:26

instead of (1) having an org mode file which tangles out .clj files, is it possible to (2) have a .clj file which has org mode components, i.e. things like

* <-> ;
** <-> ;;
*** <-> ;;;
?

sooheon09:02:07

I think abo-abo does something kinda similar in his elisp files

sooheon09:02:23

The syntax is something like ;; ;; ;; etc

sooheon09:02:34

and he has functions for navigating between them and so on

qqq09:02:05

did abo-abo write hydra and lispy too ?

sooheon09:02:08

haha yep he’s a elisp wizard. Kinda reminds me of vim’s tpope in that he has his own “philosophy” if you wan to call it that

qqq09:02:14

looks like he is using precisely the mode you described

qqq09:02:01

in aboabo's system, is he able to (1) say "show all headings of level 2"?

qqq09:02:11

that's basically the main feature I want from org-mode when writing clojure code

sooheon09:02:28

What I’ve noticed is section folding by header is level-aware (ie if I fold at ;; then it folds all ;;* below it)

sooheon09:02:45

Also there was a counsel interface to show all the headings

qqq09:02:50

sooheon: which package are you using for "section folding" ?

sooheon09:02:55

similar to lispy-goto

qqq09:02:58

The config comes with its own .Xmodmap that makes ; into an additional modifier. RSI savers:

;-v instead of Enter.
;-o instead of Backspace.
;-f instead of Shift-9 and Shift-0.
;-a instead of -.
;-s instead of Shift--.
;-q instead of Shift-'.
;-e instead of =.
;-u in addition / instead of C-u.
^^ this is insane

sooheon09:02:09

Ah yeah I’m not using all that

sooheon09:02:26

just installed lispy, and pressing i with cursor before header will fold it

sooheon09:02:46

shift tab will fold all headers like org

qqq09:02:04

wait wait -- what are you using for showing headings jumping around?

qqq09:02:19

the once nice thing with org files is that I have something like C-8 = helm completion based on org mode header in all my *.org files

qqq09:02:26

so I can jump anywhere I want in a few keystrokes

sooheon09:02:58

Ok, so I think what you need to replicate this is jsut lispy and ivy counsel swiper

sooheon10:02:10

I think the latter three are all under swiper these days not sure

qqq10:02:34

I have lispy, will look into ivy / counsel / swiper

sooheon10:02:20

So I’m folding stuff in my init file, and I’ve just called counsel-outline which gets me just those headings

sooheon10:02:25

folding with i in comments special and shift tab

sooheon10:02:40

I’ve bound counsel outline to C-c o

qqq10:02:08

okay, I'm sold

qqq10:02:23

I've gotten nothing done in the past 4 weeks because every time I think I have the right emacs config, something else pops up

sooheon10:02:29

hahah I’ve been there

sooheon10:02:55

I’ve been mostly proselytizing abo-abo and all his packages recently

sooheon10:02:04

they’re all awesome

qqq10:02:37

i think all the packages I'm using at th emoment are: evil stuff by abo-abo stuff by cider author

sooheon10:02:22

those are my essentials as well

sooheon10:02:52

oh add stuff by tarsius

sooheon10:02:59

author of magit who also has written no-littering

qqq10:02:31

does he also manage melpa?

sooheon10:02:49

no idea, but he’s made emacsmirror too

sooheon10:02:57

which puts all the melpa packages in git

qqq10:02:29

do I want all of the following? counsel counsel -bbdb -dash -gtags -osx-app -projectile ?

qqq10:02:06

okay, this is a dumb question:

qqq10:02:21

how do I get emacs to only show lines of the form ;; * ;; ;; * ;; and so forth ?

sooheon10:02:41

try shifttab

sooheon10:02:50

make sure lispy is on

sooheon10:02:58

it should be bound to lispyshifttab

qqq10:02:27

M-x lispy-shifttab

qqq10:02:31

did nothing

qqq10:02:33

M-x lispy-goto

qqq10:02:41

no support found to parse buffer "util.cljs" <-- wtf

hkjels13:02:38

has the syntax for using named code-blocks changed in org 9?

hkjels13:02:55

If I use the org-mode that ships with emacs, the blocks are expanded

hkjels13:02:09

I’m talking about these guys <<Modal-Editing>>

hkjels13:02:04

Gee. Was looking at the wrong release-log

hkjels13:02:19

Well. My file now goes through the linter without warnings, but still my code-blocks does not expand

hkjels13:02:36

making my code work with 9 made it incompatible with what ships with emacs. Grrr”#$%!

sooheon15:02:18

@qqq Ah yeah I forgot to set it doesn’t have support for parsing cljs yet. Did you get the outliner working though?

mattly17:02:47

@sooheon thanks; though I've since switched to using Apple's SF Mono font

beppu18:02:31

For anyone who wants to learn how to use org-mode better, I found a great playlist: https://www.youtube.com/playlist?list=PLVtKhBrRV_ZkPnBtt_TD1Cs9PJlU0IIdE

qqq22:02:07

besides org-mode, which requires tangling (and screws up line numbers) is there any other module that will give me "multi level headings" for a *.clj file? I want something like ` ;; * ;; ;; *

qqq22:02:23

does projectile/helm for a comamnd for "search throuhg all .cljs .clj *.cljc files in current project" ?

jfntn22:02:29

@qqq I use outshine for what you described

jfntn23:02:05

Though I’m starting to question whether that’s a good idea because even emacs users don’t use that format...

qqq23:02:48

@jfntn: what do you mean by "even emacs users don't use that format..."

jfntn23:02:07

Well you need some obscure package to get folding and navigation to work. Lisp languages tend to prefer4, 3 or 2 semicolons and I think this works otob in emacs