Fork me on GitHub
#spacemacs
<
2019-06-06
>
practicalli-johnny00:06:34

Ah, it seems I just close the buffer. I didnt notice a new buffer had been opened when using sudo-edit. Thats quite neat, but surprised I couldn't find any docs about it (or am just having a bad search day)

dangercoder07:06:16

Is it worth changing to holy mode? Feels like it would be better to use Emacs bindings for Clojure since it's a Lisp. Whats your thoughts about this?

mccraigmccraig08:06:59

i use holy mode, but only 'cos i've always used emacs, i don't think it matters much which you use

👍 4
practicalli-johnny11:06:27

@jarvinenemil I started with holy mode as I was using Emacs before Spacemacs. I gave Evil a try one weekend after learning about multi-modal editing and am very happy I did. Evil mode makes editing and manipulating code so much quicker. I find I can also type a lot quicker, for longer and will no risk of RSI with Evil mode. This is in part because I never need to move my hands around to do the Emacs key combo's (like C-x C-e), I can just use individual key presses (like , e e). I find this much faster and requires less conscious thought, so I can focus on the code I am writing. I would struggle to go back to Holy mode now, it would make me feel much less productive. I don't understand the correlation between the key bindings and the configuration language of Emacs (elisp). Am I missing something? Can you enlighten me?

ag17:06:16

most important default Emacs bindings like <C-l> are still available in evil-mode. But things like ex-commands aren’t available in holy-mode.

didibus17:06:02

Something important to keep in mind, Emacs bindings aren't a real thing. Emacs has almost no default bindings. The set of things already bound is very small. Thus it is better to think of Holy mode as custom bindings, because you'll probably want to customize a lot of the bindings and non modal editing. Where as Evil offers modal editing and the Vim bindings, and there are a lot of them, almost everything is already bound to some Vim binding.

didibus17:06:51

Also, Spacemacs has its own set of bindings. It is fair to call them the Spacemacs bindings. Those are there whether you are in Holy or Evil mode and they are awesome. They are mnemonic, and easy on your hands.

didibus17:06:42

They either all begin with Space or with Alt+m (aka M-m) depending if you are in Evil or Holy mode, but apart for the leader key, they are the same.

ag17:06:41

@didibus Emacs has quite a few default bindings, but they are very primitive (compared to Vim bindings) - C-f/C-b, C-e/C-a, etc. it’s useful to know them too. They work not only in Emacs.

didibus17:06:03

So I'd say, definitely get acquainted with the Spacemacs bindings, but Holy vs Evil doesn't matter for these. Where evil + holy matter is first, do you like modal editing? I don't for example. And the second is, do you like customizing your bindings to your liking? If so, Holy is the way to go. Otherwise go Evil.

didibus17:06:38

@ag Ya, but there's very little of them. So any serious Emacs user will need to enhance them with custom one, because a lot of the common commands lack a proper binding.

didibus17:06:25

I'm talking editing ones. Also, for most actual commands, the Spacemacs ones are far superior and Spacemacs users probably want to use those instead. So most of the the C-x and C-c command chords are superseded by the Spacemacs bindings.

didibus17:06:59

So for example, what @jr0cket mentions, that's not a fair comparison. In Holy mode, you shouldn't have to use C-x and C-c either for all common cases. You would do M-m or M-Enter.

didibus17:06:21

Which are RSI friendly, due to their use of the thumb.

lread17:06:34

Not directly related, but since we are talking about evil mode, I’m not at a place yet in my emacs/spacemacs journey yet where I can keep my big goofy hands off the mouse and was bothered by how evil mode was behaving when mousing off searches in progress. For details and a solution see https://emacs.stackexchange.com/questions/35946/strange-behaviour-on-evil-delete/48282#48282

lread17:06:31

I started my emacs journey not using evil mode, and found for the first time in my long programming career I was having pain from typing. So I switched to evil mode. For me it works. I also bought an Kinesis Advantage 2 keyboard. Took a bit of getting used to, but also works for me! https://kinesis-ergo.com/shop/advantage2/

didibus17:06:38

I also when I started with Emacs began having pain for the first time. But moving to using the Spacemacs bindings made it go away. It was mostly the use of C-x and C-c which caused it. Also, the second thing was getting used to using the opposite control key. So like you press the right meta or control or shift key if the following letter is on the left side of the keyboard and vice versa. That way combo key presses use both your hands, and don't need them to contort.

didibus17:06:35

So for saving for example, you'd press the right Ctrl key with your right hand, and press x s with your left

didibus17:06:03

It took me maybe a week to adjust.

didibus17:06:11

No more pain since

practicalli-johnny17:06:33

