Fork me on GitHub
#spacemacs
<
2019-06-07
>
ag00:06:16

and they have their own meetups

bja03:06:59

I broke my arm and didn't have the use of one of my hands for several weeks

bja03:06:03

vim made working possible

bja03:06:40

it was weird to have to think about what I wanted to type instead of just typing it, but vim/ex is well-suited to thoughtful batch-like editing

didibus04:06:06

I think Vim is pretty good for single hand, since commands are mostly chorded

didibus04:06:14

I'm still not really buying into the whole Vim is an idea thing. I feel Vi bindings are a very concrete thing, not really an idea. Though modal editing is an idea, but it also has a very concrete manifestation.

didibus04:06:03

But, I'll refrain from further comments, as only a Vim beginner, maybe I don't have the right to speak more of it... Will be back after a month 😛

practicalli-john12:06:33

Vim is actually a language to think about manipulating text, particularly in Vim normal mode. I am not referring to vimscript, but the language in which you think about manipulating text, using verbs, modifiers and text objects. I didnt really get the benefits of Vim until I started to understand this simple language. I wrote a brief intro to in here along with some Spacemacs specific examples: https://practicalli.github.io/spacemacs/spacemacs-basics/speaking-vim.html

👍 12
prnc14:06:44

I’ve even came across some paper analysing “vim language”, couldn’t find it now, so if someone knows about this do let me know!

didibus20:06:14

An interesting aside, one of my coworker used to be a long time Vimer, like 5+ years. And he switched to Emacs without Evil. His reason is that he told me he was tired of double programming. Having to program the editor with the Vi language and think about how to program Vi to perform the edit he wants, while also having to think about how to program the actual logic of the app he is currently coding for.

ag03:06:39

That sounds very unlikely. If someone uses Vi-motions heavily for prolonged time and even learns advanced commands like “replace inside parens”, they would certainly build a muscle memory and wouldn’t even have to think between switching modes. It becomes like a second nature. Like finishing a sentence with a period, or adding a comma to split it or capitalizing when starting a new one. Vim only feels confusing and slow in the beginning, given enough time it becomes very natural. I remember my colleague’s observation, who never tried Vim or Evil-mode, he said: “it seems you have to press a lot of buttons, sometimes it feels you’re just bashing on keyboard like a two year old, but somehow you are still extremely productive.” Have you ever seen how professional stenographers work? It is possible to adapt their workflow (if the goal is to be extremely fast typist). But when you see the way how it works (for the very first time) - it would probably feel simply insane. It takes long, long time to learn the technique, but there’s no doubt that is awfully fast way of typing. And they don’t need to “think” while typing, right? Only in the beginning, when they are learning. And btw, as far as I know: most pro stenographers do prefer Vim.

ag03:06:05

Human mind is a fascinating thing. When I was a kid we remodeled our kitchen. I don’t remember exact reason but my father moved the light switch onto the other wall. And for almost two years, whenever I enter the kitchen my hand involuntarily would move where the switch used to be, only to find there’s nothing. Honestly that’s why I am highly skeptical if somebody says they used Vim for over 5 years and decided to drop it. This either means: they haven’t used Vim as their primary method (only occasionally), or they only learned very basic motions (never stopped using arrow keys, etc.), or they simply being dishonest.

didibus05:06:20

I don't know. I have no reason to doubt him, but I can't validate. That said, I'm not sure it is only muscle memory. Say you want to navigate to a word, you first need to see how many lines down it is, so that's one extra thing to think about. Even though typing 6j to go down 6 line can be muscle memory. In Emacs, you could just click with the mouse, or you'd use the arrow keys to navigate to it. There's less thinking involved in both, but it could be slower, though mouse can be faster as well depending.

didibus05:06:31

But he might have never used the full power

didibus05:06:47

What would a Vimmer do in that use case?

didibus05:06:01

In Emacs, I use avy-go-to-char

didibus05:06:26

Or I use forward search

didibus05:06:46

I guess you could use forward search in Vim as well. What do you use in such case?

didibus05:06:08

Other then 6j followed by a few w presses?

didibus05:06:32

Say you wanted to go to a word 6 lines down and 4 words from the start of the line?

ag08:06:21

Well, personally I rarely think in terms of the number of lines up and down when having to jump. How would I do it? It depends on the context. Evil (and Vim in general) usually offers multiple ways for any kind of operation; there’s rarely one way. You can use search-forward, if it’s the same word/variable you can just press *, if you can clearly see how many lines down the thing you can type the number and press j, etc., etc. Well, you might say, “what if I like Python way? (there should be one - preferably only one way to do it)“. Wouldn’t be having multiple ways of doing things harmful, confusing, and perhaps counter-productive? Let’s imagine you’re playing a video game. FPS stealth/action-shooter. There’s an enemy in front of you, guarding a strategic entrance. In a somewhat primitive version of the game, you probably would only have a couple of ways of dealing with the guy. Shoot or maybe stab. In a more advanced version, you may have multiple, different ways. And when you are a novice player (in the advanced version), you’d only use something that you know how to do, and it seems obvious to you. The better you become at playing that game, more advanced, more efficient techniques you’d discover. And as the game progresses, it would force you to use your reflexes more and stop thinking about it, just like when you are learning martial arts or a foreign language. You stop thinking about katas and stop pre-translating words in your head before saying them out loud.

