Lecture 3: Editors (vim) (2020)

แชร์
ฝัง

ความคิดเห็น • 378

  • @mnnptl
    @mnnptl 3 ปีที่แล้ว +187

    Me : **Standing alone at a corner in a party**
    Also Me : "They don't know I use vim"

  • @mayankmishra3875
    @mayankmishra3875 2 ปีที่แล้ว +195

    I started using Vim about 4 years ago. I exited today. Thank you, MIT.

    • @CarlosMafla
      @CarlosMafla 2 ปีที่แล้ว +4

      I've been using Vim for more than 10 years and I agree with the lecturer it takes a lifetime to master

    • @fsouza
      @fsouza 2 ปีที่แล้ว +12

      I'm watching this video on emacs and laughing

    • @shchen16
      @shchen16 ปีที่แล้ว +1

      lmao

    • @ghosthunter0950
      @ghosthunter0950 3 หลายเดือนก่อน +1

      @@fsouza bro is living inside emacs. his entire OS is just a bootloader for emacs.

  • @Arkanj3l
    @Arkanj3l 4 ปีที่แล้ว +518

    Learning vim on a chalkboard, the madman

    • @leongurung636
      @leongurung636 3 ปีที่แล้ว +39

      You did not watch full video.

    • @azmigaming1236
      @azmigaming1236 3 ปีที่แล้ว +3

      well, actually he used vim on the laptop started on 9:34

    • @glengonsalves9547
      @glengonsalves9547 2 ปีที่แล้ว

      @@azmigaming1236 just type vimtutor on your terminal

    • @JabYoFace
      @JabYoFace 29 วันที่ผ่านมา

      I actually learned SQL and programming without a pc in school

  • @tvguideondemand
    @tvguideondemand 3 ปีที่แล้ว +7

    Change in character is one command I've been wanting for a while! So happy this exists. I've been learning Vim on and off for the last week and that was one I didn't know about. I'm glad I watched this.

  • @lanavasilieva117
    @lanavasilieva117 4 ปีที่แล้ว +628

    so they are sharing the sacred knowledge on how to exit vim... heretics

    • @vertigo6982
      @vertigo6982 3 ปีที่แล้ว +29

      kids these days dont know how easy they have it...

    • @earvingallardo1391
      @earvingallardo1391 3 ปีที่แล้ว +1

      cynical

    • @pauldwalker
      @pauldwalker 3 ปีที่แล้ว +26

      when I first tried exiting vi, many many many years ago, I got yelled at by the system admins because of all the stopped (^Z) processes on the server taking up all the system memory.
      good times! good times!

    • @jnecaise
      @jnecaise 3 ปีที่แล้ว +11

      How am I supposed to get my random seeds if the new users know how to exit?

    • @djhart25
      @djhart25 3 ปีที่แล้ว +1

      lolll I took far too long switching from nano to vim simply because my brain couldn't remember this

  • @kirk0831
    @kirk0831 4 ปีที่แล้ว +10

    OMG, it is so helpful. Thank you for making this video to help me learn vim.

  • @treeislife
    @treeislife 4 ปีที่แล้ว +61

    In the early 90s, I went to Northeastern U., just across the river from MIT. I took a similar class like this one. The lecturer was also a TA, however, I was taught to use Emacs and brainwashed to think that Emacs was the only thing (and Lisp) a programmer would need. I was too young to know about the Cold War between Vi and Emacs churches.

    • @not_ever
      @not_ever 3 ปีที่แล้ว +18

      How's your pinky? Do you suffer from any permanent long term effects?

    • @BantuTu
      @BantuTu 3 ปีที่แล้ว +3

      What do you use now?

    • @cat-.-
      @cat-.- ปีที่แล้ว

      Lol my cs prof also a emacs advocate. He went to virginia tech

  • @dmsalomon
    @dmsalomon 4 ปีที่แล้ว +15

    Easily the best intro to vim I have ever seen

  • @l0_0l45
    @l0_0l45 4 ปีที่แล้ว +239

    *An entire lecture on VIM! You offended the entire Church Of EMACS!*

    • @zingg7203
      @zingg7203 4 ปีที่แล้ว +6

      Vim Church congrats

    • @blackhatson13
      @blackhatson13 4 ปีที่แล้ว +6

      Need more than one lecture for Emacs 😂

    • @ivansakal1224
      @ivansakal1224 4 ปีที่แล้ว +9

      org mode goes brrrrrrr

    • @avibrarbrar
      @avibrarbrar 4 ปีที่แล้ว +1

      😂😂😂

    • @MrBetaJacques
      @MrBetaJacques 4 ปีที่แล้ว +7

      dudes screw emacs. I will start a bloodfeud with anyone who doesnt love vim

  • @BantuTu
    @BantuTu 4 ปีที่แล้ว +62

    43:50 a prime example of how the most useful things are usually cloaked in an air of nonchalance, even in documentation.

    • @bed7496
      @bed7496 3 ปีที่แล้ว

      repeats the last what again?

    • @BantuTu
      @BantuTu 3 ปีที่แล้ว +4

      @@bed7496 the dot . normal command repeats the last change. The last change is anything you do to change text in the current buffer. Eg,
      Inside vim on a new line:
      ^[iChange^M^[....
      ^M - Enter
      ^[ - Escape
      :help .

    • @bed7496
      @bed7496 3 ปีที่แล้ว

      @@BantuTu much thanks :D

  • @abhishekgururani6993
    @abhishekgururani6993 3 ปีที่แล้ว +1

    Thanks Anish, I got started with vim by watching your tutorials...this video was very useful.

  • @StephenMarkTurner
    @StephenMarkTurner 2 ปีที่แล้ว +1

    Back in the late 90s, the combo of vim plus an identifier lookup (like ctags) worked pretty well.

  • @deadmoroz14
    @deadmoroz14 4 ปีที่แล้ว +415

    Imagine having an editor so intuitive, that you have to watch a lecture in order to use it. Woah!

    • @brenchille
      @brenchille 4 ปีที่แล้ว +8

      deadmoroz14 I don’t like using it but it is nice to have for quick edits from time to time.

    • @deadmoroz14
      @deadmoroz14 4 ปีที่แล้ว +23

      @@brenchille As a noob I am, I prefer nano. This is what really works for quick edits. Vim could be the most powerful editor ever, but its UX and learning curve still frightens me off.

    • @Neonb88
      @Neonb88 4 ปีที่แล้ว +55

      Imagine studying something useful that's also difficult enough that you have to watch a lecture in order to be productive in it as a career. That couldn't possibly be a good life choice

    • @kenjirore1400
      @kenjirore1400 4 ปีที่แล้ว +9

      @@Neonb88Just go through vimtutor

    • @MissourHanzai
      @MissourHanzai 4 ปีที่แล้ว +30

      Oh no I have to spend an hour in vimtutor to start using extremely productive software. Oh the horror I wonder how gimp will ever recover?

  • @trunc8
    @trunc8 4 ปีที่แล้ว +21

    I wish the lecture didn't end XD. Amazing work there!

  • @hamedgholami261
    @hamedgholami261 7 หลายเดือนก่อน

    This guy is a really good teacher. Thanks man, really.

  • @Yotanido
    @Yotanido 4 ปีที่แล้ว +3

    Instead of rebinding caps lock, you can also use C-[ instead of ESC.
    C-c works, too... sort of. There are some caveats with C-c and I wouldn't recommend using it. It breaks some plugins and might require some additional configuration to behave more similar to ESC.

  • @lucianodsb
    @lucianodsb 3 ปีที่แล้ว +4

    vim is that text editor you still learn new stuff over the years and improve, even organically by deducting stuff. Macros, the dot command, :!% command and finally :norm are the ones that got me convinced to use it for everything.

  • @bew
    @bew 4 ปีที่แล้ว +51

    dwi and cw have another difference: cw is a single change, and repeating it with dot (.) will repeat the deletion and the inserted change. While with dwi, the repetition will only repeat the inserted text.

    • @Adolf1Extra
      @Adolf1Extra 4 ปีที่แล้ว +12

      dwi is two commands, insert being the last, so indeed dot only repeats that

    • @arkrusade
      @arkrusade 3 ปีที่แล้ว

      @@Adolf1Extra No. dwi is a delete command, not an insert command. i in this case follows a text object w, meaning word. Thus, this i means inner, not insert

    • @TwistedRetard
      @TwistedRetard 3 ปีที่แล้ว +6

      @@arkrusade you are correct if you use diw (delete inner word) command but the comments here are talking about dwi (delete word insert).

    • @arkrusade
      @arkrusade 3 ปีที่แล้ว +2

      @@TwistedRetard ah you're right. Mb

  • @sirakzeray4543
    @sirakzeray4543 4 ปีที่แล้ว +12

    This course has been great

  • @JohnDegen_aka_Jeehannes
    @JohnDegen_aka_Jeehannes 4 ปีที่แล้ว +9

    A really good intro to my favourite editor! I'm not a programmer, but I've used Vim for some 20 years. This is a comprehensive first dive.

    • @pugboi8017
      @pugboi8017 4 ปีที่แล้ว +3

      John Degen you’re not a programmer? Then what do you use vim for

    • @younlok1081
      @younlok1081 4 ปีที่แล้ว +2

      @@pugboi8017 editing files ??

    • @GOA_Pictures
      @GOA_Pictures 4 ปีที่แล้ว

      @@pugboi8017 same question

    • @vertigo6982
      @vertigo6982 3 ปีที่แล้ว

      @@pugboi8017 He could be a network admin where their life is conf files.

    • @heroe1486
      @heroe1486 2 ปีที่แล้ว

      @@pugboi8017 devops or anything involving lots of typing like journalism or writer

  • @lenpalmeri6228
    @lenpalmeri6228 4 ปีที่แล้ว +18

    I used vi alot in the 80's and 90's. Once you get the hang of it, you can move very fast through code.
    Viva la vi !

  • @mahipalsingh9361
    @mahipalsingh9361 ปีที่แล้ว +6

    No matter for how long you use Vim there is something that you can always learn

  • @Trazynn
    @Trazynn 4 ปีที่แล้ว +18

    Oh boy, this reminds me of Starcraft players having to learn the 'Core' hotkey layout. They learned the game using keys that corresponded to the first letter of the unit ('M' = Marine) until someone figured out that you could just group them all on the left side of the keyboard ('A' =Marine) for faster controls.

    • @parallelsplay855
      @parallelsplay855 2 ปีที่แล้ว

      Huh, i changed all my units and buildings hotkeys to Q W E R S D Z X C, because there're never more than 9 buttons on one panel.

  • @whiskeytuesday
    @whiskeytuesday 3 ปีที่แล้ว +14

    Ctrl-[ is mapped to escape by default in vim, which means no annoying rebinding of esc on your os (leaving capslock free to be mapped to ctrl, as G-d intended.)

    • @damian_madmansnest
      @damian_madmansnest 5 หลายเดือนก่อน

      The whole point of rebinding Caps Lock to Esc is that you have a quick way to escape to normal mode which you do often in vim. C-[ is hell of a convenient combination to press often.
      And i wonder what on earth do you need to remap Caps lock to Ctrl for? Emacs?

  • @ianpan0102
    @ianpan0102 4 ปีที่แล้ว +38

    Even after I jump-shipped to Emacs, I still use the vi-emulation (a.k.a. evil-mode) because tbh, vi-style bindings has just become an intuition for editing code and text.

    • @Hgj-hb9bd
      @Hgj-hb9bd 3 ปีที่แล้ว

      @ianpan870102 I recognize that logo from somewhere. What is it?

    • @onkarkalpavriksha8676
      @onkarkalpavriksha8676 2 ปีที่แล้ว

      I started using vim binding in vscode a month ago. Now it feels unnatural typing without vim. VIM is truly a piece of ART!

  • @user-ij8rc7tr8g
    @user-ij8rc7tr8g 2 หลายเดือนก่อน

    Not my business but there's this lady that always comes late whenever I watch any of these lectures. Thanks for listening .. let me focus.

  • @jackofnotrades15
    @jackofnotrades15 4 ปีที่แล้ว +2

    Great content. Thanks for the upload. Hope this channel continues...😅

  • @fhajji
    @fhajji 3 ปีที่แล้ว +3

    I've learned vi's precursor ed in the Old Days(tm), when Curses terminals weren't common yet. vi, nvi, and then vim, were huge improvements in terms of user-friendliness. But even today, I still use ed (or vim in ex mode, just start vim with its alternate name ex) when dealing with extremely low-bandwidth or high-latency connections. Configuring those remote machines with ed/ex is extremely snappy, compared to anything fully visual like vim. Oh, and of course sed(1) rules as well. This may seem like a very exotic use of vim, but hey, thank $DEITY that ed/ex mode is still around. Great to see a vim lecture on TH-cam in 2020.

  • @ziakhalid5904
    @ziakhalid5904 3 ปีที่แล้ว +1

    Thanks a lot, it helped me a lot learning Vim.

  • @anderjgs1
    @anderjgs1 3 ปีที่แล้ว +1

    Great content, nice explanations,thanks.

  • @CaptainAardvaark
    @CaptainAardvaark 3 ปีที่แล้ว +2

    Welcome to the learning cliff! And a lifetime of configuring your own personal ultimate config.

  • @giant3909
    @giant3909 4 ปีที่แล้ว +29

    Vim emulation with bindings in favorite IDEs is a really good thing. It's the best of both worlds, you have all the powerful abilities of Vim and the great tools of you IDE. I've been running like that for 2 years and it's great.
    I also recommend using vimium for chrome and firefox. It has a lot of powerful vim commands and makes your navigation smoother.

    • @humm535
      @humm535 4 ปีที่แล้ว +3

      It gives you the bad parts of your IDE (namely the IDE itself) and close to nothing of Vim except some keybindings and modal editing.

    • @user-tf5bs6de6z
      @user-tf5bs6de6z 4 ปีที่แล้ว

      There're most of languages have autocompletion in Vim (that means "power" from Latin). I use Vim for R and .netcore development. U must to trying "Vimium C" fork from one chinese man with many extended functions such as dark mode for Vomni, close tabs / cleaning history from Vomnibar, same Vimium navigation in PDF. But in Chrome not read headers of Tabs sleeping by TabSuspender.

    • @TehGettinq
      @TehGettinq 4 ปีที่แล้ว +1

      That defeats the purpose of staying in your terminal. Just use nvim + tmux and take a few hours to configure your nvim properly.

    • @heroe1486
      @heroe1486 2 ปีที่แล้ว

      @@TehGettinq Or just use a tiling window manager if you aim to have a keyboard driven experience and ditch tmux ( unless you need sessions and other non tiling related stuff )

  • @severgun
    @severgun ปีที่แล้ว

    vim have normal mode not because "this is whole new world and programing language", but just more pragmatic reason. There is not enough hotkeys(reasonably ergonomic hotkeys) if you keep letters to work as text input. That is why you need to have modes.

  • @rudhisundar
    @rudhisundar 4 ปีที่แล้ว +2

    Thanks, I still learned some more tricks! H, L, M: those are great! And also for "o" command.

    • @pauldwalker
      @pauldwalker 3 ปีที่แล้ว

      after 30 years, I am still learning vi/vim tricks.

  • @yihanxiao175
    @yihanxiao175 3 ปีที่แล้ว

    Simply great!

  • @RushilKasetty
    @RushilKasetty 4 ปีที่แล้ว +30

    Ah, this class looks great. We have a class like this at my university, it's called Computer Science Pragmatics.

  • @orlevitas2944
    @orlevitas2944 3 ปีที่แล้ว +3

    Great lecture!
    what software you used to show the key stroke on screen?

    • @marcorieser
      @marcorieser 3 ปีที่แล้ว +2

      Looks like KeyCastr

  • @mohamedaminebenmabrouk
    @mohamedaminebenmabrouk 4 ปีที่แล้ว +1

    Great Lecture . Thanks ^^

  • @josephmusembi4391
    @josephmusembi4391 2 ปีที่แล้ว

    Very informative. Thanks a lot.

  • @MichaelS-em8id
    @MichaelS-em8id 4 ปีที่แล้ว +12

    i think vim is absolutely insane for efficiency after watching, i always found it cumbersome switching windows to go from terminal to vs code. i think i'll actually go through the growing pains of learning the basic commands to navigate through my code.

    • @bepd
      @bepd 4 ปีที่แล้ว +7

      vscode has a built-in terminal you can jump to with ctrl+`

    • @artemkashkou274
      @artemkashkou274 4 ปีที่แล้ว +7

      It's not insane! If we look just at the side of coding apps then IDEs (from jetbrains for example) can give u a pretty good efficiency. Sometimes people learn vim + fast typing then they think that they are superefficient but the same time everything they do is just playing the fucking piano on a keyboard

    • @TehGettinq
      @TehGettinq 4 ปีที่แล้ว

      @@bepd a better option is to simply use tmux.

    • @daleowens7695
      @daleowens7695 3 ปีที่แล้ว +2

      Command mode also gives you shell access, eg :!ls. Adding the '!' to anything in command mode causes VIM to shell out. I get a lot of mileage from '!' and ctrl-z and fg when going back and forth of VIM and the shell.

    • @coo463
      @coo463 3 ปีที่แล้ว +2

      @@bepd to do this in vim use :term
      But there are other options that also work like using a manager like tmux or as somebody said bellow using ctrl-z and fg. Or opening anther tab. Each method is nice in its own way.

  • @daya455
    @daya455 4 ปีที่แล้ว

    Great class. Thanks.

  • @ItzGanked
    @ItzGanked ปีที่แล้ว

    should I force myself to go through the pain of getting the muscle memory of all these commands or tailoring it to my needs or just be left curve vs code user?

  • @marksmod
    @marksmod 4 ปีที่แล้ว

    does someone know if one can map caps-lock+key (for example caps-lock+"f") to Escape, without X11 keyboard shenanigans (see sidenote at bottom of post)? That is, directly in vim or emacs?
    [sidenote] (you can set caps-lock to mod4 and then map the mod4 level to certain keys, but for who knows why not to escape and other special characters. I use a programmable keyboard, a vortex keyboard, to map Caps-lock+"a" to mod4+ctrl, leaving all other keybindings still intact, so for example if you bind mod4+l to left-arrow key, and then press mod4+"a"+"l" at the same time (not a chord) then it would be synonymous to pressing ctrl+"left key", which is, in my opinion often times faster than allot of the vim or emacs chords. I also bind mod4+"x" and mod4+"c" to "end" and "home" keys. Oh, and things like Shift+mod4+"a"+"l" are also possible which would be synonymous to Shift+ctrl+"left arrow". This alone enhances "edit mode" for me considerably, though it doesn't quite suffice for moving very quickly between parts in a single document, language dependent )

    • @TehGettinq
      @TehGettinq 4 ปีที่แล้ว

      Idk if that will help you, but on ubuntu in the settings theres a one click option to literally remap escape to caps lock. Its not a vim thing in this case but a distro thing, they put it by default because they know that the escape key is far.
      Btw for vim you can use ctrl [ (thats the same as escape and thats the most "vim thing" to do to) but i find having caps lock as escape is nicer, also useful outside of vim.

  • @mingnuili5095
    @mingnuili5095 2 ปีที่แล้ว

    很棒 很有帮助 谢谢你们

  • @mishasawangwan6652
    @mishasawangwan6652 4 ปีที่แล้ว +56

    it’s true: if you know vim well enough, you can edit at the speed at which you think.

    • @TrilokD
      @TrilokD 4 ปีที่แล้ว +5

      Actually you can edit at the speed at how fast you think but your typing speed just has to compliment it, so, I can do it. ¯\_(ツ)_/¯

    • @KieranDevvs
      @KieranDevvs 3 ปีที่แล้ว +2

      @@TrilokD By that logic, you don't need Vim, as long as your typing speed is fast enough, MS Notepad can achieve the same thing.

    • @TrilokD
      @TrilokD 3 ปีที่แล้ว

      @@KieranDevvs No mouse ( less joint aches ) and portability are the two main reasons I use vim and to be practical, MS Notepad? Really? Okay, I don't use notepad because it lacks FEW of the features or facilities that Vim provide me.

    • @KieranDevvs
      @KieranDevvs 3 ปีที่แล้ว +1

      @@TrilokD I was being sarcastic, re-read the comment.

    • @TrilokD
      @TrilokD 3 ปีที่แล้ว

      @@KieranDevvs 👍

  • @Kqzz
    @Kqzz 3 ปีที่แล้ว +3

    I actually need to learn vim so bad now. I never knew how slow I was using vscode.

  • @rareloto
    @rareloto 3 ปีที่แล้ว +1

    i never knew vim was this powerful
    switching to vim is going to be exciting

    • @atidyshirt
      @atidyshirt 2 ปีที่แล้ว +1

      Would like to hear an update on this

    • @I_SEE_RED
      @I_SEE_RED 2 ปีที่แล้ว

      Update?

    • @Kokurorokuko
      @Kokurorokuko หลายเดือนก่อน

      he's dead

  • @Praveenkumar-vg3pn
    @Praveenkumar-vg3pn 3 ปีที่แล้ว

    nice explanations . thanks!

  • @orlevitas2944
    @orlevitas2944 3 ปีที่แล้ว

    Great lecture!
    Could you please give a link to the to the survey in stackoverflow on VIM (3:49)

    • @swapnilg.5996
      @swapnilg.5996 3 ปีที่แล้ว

      it is available in the course notes : missing.csail.mit.edu/2020/editors/

  • @tomifg
    @tomifg 3 ปีที่แล้ว

    How satisfying is that clean chalckboard

  • @user-ww2lc1yo9c
    @user-ww2lc1yo9c ปีที่แล้ว

    I still do not fully understand if I should consider picking up Vim. I am a hardware engineer and mostly write VHDL.

  • @alandmunk3h
    @alandmunk3h 3 ปีที่แล้ว

    How do I move the cursor to the left when in insert mode, if I have used the advised ~/.vimrc which disables the cursor keys.

    • @DutchFakeTuber
      @DutchFakeTuber 3 ปีที่แล้ว

      At the bottom of the ~/.vimrc file you can find the lines that start with inoremap. Simply remove these lines (or mark them as comments) and you should be good to go! In normal mode however, the blocking of the arrow keys still persists.

    • @Marshblocker
      @Marshblocker ปีที่แล้ว

      @@DutchFakeTuber Is it bad practice to use arrow keys even in insert mode?

  • @its1110
    @its1110 3 ปีที่แล้ว

    Yep, Emacs does more. But how often do you need those bits.
    Vi(m) is just a superb middle-of-the-road. Better than middle-of-the-road.
    I don't even use half of what it can do and it is grand.

    • @heroe1486
      @heroe1486 2 ปีที่แล้ว

      Emacs isn't a text editor, it's a full distribution that can even kinda replace your window manager on Linux, that's like comparing a car seat to an entire car

  • @smithwill9952
    @smithwill9952 4 ปีที่แล้ว +3

    Like blackboard and chalk. Sound like my old school. NO Powerpoint, feeling comfortable!

    • @vertigo6982
      @vertigo6982 3 ปีที่แล้ว

      I was hoping for a filmstrip with guys from the 80s with neckbeards.

  • @auricom242
    @auricom242 3 ปีที่แล้ว +8

    I'm rolling on the floor because of that one guy taking notes on docs/word about a vim lecture.
    And no, i'm not laughing at him, i laugh at the irony.

    • @heroe1486
      @heroe1486 2 ปีที่แล้ว +1

      And most of them are certainly on a Mac or Windows using floating windows manager while learning how to get fast with the keyboard using vim, total nonsense, or how to do a marathon while eating McDonald's

  • @badassnamed8007
    @badassnamed8007 4 ปีที่แล้ว +1

    37:33
    I still don't get it, how to shift from .md to (.py and shell)

    • @sebkoller
      @sebkoller 4 ปีที่แล้ว

      He uses tmux, a terminal multiplexer

    • @badassnamed8007
      @badassnamed8007 4 ปีที่แล้ว

      @@sebkoller
      thanks, dude

  • @daleowens7695
    @daleowens7695 3 ปีที่แล้ว +1

    Even if you decide not to use VIM, learning the navigation keybindings are still pretty useful. I suppose more accurately I could say ex-normal mode is what I'm talking about here. Off the top of my head the less, man pages, git log output programs support VIM navigation bindings including search, eg. '/' or '?'. I'm sure I'm leaving out dozens of programs. Pretty much most Linux tui programs support VIM style navigation.

    • @daleowens7695
      @daleowens7695 3 ปีที่แล้ว

      Not technically related, but hopefully some newbee would find this helpful; Vim help works with "tags" eg ctrl-] and ctrl-t

    • @daleowens7695
      @daleowens7695 3 ปีที่แล้ว

      AND..... All VIM beginners should begin with $vimtutor

    • @daleowens7695
      @daleowens7695 3 ปีที่แล้ว

      Reducing the key repeat on hold timeout and increasing the key repeat rate is highly recommended to get faster scrolling.

  • @nitc9242
    @nitc9242 4 ปีที่แล้ว +17

    Wish my cs professor taught like this.

    • @abhisheksah
      @abhisheksah 4 ปีที่แล้ว

      Donald J. Trump they teach like my school teacher

  • @tanveeralam3261
    @tanveeralam3261 3 ปีที่แล้ว

    How to navigate through tab in vim?

  • @chudq
    @chudq 4 ปีที่แล้ว

    Not sure in the last part of python code, 42:38, the line numbers are not in sequential order? and 11 is off to the edge of left side.

    • @coo463
      @coo463 3 ปีที่แล้ว +2

      He also has relative line numbering on. It can be useful for moving around. Only the line he is on shows the actual line number the others count up and down from that.

  • @tempvariable
    @tempvariable 3 ปีที่แล้ว

    Thank you !

  • @chienoong4179
    @chienoong4179 2 ปีที่แล้ว +1

    My god, until now, this is the holy video let me run speed at x1.0, even slower. Respect!
    BTW, anyone know how to record key stroke on video above on Linux (except Keymon & screenkey) ? Thank you very much.

  • @doplydo-6623
    @doplydo-6623 ปีที่แล้ว

    How could I work on Jupyter Notebooks in a command line fashion ?

  • @GlobalYoung7
    @GlobalYoung7 2 ปีที่แล้ว

    Thank you 🙏

  • @Paretozen
    @Paretozen 4 ปีที่แล้ว +1

    vim is life!

  • @SanjitKumar-kh1hj
    @SanjitKumar-kh1hj 4 ปีที่แล้ว +1

    The guy sounds super polite

  • @abhijeetsingh2933
    @abhijeetsingh2933 3 ปีที่แล้ว

    how to save vimrc ? question 2 of exercise

  • @MrDrewluna
    @MrDrewluna 3 ปีที่แล้ว +13

    if only my professor taught me this thing, i would have gotten to cs much earlier.
    my professor taught us html using .txt file , just changing the ext. name

    • @willd0g
      @willd0g 3 ปีที่แล้ว

      Geeez I would have never picked up programming then haha

  • @Skiamakhos
    @Skiamakhos ปีที่แล้ว

    What's the difference between words and WORDS forward though?

  • @bhavinmoriya9216
    @bhavinmoriya9216 3 ปีที่แล้ว

    could I set up auto complete?

  • @abdoulayebalde2139
    @abdoulayebalde2139 3 ปีที่แล้ว

    Very nice lecture ☺

  • @ajayrajan8882
    @ajayrajan8882 3 ปีที่แล้ว +1

    To save and quit simultaneously you can ESC - > :wq

    • @pablopavan2585
      @pablopavan2585 3 ปีที่แล้ว +1

      Shift+zz is more easy

    • @XGD5layer
      @XGD5layer 3 ปีที่แล้ว +1

      :x works too

  • @aa664_
    @aa664_ 4 ปีที่แล้ว +4

    love the sound of chalk.

  • @prakash.vishwakarma
    @prakash.vishwakarma ปีที่แล้ว

    Fantastic vdieo!

  • @zaheeruddinfaiz7064
    @zaheeruddinfaiz7064 2 ปีที่แล้ว

    Dear lecturers, can we get Missing Semester 2021?
    Thanks

  • @SirLightfire
    @SirLightfire 3 ปีที่แล้ว

    32:19, "And that can select rectangular blocks of text. So I bet this is something your old editor couldn't do"
    Actually, vscode has that (in two variants). Holding down the middle mouse button allows for rectangular block select, and `ctrl + shift + alt + arrow key` is a multicursor select (not sure that's a default keybinding).
    Multicursor select is really useful, because you can edit multiple lines at once. I find it really useful for editing parameters to repeated function calls, or lining up code vertically

    • @jeannepindar5672
      @jeannepindar5672 3 ปีที่แล้ว

      Notepad++ can also select blocks like that, using alt-left mousebutton

  • @jinxscript
    @jinxscript 4 ปีที่แล้ว +2

    Notepad all the way 💆.

  • @ashishlal5911
    @ashishlal5911 2 ปีที่แล้ว +3

    47:23 The chad in the front row is having the time of his life.

  • @gokukakarot6323
    @gokukakarot6323 3 ปีที่แล้ว +1

    Surprise, youtube forward and rewind keybindings are j and l and k for pause

  • @astropgn
    @astropgn 4 ปีที่แล้ว +8

    I am of the opinion that the editor matter less than what he conveyed at the beginning of this lecture.
    One thing is to try to write code in programs that have very few features. Another thing is to compare full feature editing tools tuned to the sole purpose of writing code. Yeah, efficient people who uses VIM do it very efficiently... so as efficient people writing in visual studio or their favorite IDE. I didn't buy the argument that at 20 hours will get the same speed and then forward you will see improvement. We see improvements on every tool we have expertise.
    The one argument in favor of vim, in my opinion, is to be able to efficiently work when you cannot control the environment. If you write a lot of code remotely on the cloud, for example, or if you have to access someone else's computer but they don't have the software you use. Otherwise, you can get the same level of optimization with any other editor. Whenever I see someone saying that it is inherently more efficient and practical to use vi, I think it is just confirmation bias .

    • @TehGettinq
      @TehGettinq 4 ปีที่แล้ว +1

      You will definitely edit text way faster in vim/nvim than in any other editor/ide. Its not even close to being comparable. Does it matter? probably not really.

    • @astropgn
      @astropgn 4 ปีที่แล้ว +5

      ​@@TehGettinq I don't think it is an easy statement to accept. First, people can get very proficient with their set of tools. Blind people using assistive aids can navigate through their phones as fast as non blind people for example. So it could be, at least theoretically, that very proficient vim users do as well as an equivalent non vim user that are also experienced users of their set of tools. Hard to know for sure, but also hard to deny it as well. It is hard even to test this. Yeah, one can show a workflow where vim is incredibly faster than any other method... But nitpicking a couple or dozen of cases while ignoring the entire universe of cases the industry demands does not prove anything.
      Another way to think about it is that the market tends towards efficiency of resources. If vim was really that much better at delivering productivity, the market would tend to make non vim editors obsolete (no company uses punch cards anymore). This does not happen. What we see is a spectrum of tools used by a spectrum of users. This makes me believe two things: First, many of these tools could each one be better at specific set of tasks, but none being better overall, and second, the cost of learning and getting experience with a specific tool might damage productivity as a whole, which makes the industry tends towards an equilibrium between users that use vim and users that don't. This would explain the distribution and there would be no reason to argue in favor of one or another like that. In either case there is no indication of superiority.

    • @Qladstone
      @Qladstone 7 หลายเดือนก่อน

      ​@@TehGettinqYou may be able to edit text faster, but can you do full-scale refactoring with IDE scan for usages, instant creation of getter/setter methods, step-debugging with live evaluation of arbitrary expressions at any line you want, instant scroll of all usages of a method/variable/class, alongside many powerful features of a commercial grade IDE like Intellij IDEA? Maybe you could configure all of those things, but surely not in 20 hours. More like 200 hours of trial and error and frustration probably, and still not get the desired effect. Not to mention you can do pretty much everything in IntelliJ IDEA with keyboard shortcuts. I pretty much never have to touch my mouse when using IntelliJ IDEA.

    • @TehGettinq
      @TehGettinq 7 หลายเดือนก่อน

      @@Qladstone yep, can do.

  • @pauloalmeida2126
    @pauloalmeida2126 ปีที่แล้ว

    That dude doing "programmer's sit up" exercise at 47:22 😂 Jokes aside, that was a phenomenal preso!

  • @RaymondLHW
    @RaymondLHW 4 ปีที่แล้ว +6

    Useful video. I'm recommending to my teenage students ..... though I guess not many of them are interested lol

    • @LHAnthony
      @LHAnthony 3 ปีที่แล้ว +2

      Some might eventually start using it. it took me YEARS of infrequent use to start using it more frequently

  • @KiraTheUnleashed
    @KiraTheUnleashed 4 ปีที่แล้ว

    Do you use vim for java development as well ?

    • @ashrasmun1
      @ashrasmun1 4 ปีที่แล้ว +5

      that sounds like masochism tbh, doesn't eclipse have vim plugin?

    • @humm535
      @humm535 4 ปีที่แล้ว +5

      Java sucks, but yes, Vim for everything!

    • @user-tf5bs6de6z
      @user-tf5bs6de6z 4 ปีที่แล้ว

      It's ironically to dev on Java, the fattest language/VM, with the most minimalistic text editor.

    • @humm535
      @humm535 4 ปีที่แล้ว

      @@user-tf5bs6de6z Vim is by far not the most minimalist text editor; Vim is a very big one. Smaller text editors are, for example, ed(1), ex(1) and sam(1). Vim has stuff like many built-in features and plugins, including tabs&splits, a built-in terminal emulator, syntax highlighting, GDB integration, sessions, an own scripting language, etc.

    • @Al-gc9ul
      @Al-gc9ul 4 ปีที่แล้ว +4

      I use Vim for everything except Java and Scala. For those, nothing beats Jetbrains Intellij IDEA. It also comes with Vim bindings, though I find them not that productive.

  • @ShaileshDagar
    @ShaileshDagar ปีที่แล้ว

    A fun lecture.

  • @jeetadityachatterjee6995
    @jeetadityachatterjee6995 4 ปีที่แล้ว +11

    You use different programs to write essays and code?
    This was brought to you by the Emacs gang

    • @not_ever
      @not_ever 3 ปีที่แล้ว +2

      No I use vim for both...

  • @adriansrfr
    @adriansrfr 4 ปีที่แล้ว

    How are c and d analogs?

    • @ankushmenat
      @ankushmenat 3 ปีที่แล้ว +1

      c - change
      d - delete
      Change does delete and puts in insert mode.
      Both modify text in conjunction with movement you provide.

  • @TheMrGoodkind
    @TheMrGoodkind 4 ปีที่แล้ว

    Is there a succinct cheat sheet of all of this?

  • @archibaldchain1204
    @archibaldchain1204 4 ปีที่แล้ว

    Is this course for first-year cs students?

    • @netbotcl586
      @netbotcl586 4 ปีที่แล้ว +1

      yes, it is pretty suitable

    • @TheTurtleOfGods
      @TheTurtleOfGods 4 ปีที่แล้ว +2

      no it's for your mom on youtube

  • @uzald
    @uzald 3 ปีที่แล้ว

    Man I was missing out

  • @androidemulator6034
    @androidemulator6034 3 ปีที่แล้ว

    how to show the key presses like yours

    • @MissingSemester
      @MissingSemester  3 ปีที่แล้ว

      Anish is using KeyCastr (github.com/keycastr/keycastr)

  • @EliteTester
    @EliteTester 3 ปีที่แล้ว +5

    lmao he had anti-arrow key keybinds in insert mode

  • @jayanths1221
    @jayanths1221 4 ปีที่แล้ว +1

    Honest question, is there any reason one would want to use Vim over a more intuitive and less complicated text editor like VS Code?

    • @RohitSharma-ji2qh
      @RohitSharma-ji2qh 4 ปีที่แล้ว +1

      Sometimes, you work on big projects when there are 100's of gateways, services running on several servers. All you have Linux terminals to change the shell scripts on those servers. That's where vim comes to rescue.

    • @LesterFD
      @LesterFD 4 ปีที่แล้ว +1

      When you log into server systems with ssh, there is no vs code installed ..

    • @byakka
      @byakka 4 ปีที่แล้ว

      Yes. Vim minimizes the time between realizing what you have to change in the text and having it done.
      When you ‘get’ vim you start looking at your edits as precise tactical actions. You become confident knowing that the changes you’ve made are exactly what you had in mind.
      Next time you mash the same keys a few times to put your cursor where it needs to be or reach for the mouse to select precisely the portion of the text you need to overwrite know that vim would almost certainly give you a more efficient approach of making the same change.

    • @antoniodosreisfeitosaneto7553
      @antoniodosreisfeitosaneto7553 3 ปีที่แล้ว

      VS Code has vi emulators.
      One reason I believe is the plain existence of the default "normal" mode of vi: the browsing mode being the default. I use vi, VS Code, Visual Studio and Intellij Idea for many reasons. Sometimes in the same day. And today is normal to have many --- really many --- files open at the same time and the way all these modern editors do is that if you press a key it goes into your file. Period. File is changed. And many times a file gets changed by mistake, because I just typed in the wrong window. Sometimes it goes up to git repositories :). And there is no easy way to protect a file. It is easy when you are just reviewing a file for some reason, a demo, a conference maybe, and the file gets changed by mistake. Programmers not always want to change a file. Other thing a miss in the other editors is the Z commands, for precise cursor positioning.
      When looking up for a string just to key in /string the cursor goes to the point. Then z- and the line is the last on screen, Z. it goes to the middle, Z enter and the text scrolls so the line is the first on screen.

    • @heroe1486
      @heroe1486 2 ปีที่แล้ว

      Watch the video

  • @leonardopikachu343
    @leonardopikachu343 4 ปีที่แล้ว +1

    Alright, i still don’t understand why this will make me more efficient editing code, compared to, say, sublime.... or compared to using a mouse..... i get it if you are in a Linux system and vim is the only editor available... but if you are using a Mac or windows machine, why vim?

    • @rhaeyx1076
      @rhaeyx1076 4 ปีที่แล้ว

      In my experience, using vim with touch typing would increase your efficiency by a lot. It takes time to get used to it though. But as you spend more time programming, you get kind of annoyed when you need to reach for your mouse or the arrow keys to select something a few lines above, because with vim you can just switch to visual mode and use the hjkl keys to navigate which are keys that are already near your fingers.

    • @Duiker36
      @Duiker36 3 ปีที่แล้ว +6

      Tbh, the differential isn't worth it. Vi users tout the "code as fast as you think" bit as a selling point, but the truth is that most programmers need to learn to think and type slower, not faster. The real value of Vi (or Emacs or Nano) is that virtually every standard server will have it. Pushing mouse inputs through an ssh tunnel to the other side of the world is inefficient at best, and the weight of a graphical interface makes it non-ideal.
      And even that is less and less of an issue, because editing a file on a server probably suggests you're doing something wrong, and as the industry's standards have improved, the need is just rarer and rarer. I personally use vim because that used to be a real concern (a company I used to work at preferred us all work off development environments located on company servers, so you'd have to ssh in to do anything to begin with), and now it's just a habit.
      The real takeaway that I feel this class didn't advocate strongly enough for is this: pick your tool, and learn it well. If it's vim, great. If it's vscode or intellij, great. Learn its quirks, how it thinks, why it makes what choices it does, how to get it to do all sorts of stuff. And also learn its limitations. Vim will always be terrible with a visual programming language, for example. But the point is that, if a tool is in your toolbox, be good at the tool. But pick one. It doesn't have to be the best. It just has to be _your_ best.

    • @leonardopikachu343
      @leonardopikachu343 3 ปีที่แล้ว +1

      Michael Chui that makes a lot of sense. appreciate your reply, big time!

    • @daleowens7695
      @daleowens7695 3 ปีที่แล้ว

      @@Duiker36 Most Linux distros I've encountered don't have emacs installed by default. I could be wrong, but I seem to recall needing to install it whenever I've wanted to use it.

    • @coo463
      @coo463 3 ปีที่แล้ว

      As you learn more, there are things that are far more efficient in vim, Sorting code, putting variable s into columns, removing duplicate lines, recording macros and say a couple keystrokes to repeat that macro a thousand times. Plus most text editors don't have a dictionary built in, the ability to add a thesaurus, there are allot of things that other editors just don't do well, or at all.
      But it depends on how somebody uses it, if they use it like a regular text editor and don't learn the features, there probably won't be much benefit.

  • @AlexMoreno-zj7po
    @AlexMoreno-zj7po ปีที่แล้ว +1

    So I guess I won't use Vim, since I can't really touch type lol

  • @martinprochazka3714
    @martinprochazka3714 3 ปีที่แล้ว

    Came here for my daily dose of Nano users' tears, left with my mind blown upon discovering "dot" command.

  • @DevilHell97
    @DevilHell97 4 ปีที่แล้ว +19

    "Vim is a powerful text editor"

    • @zingg7203
      @zingg7203 4 ปีที่แล้ว +5

      The most powerful text editor ❤️

    • @james--p
      @james--p 4 ปีที่แล้ว +4

      @@zingg7203 Emacs wants to know your location

  • @abhrantapanigrahi3475
    @abhrantapanigrahi3475 3 ปีที่แล้ว

    Why vim and why not vscode or sublime ?

    • @aishahale5504
      @aishahale5504 3 ปีที่แล้ว

      Cause its fast also you can use a vim plugin in vs code, if you are just starting.

    • @achimwasp
      @achimwasp 3 ปีที่แล้ว

      VS Code with Vim extension is a good compromise.

  • @DotYT
    @DotYT 3 ปีที่แล้ว

    i always close my terminal and lose work bc i have no idea how to exit vim lol

  • @dobriyzhuk9661
    @dobriyzhuk9661 4 ปีที่แล้ว +1

    What vim plugins he used? Looks very nice

    • @MissingSemester
      @MissingSemester  4 ปีที่แล้ว +2

      Full list here: github.com/anishathalye/dotfiles/tree/master/vim/pack/vendor/start

    • @daleowens7695
      @daleowens7695 3 ปีที่แล้ว

      @@MissingSemester This is an interesting design. I will definitely go through this. What is dotbot. Is it just some custom python and shell that puts stuff where it needs to go? Is it something you've rolled through the years? Pretty interesting at first blush.

  • @NoEgg4u
    @NoEgg4u 3 ปีที่แล้ว +4

    Real Linux people edit files via the "ed" editor.
    ;-)

    • @StuxNETozor
      @StuxNETozor 3 ปีที่แล้ว

      0
      ?
      ?
      ?

    • @nicolareiman9687
      @nicolareiman9687 3 ปีที่แล้ว +1

      real linux programmers write to a file using a C source code.