I did get what is referred to as "Emacs pinky", from using keyboard combos a lot. Evil minimising this so much, it made a big difference. And once I learnt the basic Vim approach, getting a Model01 keyboard was a perfect fit https://shop.keyboard.io/

👍 4
lread18:06:22

that looks like a great kb!

kirill.salykin19:06:15

Have the same - pure magic!

lread19:06:06

Don’t get me wrong, I am happy with my kinesis advantage2, but hey I’m not dead, I can still admire a beautiful keyboard.

zane17:06:22

> opposite modifier keys This helped me as well. If you're on a Mac you can use Karabiner-Elements to enforce the practice while you're getting used to it. https://github.com/tekezo/Karabiner-Elements

zane17:06:04

Another thing that helped me was disabling the control keys entirely + using caps lock for left control and return (if used in combination with another key) as right control. (Also achievable with Karabiner-Elements.)

didibus17:06:46

I still think with Spacemacs you don't get the Emacs pinky. So I'm just trying to say for people who aren't super into modal editing like me. The criticism towards Emacs bindings for hand pain I think don't apply to Spacemacs. Obviously, we're all different, but for me, moving from Emacs to Spacemacs Holy mode was enough to make the pain go away. So I wouldn't disqualify that.

zane17:06:16

Glad it worked for you! 🙂

didibus17:06:52

Haha ya I might sound a bit annoying. I do think the beauty of Spacemacs is choice and Evil is great. But I also feel I rarely see anyone really using Holy mode the way I do. Which is that you mainly use Spacemacs bindings with M-m, M-Enter (or M-m-m) as you would in Evil mode use Space and , . And then for what's left of the Ctrl or Shift modifiers like C-g, C-y, C-h, C-e, C-a, etc. You use the opposite modifier. Even then, their usage is much more limited after eliminating C-x and C-e, so depending on your sensitivity you might not even need to use opposite modifier.

zane18:06:16

Not annoying at all. Exuberant.

didibus22:06:04

Hum... that's not a word I think of using often, but I like it. And I'm very much like that Haha, which can be a bit overwhelming to others sometimes ☺️

❤️ 4
practicalli-johnny12:06:01

This is similar to how I used Spacemacs for the first 6 months or so, before I went Evil 🙂

😈 4
didibus17:06:51

Now I have quite a few extra custom bindings, which helps a lot with my productivity. And generally I'm way more productive then my Evil using coworkers.

didibus17:06:48

Don't know how I would fare to a 10year + vim user. But to a 2year+ vim or evil user, I fare quite well.

didibus18:06:12

That said, I'd say it's still worth trying out Evil, just because being able to maneuver your way around Vim is pretty useful. But if like me, you just never come to like the modal editing, Spacemacs offers a nice RSI friendly alternative to Emacs as well.

ag18:06:11

Vim motions aren’t just for modal editing. I use them system-wide - in my browser, in terminal, to change between apps, in my WM, to control music. It allows you to keep your hands in the home row.

jasonjckn05:10:10

finally got around to trying this, very nice! i'm a convert

1
jasonjckn04:10:13

edit with emacs is broken for me, and i followed all the instructions When I hit the hot key, it selects-all the text, and shows the emacs frame , brings it into focus, but no buffer opened.

jasonjckn04:10:35

any suggestions how to debug it? i looked at HS logs, but there wasn't anything helpful.

jasonjckn04:10:19

Beyond this though everything works : )

ag18:10:57

Maybe you're missing hs in the $PATH?

ag18:10:03

Oh wait, maybe spacehammer.el not loaded? Just to clarify, did it break it for you recently, or it's just not working the first time you try?

ag18:10:49

M-x toggle-debug-on-error see maybe something shows up in Messages buffer

ag18:06:53

I’ve been procrastinating a lot. It would be nice to record a screencast that demonstrates the features

lread18:06:13

Hey, cool, I’d watch your screencast to learn more! simple_smile

ag18:06:34

and for any kind of editing of text I of course use Emacs.

zane18:06:19

@ag Oh wow. How did you get Emacs's menubar to match your background like that?

ag18:06:56

I think (add-to-list 'default-frame-alist '(ns-transparent-titlebar . t)) does that

zane18:06:19

Sure does. Thanks!

emilaasa18:06:20

You are my hero @ag!

emilaasa18:06:24

That looks so good

ag18:06:09

Thank you. You are very kind. Feel free to ask me questions or submit suggestions.

emilaasa18:06:30

Not trying to be kind, it just looks very useful hehe 😃

ag18:06:53

Yup, extremely useful for me. I am forced to work on a Mac (at work). Fortunately that thing helps me to stay sane.

emilaasa18:06:09

Yeah I have a similar situation

ag18:06:29

