Fork me on GitHub
#spacemacs
<
2019-06-09
>
didibus00:06:18

Hum, so what's the best Evil way to go about deleting a section of code?

didibus00:06:13

It seems without relative line numbers, it is pretty hard

didibus00:06:24

5dd seems the best way, but without relative number, its a bit hard to decide the correct number

didibus00:06:30

I guess you can also just repeat dd

didibus00:06:58

That's probably easiest: dd followed by . many times

Chris O’Donnell01:06:01

I often use dap and da(/`da[`/`da{`.

☝️ 4
aisamu03:06:07

I'm not sure if some local layer changed it, but da( is also aliased to dab, da{ to daB If you use lispyville, you gain dax (s-exp), dal (list), daa (atom)

didibus19:06:28

So, after using only evil, for 2 days. One thing I struggle is that nothing seems as good as Emacs sexp functions for navigating Lisp code.

didibus19:06:03

It seems more focused on freeform text. You can move by word or WORD, by paragraph, and % moves between bracket

didibus19:06:14

But how do I move structurally around sexp?

didibus19:06:53

Like say, left/right across sexp forms and up/down into and out of them?

aisamu02:06:40

lispyville and lispy have changed my life, even with rough corners! motions that only navigate (e.g. lispyville-forward-sexp bound to L) and motions that navigate leaving you already on insert (`lispyville-backward-up-list` bound to () are very convenient! As a heavy user of SPC k ... mode, I knew I had to do something once I saw a coworker using holy-mode. It was the same feeling I had when I saw someone using emacs while I was still using Atom.

didibus02:06:30

Haha, okay, so maybe I should try it. Because ya, as I see it, and always when I'm comparing myself to Evil coworkers, I am way more productive in Holy mode when working in Clojure. I can navigate in and out, back and forth, selections, etc. so easily. I'll give lispyville a swirl and see

aisamu02:06:23

The installation wasn't super straightforward for an emacs beginner such as myself, so let me know if you'd like the config files!

ag04:06:11

@U1UQEM078 do you know if someone has built a layer?

ag04:06:56

will definitely give it a try myself when I have a chance

aisamu12:06:11

@U0G75ARHC I couldn't find one when tried, so I had to (poorly) write my own private layer for it 😞

spfeiffer22:06:56

You mean transient lisp mode? 😉

ag22:06:33

@didibus some claim that evil-cleverparens layer gives you some nice things, I yet have to try it myself. But as you know - I’m lazy.

didibus22:06:59

Hum, so no native Vim

didibus22:06:28

How do I access transient lisp mode?

ag22:06:37

SPC k ...

didibus22:06:05

That's not transient though

didibus22:06:24

Also, anyone else has SPC unbounded in lisp-state?

didibus22:06:36

M-m still works, but not SPC

didibus22:06:27

Maybe I'm used to Holy mode transient, normally transient refers to the use of Hydra

didibus22:06:35

In holy mode

didibus22:06:37

Also, how long did it take you to become more productive? Cause now I think I'm about 20 times less productive 😛

ag22:06:54

Be patient… nobody can expect to become fluent in Spanish in just a few days just by reading some Gabriel García Márquez. Also, I think I’ve told you: “you’re gonna hate me for a while”

didibus22:06:43

We'll see if it pays off I guess. I did vimtutor, the free part of vimadventures

didibus22:06:11

Now its about using it for real

didibus22:06:25

That's where I started really missing the emacs lisp features.

didibus22:06:10

I don't find SPC k super useful, it takes so long to type SPC k before every move, and lisp-state disapears on Esc, so all insert mode gets you out of it

didibus22:06:45

Okay, but isn't it abnormal that SPC and , are no longer bound in lisp state?

didibus22:06:01

How am I suppoed to run eval last sexp without , 😛

didibus22:06:17

Do I have a broken setup?

ag22:06:15

every Emacs user in some sense has a “broken” and at the same time “perfect” setup.

ag22:06:22

find what makes sense for you

ag22:06:34

and change it to your needs

ag22:06:09

I’m not a big fan of SPC k either, at some point I’d probably try to find something that works for me better

ag22:06:14

but it’s easy to extend. Here’s for example how I added SPC k = operator - it reindents things in current sexp:

(defun sp-reindent ()
    (interactive)
    (save-excursion
      (er/expand-region 2)
      (evil-indent (region-beginning) (region-end))))

  (evil-lisp-state-enter-command sp-reindent)
  (spacemacs/set-leader-keys
    "k=" #'evil-lisp-state-sp-reindent))

didibus22:06:54

Well, I meant broken like, isn't Spacemacs supposed to have SPC bound in all states as the leader? Especially since evil-lisp-state is made by the same person, so I was wondering if that's a bug or my config has an issue

didibus22:06:18

Ya, my Emacs is highly customized. But right now I want to make sure I learn the Vi way, before I customize it. That's why I ask first if here are ways I'm just not thinking off before I create custom ones

didibus23:06:16

Lispy seems nice, abo-abo is an awesome Emacs dev too, I love all his packages. But I still think I need to practice pure Vi before I try these Emacs only packages

ag23:06:47

> isn’t Spacemacs supposed to have SPC bound in all states as the leader you are correct. Maybe there’s a ticket on GH, I don’t know.

didibus23:06:57

I'll check

didibus23:06:22

If you do: SPC k . and then SPC, do you see: SPC is undefined ?

ag23:06:31

that is a bug

ag23:06:19

There are ongoing discussions of moving evil-lisp-state into its own layer and making it optional, bringing lispyville to Spacemacs, etc. There isn’t a single best option that would work for everyone. That’s why I personally choose not to worry about it hoping that community will fix it for me. Navigating and manipulating sexps is not a highest priority for me right now though.

didibus23:06:50

Hum... Ya, it would be nice to move it to a layer actually, and give people options there.

didibus23:06:02

So if you prefered cleverparens, lispyville, etc.

didibus23:06:21

But abo-abo is amazing, so if one had to be default, I'd go with his 😛

didibus23:06:36

I love all his packages: Ivy, Avy, Swiper, Counsel, all top notch. Maybe I should try lispy, in his readme, he mentions Vi line editing style isn't very good for Lisp, and I think that's what I'm realizing now. Writing Clojure is my #1 activity so... I'll see

didibus23:06:47

I might just wait for the Spacemacs community as well 😛

aisamu02:06:40

lispyville and lispy have changed my life, even with rough corners! motions that only navigate (e.g. lispyville-forward-sexp bound to L) and motions that navigate leaving you already on insert (`lispyville-backward-up-list` bound to () are very convenient! As a heavy user of SPC k ... mode, I knew I had to do something once I saw a coworker using holy-mode. It was the same feeling I had when I saw someone using emacs while I was still using Atom.