Fork me on GitHub
#emacs
<
2017-01-30
>
beppu20:01:26

This is not specific to Clojure, but those of you who want to try org-mode for the first time may find this useful: http://beppu.github.io/post/org-mode-basics/

pesterhazy20:01:25

@beppu, good job on the spacemacs post

pesterhazy20:01:38

I didn't know about SPC j I, that's very useful

beppu20:01:10

I discovered that one evening while talking to @qqq about imenu. There are so many little gems hidden in Spacemacs.

qqq21:01:02

beppu: this is why you should answer as many of my questions as possible -- you learn new, unexpected, and awesome features 🙂

qqq21:01:12

are you yourself using "evil lisp state", "evil-paredit" (what I use) or "lispy" ?

beppu21:01:46

I'm still on evil lisp state. I haven't tried the others. Didn't even know about them, tbh.

pesterhazy20:01:24

I use SPC r m a fair bit to go back to a place I just left

pesterhazy20:01:40

g i is useful

beppu20:01:08

I will try those out.

pesterhazy20:01:47

we should share our findings here 🙂

beppu20:01:02

SPC r m is pretty nice.

beppu20:01:24

Definitely.

pesterhazy20:01:48

my latest discovery is lispyville

pesterhazy20:01:15

if you enable it, you can dd lines or d regions while keeping parentheses balanced

pesterhazy20:01:43

it's so useful that it's surprising to me that spacemacs doesn't come with it enabled by default

beppu20:01:47

Maybe they don't know? I'm relatively new to the Emacs universe having been a vim user for 15+ years, so there's so much I don't know.

beppu20:01:31

I do use evil lisp state to slurp and barf but that's about it.

pesterhazy20:01:31

I mean spacemacs developers write lisp code all day

pesterhazy20:01:55

yeah me to, I use slurp, barf, raise, wrap and unwrap

pesterhazy20:01:05

other than that lisp state is clunky

beppu20:01:15

Thank god for undo.

jfntn20:01:48

Curious how spacemacs users edit lisp? I never used vim but tried evil a few times, and just gave up after trying to write some clojure and elisp

beppu20:01:41

@jfntn Spacemacs seems to favor something they call evil lisp state over paredit.

jfntn20:01:48

Even the spacemacs lisp layer is really slow and clunky compared to say paredit

pesterhazy20:01:06

evil is better for everything... except for lisp

pesterhazy20:01:34

I mean it's not aweful but not as good as paredit or lispy

jfntn20:01:00

In paredit you might have to M-C-S-something but it’s more like one keystroke since you do it over and over, in that lisp state it like “SPC l k j” or whatever and now i need to repeat “l k j” ?

pesterhazy20:01:39

@jfntn no it has this "state" (the little bar goes pink) where keystrokes are interpreted as lisp-state movements

jfntn20:01:57

lispy is great, I’ve been using it for a long time and almost never missed paredit

pesterhazy20:01:31

so one thing I can't do in spacemacs:

pesterhazy20:01:41

select a form, and then select the next form too

pesterhazy20:01:58

suppose I want to kill them together, or move them somewhere else

jfntn20:01:21

Do that all the time, C-M-space

jfntn20:01:26

oh wait, 😛

pesterhazy20:01:21

that's the kind of thing that should be easy

pesterhazy20:01:27

I suppose I could just bind that to some vim key I don't use?

pesterhazy20:01:55

@jfntn do you have a list of sexp-related movements/commands in emacs?

jfntn20:01:37

@pesterhazy what do you mean?

jfntn20:01:42

like useful ones?

pesterhazy20:01:59

like C-M-space, I didn't know about that

jfntn20:01:38

Here is my keyfreq data filtered for ‘lispy\|sexp'

beppu20:01:07

I just tried C-M-space - it's wonderful.

jfntn20:01:22

mostly lispy

beppu20:01:57

^-- how did you generate that file @jfntn ?

jfntn20:01:10

Nothing too interesting now that I’m looking at it

jfntn20:01:25

