7 Vim Tips and Tricks I Wish I Learned Sooner

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 พ.ย. 2024

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

  • @niftysweater
    @niftysweater 11 วันที่ผ่านมา +11

    I've been using Vim for 3 years and had no about :read or moving the front of visual selection. Thanks g

    • @marco_peluso
      @marco_peluso  11 วันที่ผ่านมา +3

      It's amazing how much there is to learn in Vim even after years of use! Glad you found it helpful!

    • @vikingthedude
      @vikingthedude 9 วันที่ผ่านมา

      g is OP

    • @marco_peluso
      @marco_peluso  9 วันที่ผ่านมา

      @ It really is! But I had to leave some more tips for a follow up video 😜

  • @ivanheffner2587
    @ivanheffner2587 7 วันที่ผ่านมา +7

    :read (can be shortcut to :r ) puts the text of the read file below the current line. You can use :0r to put the contents above the current line. This is helpful if you are reading some script with a shebang line that needs to be the first line.

    • @marco_peluso
      @marco_peluso  7 วันที่ผ่านมา

      I knew about `:r` but actually not about `:0r`. Another thing I wish I learned sooner! 😉 Thanks for your input!

  • @davidallred991
    @davidallred991 9 วันที่ผ่านมา +9

    Nice I learned a few new things. Also, a minor correction and the only reason I mention it is because I think it makes a difference for remembering its purpose if newbies are watching. The "a" in commands like "daw" or "caw" stands for "around" meaning it will grab the outer bounds. Really helpful to remember for example if you need to grab the quotes or brackets along with the text.
    so if you need to grab "text in quotes" the command va" will visually select the text and the quotes included where as let's say ci" will just change the text between the quotes but not include them.

    • @marco_peluso
      @marco_peluso  9 วันที่ผ่านมา

      @@davidallred991 Glad you learned something new 🥳 You’re actually the second person to mention this in the comments. I actually find "around" to be a better mnemonic myself. And also thanks for the helpful further explanation 😎 I totally agree with you, I should have called it “around” in the video, especially for people new to Vim. I was reading from the NeoVim docs in the video, though. There it is called “a word”. You can also have a look at the Vim docs, that seem to also have it defined as “a word”. See vimdoc.sourceforge.net/htmldoc/usr_04.html#04.8

  • @modernkennnern
    @modernkennnern 4 วันที่ผ่านมา +1

    I regularly use diw, daw, ciw, caw etc, but didn't realize dw, cw etc existed lol.. i normally just use dt, ct etc, which mostly works 😅

  • @JamesKaupert
    @JamesKaupert 11 วันที่ผ่านมา +3

    Love the reminder for ZZ And ZQ - always forget those! Great video!

    • @marco_peluso
      @marco_peluso  10 วันที่ผ่านมา

      You're welcome 😜

  • @dayvore8779
    @dayvore8779 11 วันที่ผ่านมา +3

    I find it hard to build up the muscle memory to make the complete switch to Vim, as I only use an editor occasionally. Videos like yours motivate me to keep on going because they show just how well thought out and powerful Vim really is. Thanks and keep up the good work

    • @marco_peluso
      @marco_peluso  10 วันที่ผ่านมา

      Just keep using it. I had a long on and off again relationship with Vim 😅 I kept coming back and eventually it just all made so much sense.

  • @docmalitt
    @docmalitt วันที่ผ่านมา

    Dude, you should have watched Luke Smith's "Vim Diesel Viminator"... It has all these cool tips and tricks and much more. Ok, first, thx for all these tricks but honestly that (a bit more than 1h) video I have saved on every machine and VM I own (yes, all linux... I am strange) but it should be repeated regularly. I know ppl h8 when mentioning other creators in comments, but as soon as I saw your first ZZ it reminded me on his 1st "trick" in his . He is a bit weird, but regarding Vim, tbh a lot to learn from him... keep em coming. Love your terminal...

  • @toolbelt
    @toolbelt 11 วันที่ผ่านมา +1

    Super useful. Thanks for this tutorial.

    • @marco_peluso
      @marco_peluso  11 วันที่ผ่านมา +1

      I'm glad you found the video helpful! It means a lot!

  • @feresp
    @feresp 8 วันที่ผ่านมา

    Great content! Thanks man!

    • @marco_peluso
      @marco_peluso  8 วันที่ผ่านมา

      Thanks, man! Glad you liked it! More content is already in the pipeline 😊

  • @sammyvandenburg
    @sammyvandenburg 11 วันที่ผ่านมา

    Another quality video!

    • @marco_peluso
      @marco_peluso  10 วันที่ผ่านมา

      Thanks again! Trying my best here 😅

  • @wiseskeshom4673
    @wiseskeshom4673 7 วันที่ผ่านมา

    Thank you so much. This video is really useful. I learned a lot from your tips.

    • @marco_peluso
      @marco_peluso  5 วันที่ผ่านมา

      Awesome, thank you! Stay tuned for more tips 😉

  • @mischavandenburg
    @mischavandenburg 11 วันที่ผ่านมา +1

    Great tips!

    • @marco_peluso
      @marco_peluso  11 วันที่ผ่านมา +1

      Thanks for your support! Glad you liked 'em! What was your favorite tip?

  • @y9tw0t
    @y9tw0t 9 วันที่ผ่านมา +4

    [ 03:49 ] "a word"? I'm pretty sure the _a_ is for _around_ .

    • @marco_peluso
      @marco_peluso  9 วันที่ผ่านมา +2

      I actually say "around" myself, usually. The Vim docs define it as "A Word", though. See vimdoc.sourceforge.net/htmldoc/usr_04.html#04.8

    • @traal
      @traal 8 วันที่ผ่านมา +1

      4:21 😅

    • @marco_peluso
      @marco_peluso  8 วันที่ผ่านมา

      A man with a keen eye! 😉

  • @reversev9778
    @reversev9778 8 วันที่ผ่านมา +1

    I would love a keyboard layout video. I’m still searching for the best way to arrange my symbols.

    • @marco_peluso
      @marco_peluso  8 วันที่ผ่านมา

      Will do it, but I have a few other videos in the pipeline first. To help you a little bit sooner, I use Miryoku layout in combination with a 36-key chocofi keyboard. More info on the layout can be found here: github.com/manna-harbour/miryoku/tree/master/docs/reference

  • @anthonytumia
    @anthonytumia 9 วันที่ผ่านมา

    I always remap “viw” to “vw” and “vw” to “ve” etc. Visual word meaning the current word and “visual end” for the rest of the word after the cursor makes more sense to me

    • @marco_peluso
      @marco_peluso  9 วันที่ผ่านมา

      Great idea, I like that! Maybe I will try that, but I think my muscle memory is probably already too strong to make that switch, now 🙈

    • @modernkennnern
      @modernkennnern 4 วันที่ผ่านมา

      I'm always reluctant to change such fundamentals because they don't transfer. Vim keybindings are usable in a fair number of applications and they obviously don't use your custom re-mapping

  • @graydhd8688
    @graydhd8688 5 วันที่ผ่านมา

    yet another editor I'm never going to try.

    • @marco_peluso
      @marco_peluso  5 วันที่ผ่านมา

      Thanks for sharing your thoughts! I appreciate your honesty, and I hope you find the right editor that suits your needs!

    • @graydhd8688
      @graydhd8688 4 วันที่ผ่านมา

      @@marco_peluso Okay youtube is being weird for me, I know what video I meant to make this comment on and it wasn't this one lol. I think youtube loaded a vid I clicked on after this one but didn't update the comment section before commenting on the new vid.

  • @mohammedsafki7564
    @mohammedsafki7564 3 วันที่ผ่านมา

    What is the tool you rae using to show those keypresses??

  • @liambunyan4116
    @liambunyan4116 7 วันที่ผ่านมา +1

    @1:36 how did you jump the cursor onto the numberline itself? Is it odd that, that was my WTF moment.

    • @ivanheffner2587
      @ivanheffner2587 7 วันที่ผ่านมา

      It looks like he’s using a multiplexer (probably Tmux). If you go back and slow it down, you’ll see a Ctrl-Shift-X, which probably is a control sequence for the multiplexor. At that point the cursor is no longer inside (Neo)Vim but in the multiplexor view and can be moved around the multiplexor buffer. When he exits this mode, it returns the cursor to Vim’s control, which does not let you move the cursor to the line number column.

    • @marco_peluso
      @marco_peluso  7 วันที่ผ่านมา

      Very nice observation! It's actually WezTerm's copy mode you see me using here. I show it off more in depth in my first video is actually: th-cam.com/video/LnZdaNfQ86o/w-d-xo.html

  • @KarlLew
    @KarlLew 8 วันที่ผ่านมา

    Having a shortcut for destructive actions amplifies stupidity. i never use zq. 😑. went to college with bill joy.

    • @marco_peluso
      @marco_peluso  7 วันที่ผ่านมา

      Actually good point! There's always a tradeoff.

  • @_tingExE
    @_tingExE 5 วันที่ผ่านมา

    Double explanation + command will echo in the editor itself. E.g. !!ls -a

    • @marco_peluso
      @marco_peluso  5 วันที่ผ่านมา

      Also a good one! Thanks for mentioning it!