all the tools I need: spell checker, thesaurus, syntax highlighting, etc. is always available no matter in which app I need to type. I can open Chrome/Firefox DevTools and write javascript in emacs then switch back to the browser and execute it

emilaasa18:06:48

Recording a quick screencast with keycaster or similar would be very neat

ag18:06:50

yeah, but as I already stated - I am very, very, very lazy person. I'm so lazy that I don't even want to move my fingers out of the home row... LOL

emilaasa18:06:19

Haha, maybe I can help 😃 I’ll try it out first tho

emilaasa18:06:52

In the last 4 minutes I learned about your project, about fennel and about hammerspoon

emilaasa18:06:56

Pretty excited!

zane18:06:56

Wow. Hammerspoon and Spacehammer are blowing my mind.

lread18:06:37

Agreed! I think @ag might go through extreme efforts stay very lazy. simple_smile

zane18:06:39

It is the Emacs way. 😎

didibus22:06:17

@ag that looks awesome! I think you should credit Spacemacs a lot more though, as far as I know, the idea of a leader key of mnemonically grouped commands which you chord together is a Spacemacs innovation, not a Vim thing. Might be wrong though, but I've never seen that in Vim

ag22:06:28

@didibus no, the idea of changing a leader key came from Vim. I used SPC as my leader key in IntelliJ as well

didibus22:06:54

What's the feature in Vim for it?

didibus22:06:03

I didn't know vim had a leader key

ag22:06:18

It’s been there like forever, by default it’s bound to ,

ag22:06:36

someone long ago figured it can be bound to SPC

didibus22:06:27

What does the comma do?

ag22:06:03

In Spacemacs? It’s a current mode leader

didibus22:06:15

In Vim, you mean \ ?

didibus22:06:11

Also, I'm not sure that counts. I mean, maybe Vi invented the key chords first. Though it could be something even older or Emacs who knows. But the idea to group all commands behind a single one is pretty novel. Vim doesn't do that as far as I know

ag22:06:41

yeah, … right… it’s been long time. By default I think it’s bound to /, most people changed it to ,. It’s become a convention. For a long time it’s been like that, then someone figured it can be bound to SPC

didibus22:06:10

Ya, but I don't know. In Vim, that's just because all other chords are already taken, so if you want to add your own bindings you got to start them out with the leader key

didibus22:06:28

Its a bit like C-x and C-e in Emacs. Meant more for extended binding use

ag22:06:51

Spacevim does similar thing. I think it took over after Spacemacs, but the point is - it was possible to do in Vim before Spacemacs

ag22:06:12

I guess nobody bothered because vimscript is painfully… painfull

didibus22:06:42

Oh, ya. 100%. It was also possible to do it in Emacs since the beginning. But the idea of doing it I feel is novel in itself and I like to give credit to Spacemacs for it

didibus22:06:54

Not that it matters

didibus23:06:13

Actually, I think I read an article that windows kinda did it first 😋, with how all the file menus can be navigated with key chords that start with the Right Alt

didibus23:06:44

But no one seems to use that feature in windows hehe

ag23:06:11

I’m not sure what kind of credit you’re asking for. It’s literally in the name of the project. It’s in the description, the first line of the readme.

didibus23:06:30

Oh, ya sorry, your readme is great

didibus23:06:53

I was responding to the slack message where you said Vim isn't only about modal

didibus23:06:20

So I took it as Vim is also about the Spacemacs style of commands grouped behind the leader key

ag23:06:36

Well, to be fair. Emacs style has been always like “Press C-c six times, then C-x, then tilde”, Vim style from the beginning was and still is focused around h/j/k/l. That’s the main idea - to keep your fingers in the home row

ag23:06:58

I barely touch mouse. I don’t use arrow keys at all

ag23:06:03

Vim is like Lisp. Just like Lisp not a language - it’s an idea. Vim is not an editor - it’s an idea.

ag23:06:48

and as it turned out Emacs can Vim better than anything

ag23:06:58

it Vims better than Vim itself

didibus23:06:24

Ya, but isn't that modal editing? It's that there are operating modes. And depending on the mode, h/j/k/l are rebound to navigation commands or typing characters.

didibus23:06:03

Whereas with Spacemacs concept of leader key, there are no modes. The leader is always available. And all commands are always there, though some can be contextual, but its app context, not user selected mode using a mode toggle button

didibus23:06:29

Anyways, I'm being way too pedantic and dumb here with details 😋

didibus23:06:09

Maybe it is some secret repressed anger balled up from people always wondering why I prefer Holy mode hehe

ag23:06:45

You already using modality, with evil it just goes one level deeper, that’s it

4
didibus23:06:18

Well, I use Holy mode, so no Evil

didibus23:06:28