There’s a package called `keyfreq

dpsutton20:01:44

that's awesome haha

pesterhazy20:01:14

I have keyfreq turned on as well 🙂

beppu20:01:58

I'm going to install keyfreq now.

beppu20:01:40

Do you know about SPC s w g and SPC s w w ? Google Search and Wikipedia Search (with autosuggest via helm)

beppu20:01:05

It was recently retweeted by @spacemacs on twitter.

pesterhazy20:01:56

a window into my soul

jfntn20:01:46

lol I paused for a second when posting mine

pesterhazy20:01:04

you're way ahead of me man

jfntn20:01:18

9.85% evil-normal-state wut

pesterhazy20:01:28

perhaps as an evil user I have to type less?

pesterhazy20:01:42

@beppu, s w g is actually pretty cool

pesterhazy21:01:17

lispy-clone, that sounds useful

beppu21:01:35

@jfntn I'm surprised you don't use cider-eval-buffer, opting for the finer-grained cider-eval-last-sexp and cider-eval-defun-at-point. (I guess Spacemacs makes cider-eval-buffer easier, so I end up using it more.) , s b.

pesterhazy21:01:14

@beppu, I agree, , s b is more useful

beppu21:01:37

@pesterhazy There's some other crazy stuff under s that the guys in the Spacemacs gitter channel showed me.

beppu21:01:20

Go into a Clojure project and type SPC s p and then search for a common string like "defn". This is a normal project-wide search. However.... then type C-c C-e.

beppu21:01:47

You can edit the search results and then type C-c C-c to save your edits.

beppu21:01:00

Your edits can span multiple files.

jfntn21:01:39

ivy does that too it’s really cool, though for clojure clj-refactor is way better when it works

jfntn21:01:44

@beppu I only have commands matching lispy and sexp in that list, I use cider-load-buffer usually

pesterhazy21:01:53

yeah that editing is kinda cool

pesterhazy21:01:32

helm-ag is my most-used command

pesterhazy21:01:49

(well not according to keyfreq but if feels that way)

jfntn21:01:43

lol I was surprised not to see some commands in my list too

beppu21:01:53

@pesterhazy Did you know you could add command line arguments to your ag searches? For example, search for a string and then add -C to the query to give you context.

pesterhazy21:01:02

very useful too

pesterhazy21:01:17

you also need to escape spaces for some reason

pesterhazy21:01:29

very happy with rg by the way

beppu21:01:37

What's rg?

pesterhazy21:01:44

it's used automatically instead of ag if it's installed

pesterhazy21:01:52

it's even faster than ag

beppu21:01:29

I started with ack. I only just recently installed ag. Can't believe I have to upgrade again.

pesterhazy21:01:33

I moved from git grep to rg recently and couldn't be happier

pesterhazy21:01:42

yeah I was on git grep for like 5 years

qqq21:01:46

since we only get 10,000 msgs

qqq21:01:57

someone should take this and put it in a wiki somewhere, lots of knowledge, would be sad for it to disappear

beppu21:01:02

Surely someone has written a slack archiving bot.

pesterhazy21:01:08

there is one

pesterhazy21:01:43

we're all on camera

beppu21:01:31

@pesterhazy cool. I didn't know that existed.

pesterhazy21:01:40

my achievements for the day:

(evil-global-set-key 'normal ";" 'mark-sexp)
  (evil-global-set-key 'visual ";" 'mark-sexp)
  (evil-global-set-key 'normal "U" 'backward-up-list)
  (evil-global-set-key 'normal "R" 'down-list)
  (evil-global-set-key 'normal "F" 'forward-sexp)
  (evil-global-set-key 'normal "B" 'backward-sexp)

pesterhazy21:01:03

I'm going to see if those help my lispy editing skills

pesterhazy21:01:44

@jfntn you helped me quite a bit there, thanks!

pesterhazy21:01:15

wait what's lispy-flow?

jfntn21:01:21

@pesterhazy you’re welcome!

jfntn21:01:04

lispy-flow is kind of an odd one, it goes down the sexp tree inwards but tries to not get stuck in a leaf and moves back up and down again, kinda hard to explain and not sure I totally understand it but you quickl build an intuition for it

qqq21:01:24

I found the best help for my lisp skills -- was purchasing an kinesis advantage pro keyboard. It gives room for modifier keys, and thus shorter bindings.

dpsutton21:01:56

wow, @qqq that's jumping in the deep end

qqq21:01:15

http://www.anandtech.com/show/7125/kinesis-advantage-review-longterm-evaluation <-- for example, hitting the "END" key (right next to the DELETE key) with the thumb, makes hjkl all paredit comands

dpsutton21:01:22

you like it?

pesterhazy21:01:48

I have the keyboard as well

dpsutton21:01:49

i love emacs because with capslock mapped to control i never leave the homerow

dpsutton21:01:05

and i've written a library to help manage window resizing, splits, killing, etc

qqq21:01:06

on that keyboard, I have DELETE, which is. right under my thumb, mapped to CTRL

dpsutton21:01:10

so i almost never leave homerow

qqq21:01:33

@pesterhazy : I'd love to know of any keybindings you have that exploit the kinesis design.

qqq21:01:52

I'm currently trying to get all my emacs keybindings to be 2-3 keys total.

pesterhazy21:01:23

I use only one: I remap delete to escape

qqq21:01:39

found the vim user

qqq21:01:11

because I search with "/", I have mapped C-f to evil-normal-mode

pesterhazy21:01:18

unfortunately it didn't help my rsi but rather compounded it

qqq21:01:19

so I can keep DELETE zs CTRL, but ESCAPE is just CTRL-F

pesterhazy21:01:26

but it's an amazing layout

jfntn21:01:32

The main emacs usability improvement for me is to map the cmd keys on the mac to ctrl, and the caps lock key to meta

jfntn21:01:53

Makes C-M-f etc a breeze

qqq21:01:58

I can not believe we have a number of adults, supposedly with professional jobs, talking about keyboards and key bindings.

qqq21:01:34

The other thing I found relaly helpful is Hydra mode.

jfntn21:01:39

well rsi is no joke

dpsutton21:01:56

and comfort is what actual professionals talk about

dpsutton21:01:18

there's a saying that you can tell professional photographers because they'll talk about shoes; amateurs talk about cameras

beppu21:01:19

Spacemacs is comfy

pesterhazy21:01:41

@dpsutton I'll steal that line

dpsutton21:01:25

it comes out of the lineage of news photographers

dpsutton21:01:36

you might be on your feet for hours

dpsutton21:01:54

and what you care about in cameras is that they don't fall apart when they get wet or dropped

qqq21:01:21

we should ahve screencasts sometimes

qqq21:01:29

I want to see cool emacs combo tricks

qqq21:01:00

http://www.parens-of-the-dead.com/ is what got me to doubt vim and consider emacs

qqq21:01:06

I've never found anything of same quality since.

beppu21:01:22

I liked http://emacsrocks.com/ but he hasn't put out new content in a while.

dpsutton21:01:40

for a love/hate take on emacs

dpsutton21:01:56

it highlights some of the warts of the codebase

dpsutton21:01:04

but from someone who really cares about the platform

qqq21:01:19

what's a good package for selecting a dark color scheme in emacs?

dpsutton21:01:20

also, he or she has a really nice emacs.d on github

beppu21:01:30

(I didn't realize until now that the emacsrocks guy and the parens of the dead guy were the same.)

qqq21:01:44

@beppu: the voice is distinctive

qqq21:01:57

@dpsutton : the spolsky theme really is nice

dpsutton21:01:03

i think i run a modified version of odersky

pesterhazy21:01:31

solarized-light all the way

qqq21:01:02

this is borderline heresey, but is there a evil-normal-mode optimized for LISPY interaction ?

dpsutton21:01:10

have you seen the lispy package?

beppu21:01:26

I'm quite fond of the default spacemacs-dark. I also like gruvbox from time to time (from the spacemacs themes-megapack (http://themegallery.robdor.com/))

qqq22:01:02

@dpsutton: I tried lispy, but found I liked paredit far more

qqq22:01:11

lispy's 'context sensistive' and 'movement keys' were confusing for me