This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-06-07
Channels
- # announcements (12)
- # aws (2)
- # beginners (233)
- # calva (68)
- # cider (23)
- # circleci (5)
- # clj-kondo (40)
- # cljsrn (4)
- # clojars (3)
- # clojure (200)
- # clojure-austin (1)
- # clojure-canada (1)
- # clojure-dev (16)
- # clojure-europe (1)
- # clojure-finland (1)
- # clojure-italy (4)
- # clojure-nl (16)
- # clojure-spec (3)
- # clojure-uk (102)
- # clojurescript (16)
- # cursive (14)
- # datomic (16)
- # figwheel-main (7)
- # graalvm (3)
- # hoplon (37)
- # jackdaw (23)
- # jobs-discuss (24)
- # joker (4)
- # kaocha (6)
- # keechma (64)
- # off-topic (66)
- # parinfer (1)
- # pedestal (7)
- # re-frame (7)
- # reagent (10)
- # reitit (45)
- # rewrite-clj (12)
- # shadow-cljs (1)
- # slack-help (8)
- # spacemacs (55)
- # sql (9)
- # tools-deps (9)
- # vim (7)
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
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.
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 š
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
this is oft linked resource on the topic: https://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118, also this looks like a fairly good intro: http://takac.github.io/2013/01/30/vim-grammar/
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!
maybe wasnāt a paper, a think it was this: https://glts.github.io/2013/04/28/vim-normal-mode-grammar.html !
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.
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.
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.
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.
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.
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?
All my Vim coworkers use relative lines, so it's easy to know how many lines to "jump" too
> 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.
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 š
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?
This is probably not the best answer, but I find myself using helm-show-kill-ring
a lot.
oh thanks @U050CT4HR, SPC r y
shows kill ring, cool.
@U0K064KQV what does "_
do?
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
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
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...
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?