Well, I do use some evil commands, but not in modal mode

didibus23:06:57

I call them through the Spacemacs leader key

didibus23:06:22

And in Holy, a lot of the evil commands are wrapped so that they put you back in insert mode after. So in Holy mode, you are always in insert mode

ag23:06:10

you’re missing benefits like jumping back and forth quickly (C-o/C-i). Can’t use ex-commands, etc.

ag23:06:47

e.g. with evil I have at least 3 different way to jump to a line: type number, press G, type : then line number, SPC j l

didibus23:06:19

Basically, the difference is that char keys like a, b and c are always mapped to typing the character

didibus23:06:19

And the only way they can be mapped to other things is through some leader keys in a chord, or with a modifier key, or contextually if you are in a special buffer

didibus23:06:19

Not through a "modal state"

didibus23:06:54

I have custom bindings for all that

didibus23:06:08

But also spacemacs

didibus23:06:17

So I can do M-m j l

didibus23:06:36

Though avy mode is what I use most often

ag23:06:16

> I have custom bindings for all that Yeah, that’s my point. Without modality you are forced to keep adding keybindings.

ag23:06:00

but there are only so many top level keybindings you can add

didibus23:06:15

That's where leader key idea of Spacemacs comes in

ag23:06:38

That’s modality

ag23:06:27

give it a try. try vimtutor, try evil-tutor in Spacemacs (I don’t know how good it is though), try playing vimadventures. You’d hate me at the beginning. But if you keep going, eventually you will love it.

didibus23:06:46

I mean, I use Vim to a I'd say between beginner and intermediate level

didibus23:06:59

For when I edit small files or scripts

didibus23:06:11

But ya, maybe I should give it even more of a chance

didibus23:06:33

But when I see my coworkers using Evil or Vim, they always seem so much slower at performing actions then I am

didibus23:06:30

By the way, I don't consider that modality at all. You are still in the same mode, you just have more unique keybindings. Like SPC a a and SPC a b. There is no clash, so no mode is needed

ag23:06:42

it’s not about the productivity (not only about it), it’s also about ergonomics and mnemonics

didibus23:06:10

That's how I use Spacemacs right now. With M-m as the leader. So all SPC commands I use actively. But to start typing, I don't need to change mode. It does mean I use the arrow keys, but since I don't touch type anyways 😋 and that might be my first problem, I tend to rest my hands near the arrow keys anyways

ag23:06:11

> start typing, I don’t need to change mode you think it’s a mental overhead, but once you build a muscle memory around it, it becomes very natural, you won’t even notice it. The benefits exceedingly overweight whatever discomfort you feel at the beginning.

didibus23:06:16

Well, okay, I've never gone as far as moving Esc

didibus23:06:39

And I find that with Esc, I need to move my hands away from the home row even more then for arrow keys

didibus23:06:55

So it neutralizes the benefits of hjkl

ag23:06:11

you have the best of two worlds and you willingly ignoring one of them. I don’t use Esc on my laptop keyboard at all

didibus23:06:32

And in windows, remapping the keys is painful. And also, I'm OCD and hate how my caps lock light would turn on and off all the time if I made it esc

didibus23:06:50

What I need is a Vim Pedal

didibus23:06:59

I'd be down with that

didibus23:06:24

Pedal pressed down = insert mode, when not pressed normal mode

didibus23:06:04

I might actually bite the bullet on one of those for real

didibus23:06:20

What do you remap Escape too?

ag23:06:20

you know about evil-escape-key-sequence and C-[?

didibus23:06:41

What's C-[

ag23:06:53

it’s basically Esc for lazy people

ag23:06:10

or for people with macbook pro with touchbar

ag23:06:55

evil-escape-key-sequence lets you bind a sequence of keys. you can quickly press jk (for example) instead of reaching out for Esc

didibus23:06:35

Okay, I have to say that I do feel I need to give it a better chance. Even if I go back. I need to try it fairly to really.know that I don't prefer it

didibus23:06:56

I might see if I have some time, and switch to Evil mode for a month

didibus23:06:03

Or something like that

ag23:06:34

As I said: Vim is an idea. And it doesn’t look very appealing for uninitiated. But if you give it a leap of faith, use it for a while you will see the benefits.

ag23:06:56

The only true drawback I can think of: if one loses a hand, it probably will be extremely difficult to re-learn. But I think losing a limb by itself kind of a big deal with or without Vim style.

zane23:06:08

I would imagine that modal editing is actually easier if you only have one hand. :thinking_face:

ag23:06:29

I dunno… maybe there’s a secret society of one handed vimmers/evil-mode users?

jasonjckn05:10:10

finally got around to trying this, very nice! i'm a convert

1