ag08:06:48

Vi/Evil is an extremely efficient and awfully gratifying way of dealing with text. But that efficiency does come with a price. It takes time to learn it, takes patience to earn it, takes devotion to master it. And you never will regret the time you spent learning it. Can you imagine Jackie Chan, or Arnold Schwarzenegger, or Michael Phelps, or Sergei Rachmaninov, or Tom Hanks, or Jackson Pollock regretting the time they spent refining their craft? Yes, I just did it. I compared coding with artistry and sport. We deal with text all the time. We see different forms of text all the time. We stare at it, we read it, we write it, we breathe it. That is our job. That is our craft. And if there is a way that lets you be just a bit better, even if the efficiency scientifically have been measured to be around 0.001%, do you really just say “no” to that?

❤️ 4
didibus17:06:35

With Evil you don't use relative line numbers?

didibus17:06:02

All my Vim coworkers use relative lines, so it's easy to know how many lines to "jump" too

didibus17:06:19

By the way, I've started trying Vim more

didibus17:06:36

But funny enough, haven't switched to Evil yet 😋

ag20:06:07

> you don’t use relative line numbers I do. Not very often though. Only when I can quickly scan the area and clearly see how far the thing is. I don’t use line-numbers as a visual guiding tool (unless I am pairing with someone). I never developed precise intuition around “counting” things. It’s quicker for me just to repeat a motion multiple times than visually counting objects and typing numbers. I don’t think I like having my fingers travel up, to reach numbers (even though they are so close). I cannot blindly find them every time. I don’t have num-pad on my keyboard, even If I had, it would probably will be useless for me (I’d like to stay in the home row). I don’t use Function keys, I don’t use Esc (it’s either re-mapped to be close to the thumb or I use alternatives like C-[). I don’t use arrow keys. I rarely touch my trackpad, even though it is literally mounted on my keyboard. I don’t even like having to reach for the Tab (although I always can find it without looking) If it was possible, I would’ve even loved getting rid of Modifier keys as well. Ctrl, Alt, Cmd/Win. Why regular keys can’t work as modifiers? That’d be so nice. That is how lazy I am. And Evil-mode lets me stay lazy. I can precisely select, delete, replace things with extreme efficiency (empirically measured by my own senses) without slightest distraction. I don’t even know how people for example use mouse/trackpad to select things and claim to be very accurate. Also I hate when someone presents something and has to use the mouse. The pointer traveling on a huge projector screen to do basic operations like opening a file, makes me wanna cry.

practicalli-john22:06:37

I only notice I am using vim bindings when I am in other applications and I keep pressing df and it adds the df characters 🙂

☝️ 4
lread23:06:30

There is awesome evil energy in this channel, so I am going to ask a newbie question. I don’t know why, but I find myself surprised, even after much usage, when a char I deleted with x ends up in my copy buffer. It’s like, oh dang, I meant to delete that character but I did not mean to overwrite my copy buffer. What am I missing my evil gurus?

zane23:06:46

This is probably not the best answer, but I find myself using helm-show-kill-ring a lot.

didibus00:06:20

Try pressing "_ first

didibus00:06:30

Works in Vim, not sure about evil

lread00:06:26

oh thanks @U050CT4HR, SPC r y shows kill ring, cool.

lread00:06:48

@U0K064KQV what does "_ do?

didibus00:06:11

It performs the following action on the void register

didibus00:06:23

" is how you specify a register

didibus00:06:30

And _ is the void

lread00:06:42

next level stuff!

didibus00:06:46

So "_x would delete into void

didibus00:06:41

What some people do is create a leader binding for those

didibus00:06:58

Or they replace normal delete with these and make the cut ones with a leader

didibus00:06:55

I think there's also the yank register

didibus00:06:00

Which is 0

didibus00:06:34

So if you yank and then do a bunch of delete operation. You can still paste what you explicitly yanked from register 0 like so "0p

didibus00:06:28

But as the defender of Holy mode, I should encourage you to try Holy mode first. I do think it helps learn Emacs. And maybe later you can switch to Evil? That way you can learn about Kill Ring et all

didibus00:06:51

Others might disagree though

lread00:06:48

I think I prefer evil! Thanks for all the tips!

didibus00:06:21

Kill ring is M-y in Holy.

didibus00:06:26

Just in case 😋

spfeiffer09:06:46

SPC r y. Amazing that one never stops learning.

practicalli-john14:06:13

The develop branch as had a transient state for paste, so you can cycle through the kill ring with j and k. Then it's matters less if you delete...

ag08:06:48

Vi/Evil is an extremely efficient and awfully gratifying way of dealing with text. But that efficiency does come with a price. It takes time to learn it, takes patience to earn it, takes devotion to master it. And you never will regret the time you spent learning it. Can you imagine Jackie Chan, or Arnold Schwarzenegger, or Michael Phelps, or Sergei Rachmaninov, or Tom Hanks, or Jackson Pollock regretting the time they spent refining their craft? Yes, I just did it. I compared coding with artistry and sport. We deal with text all the time. We see different forms of text all the time. We stare at it, we read it, we write it, we breathe it. That is our job. That is our craft. And if there is a way that lets you be just a bit better, even if the efficiency scientifically have been measured to be around 0.001%, do you really just say “no” to that?

❤️ 4