Fork me on GitHub
#emacs
<
2016-10-06
>
ag02:10:33

@eraserhd just use Spacemacs. the easiest way possible.

pesterhazy07:10:00

@jfntn, 💥 that works!

pesterhazy07:10:06

you're a

pesterhazy07:10:27

I guess it pays to actually know some Emacs keybindings when working with Emacs

zzamboni08:10:48

@eraserhd http://spacemacs.org/ is focused on Evil mode, and some people quite like it, but it's anything but vanilla, it comes heavily customized. For vanilla Emacs I'd suggest https://emacsformacosx.com/ (which is what you get if you "brew cask install emacs" btw), and just enable Evil and any other modes you need.

tianshu12:10:26

For Clojure development, maybe lispy is better than evil.

crankyadmin12:10:29

> maybe lispy is better than evil. This

tianshu13:10:53

lispy provide mode too, insert mode and command mode. but user dont need to toggle it manually. which mode is enabled, depend on the cursor position. if cursor locate before ( or after ), it will be command mode, otherwise insert mode.

tianshu13:10:18

thanks to the S-expression.

eraserhd13:10:13

Ooh, lispy looks interesting.

pesterhazy15:10:54

evil-cleverparens gives you things like daf (delete a form) and dad (delete a defun)

pesterhazy15:10:14

lispy doesn't cooperate with evil though

mattly16:10:41

spacemacs has a "lisp mode" that hooks up to paredit

mattly16:10:51

SPC k b is barf, for example

mattly16:10:02

and once you're in there you can forego the SPC k

mattly16:10:14

...depends a lot on what you like though

ag17:10:04

@mattly yeah I have mixed feelings about Spacemac’s lispy mode. I can use some improvements. for example - when you yank a sexp, why does it need to stay in the that mode? Does it make sense? To me it doesn’t. Anyway… One of these days I’ll find some time and try cleverparens.

mattly17:10:47

I came directly to spacemacs from vim pretty early in spacemacs developement, and around the time I was learning clojure

mattly17:10:10

I was using vim-paredit or one of those and couldn't keep all the keyboard shortcuts for that in my head

mattly17:10:19

so spacemacs' which-key mode helped a lot

mattly17:10:46

but I also started noticing that the vim paredit stuff relied a lot on chords and the sort of things vimmers make fun of emacs for

mattly17:10:42

I still have a ways to go on using spacemacs's lisp mode properly, but the utility for slurp/barf/wrap/unwrap are undeniable

hlolli17:10:43

Does someone have a function for comment line that inserts newline character before the parenthesis, hope this explains what Im after:

(def clojure
   | "rocks")
bad:
(def clojure
 | ;; "rocks")
wanted:
(def clojure
 | ;; "rocks"
)

tianshu17:10:20

@hlolli You want to comment a line without care about parentheses?

hlolli17:10:36

@doglooksgood looking for something that guarantees a valid sexp after commenting 🙂

tianshu17:10:15

I'm writing a plugin for Parinfer on Emacs, https://github.com/DogLooksGood/parinfer-mode I hope it would be the painkiller for lisp's parentheses.😎

tianshu17:10:08

And a plugin lispy can do like this:

(def clojure
 | ;; "rocks"
)

hlolli17:10:54

ahhh ok, Im starting at the gif on your github page.... trying to see where this fits my paredit world of view, impressed.

hlolli17:10:32

nice, I give this a try. Makes sense, that the last paren is alone there at the end.

tianshu17:10:59

Parinfer is not a 100% covered paredit solution, but using with paredit or smartparens, it's very handy.

hlolli17:10:44

Ok, I need to look into this, if I could start using the parts I like and discard others.

hlolli17:10:03

@doglooksgood symbol void font-lock-flush, something to worry about?

hlolli17:10:21

arent font-locks basically highlight, this could be a error on my side.. nvm.

tianshu17:10:19

The verison of Emacs?

tianshu17:10:53

try (require 'font-lock)

tianshu17:10:36

or maybe M-x global-font-lock-mode, is this mode available on your Emacs?

hlolli17:10:45

its on, some random warning, probably false alarm on my side. Otherwise I wouldnt know whats missing.

tianshu17:10:24

You can just paste the warnings, I think.

hlolli17:10:55

but I guess something needs to be disabled, because if I comment, the parenthesis line up beautifully, but deleting them back causes unbalanced paren error. Probably from paredit?

hlolli17:10:21

parinfer-mode disabled aggressive-indent-mode for compatibility reason.
Caution: YES = Indent-mode (Buffer will be modified); NO = Paren-mode, which one? (y or n) n
Parinfer: Paren Mode
parinfer-ext::pretty-parens:paren: Symbol's function definition is void: font-lock-flush

tianshu17:10:30

parinfer-mode disabled aggressive-indent-mode for compatibility reason. ignore this line

tianshu17:10:16

Caution: YES = Indent-mode (Buffer will be modified); NO = Paren-mode, which one? (y or n) n This line means, If you enable Parinfer Indent Mode, your buffer will be changed, you can use M-x parinfer-diff to see the changes. Parinfer has two modes, in Indent Mode you only care about indentation. and in Paren Mode, you only care about parens.

tianshu17:10:18

Paredit should not be enabled directly, and If you want auto pairs, you should switch to Indent Mode. better to test on a demo.clj.

tianshu17:10:06

Maybe the document is bad, need to improve it:no_mouth:

hlolli17:10:11

no, looks fine, not sure if I should try to learn this before a music live-coding performance I have next week, where every ms counts. But it looks like it works, only paredit bit annying me, I could disable some of paredit functionality.

hlolli17:10:08

but Im curious to see if this still would make editing faster, I do anything for speed!

tianshu18:10:10

You should take a look at lispy when you have time, I think that is the faster way.

tianshu18:10:53

or maybe parinfer + lispy. both of them have some advantages and disadvantages 🙂

tianshu18:10:50

It's time for me to sleep zzzzz

hlolli18:10:59

ok thanks, sleep well

verma19:10:29

@hlolli not sure what I have configured (highly unlikely anything other than cider) but it seems that its automatically doing it for me

hlolli19:10:21

@verma yes that's right, it does so too for me when manually typing a semicolon before a word. But most of the time I comment with a custom keybinding, I think it comes with emacs, comment-line, and I can have the cursor anywhere on the line and it will find the beginning of the text and add ;;, the only time I dont use it is when the line ends with a closing bracket with the opening one missing from the line.

verma19:10:46

oh oh, I see

hlolli19:10:52

I mean, its bit slow when commenting many lines (besides region comment, which also has this limitation) to press down, press left, type ;, press down press left.. etc...

verma19:10:38

you’re right, comment-region doesn’t take care of it

verma19:10:49

I probably haven’t run into it since I just discovered region commenting in emacs 🙂, usually with clojure stuff #_() and (comment ..) suffice for me

hlolli19:10:57

I'd be curious to find comment keybinding that adds #_ or maybe I should just do it myself.