Advanced Vim Workflows

Sdílet
Vložit
  • čas přidán 3. 04. 2020
  • Watch three typical workflows of someone with a decade of Vim experience. I'll edit 40 files at once with :argdo, turn bags of JavaScript functions into classes with a macro, then create a keyboard shortcut for playing the mp3 under cursor.
    Detailed show Notes: www.semicolonandsons.com/epis...
    Errata
    4.16: I said "command line mode". It's actually "command mode". Thanks to the great people at r/vim for catching that.
  • Krátké a kreslené filmy

Komentáře • 115

  • @d3lirious
    @d3lirious Před 5 měsíci +5

    So far all videos displaying the "power of vim" have had me screaming at the screen as they use macros to solve absolutely basic problems that can be solved much better with :%s/pattern/replacement/g (assuming the dev is not a tool and actually knows Regex).
    This is the first demonstration I see of actual powerful use macros. Especially since you also demonstrate the power of text objects and arglist.
    Well done sir!
    PS: my most recent use of macros was selecting certain bits of text and moving them from one file to another. It's suprisingly easy to record a macro that:
    1. deletes the entire text object your cursor is on
    2. switches window (I had the other file open in the other window)
    3. jumps to the bottom
    4. pastes
    5. comes back to the first window
    6. jumps to the next text object to inspect

  • @Fichleai
    @Fichleai Před 3 lety +7

    Holy Sh** this is amazing !! I'm only 6 months into VIM and everyday getting new tricks and commands, but looking forward to a decade in VIM !

  • @JKhalaf
    @JKhalaf Před 3 lety +37

    As someone just getting started with vim, that was amazing to watch! Can you do a video on how you have your vim set up? I mean with all the plugins ...etc.

  • @fredhair
    @fredhair Před 3 lety +10

    Im pretty new to vim but so far I really love its capabilities though im no where near this level! The only thing is trying to remember all the keys and wishing I knew more about vim builtin scripting.
    Glad to discover your content and thank you for producing it!

  • @ArielVolovik
    @ArielVolovik Před 4 lety +14

    As a new Vim user... you're a goddamn wizard!

  • @Deanin
    @Deanin Před 4 lety +9

    Excited to watch this tonight, glad to see more content!

  • @ivankudinov4153
    @ivankudinov4153 Před 4 lety +2

    Splendid job! Efficient & elegant manner combines with the true knowledge for an aesthetics pleasure. High quality content here!

  • @kombatunit66
    @kombatunit66 Před 3 lety +1

    I've been using VI since 1997 and that was just nutty.

  • @PabloAndresDealbera
    @PabloAndresDealbera Před 4 lety +4

    Excelent showcase on actually doing real example on how to use this tools. I often when doing some refactoring try to learn a new way on doing it by using Vim or some cli tool like sed. Never knew I could run a macro on several files like that, and also that example on taking the results of a regexp and pasting on that line. Very good stuff! Keep them going!

  • @Vulto166
    @Vulto166 Před 2 lety

    humm Edvard Grieg for the intro. Looks like you are a man of culture.

  • @shaytal100
    @shaytal100 Před 4 lety

    Great video! Love to see how others use vim. The best way to learn after one knows the basics. Cool Examples! Looking forward to the next vim workflow video!

  • @semicolonsons
    @semicolonsons  Před 4 lety +10

    Errata
    4.16: I said "command line mode". It's actually "command mode". Thanks to the great people at r/vim for catching that.
    Show notes and episode alerts: www.semicolonandsons.com/episode/Advanced-Vim-Workflows

    • @sagardesai5278
      @sagardesai5278 Před 4 lety +2

      I think you misunderstood the correction. Command mode is synonymous to Normal mode, so at 4:16 "Command Line mode" is the correct word to use.

  • @martonturbuk3060
    @martonturbuk3060 Před 3 lety +3

    And here I am thinking VIM can' surprise me anymore. And then there is this video.

    • @semicolonsons
      @semicolonsons  Před 3 lety +2

      A compliment to another man's vim skills is the greatest compliment of them all.
      I am humbled.

  • @cindysi63
    @cindysi63 Před dnem

    Wow this is master tier level skills!

  • @qwertyasdf7615
    @qwertyasdf7615 Před 4 lety

    Awesome vid 🙌 Excited for some more content!!

  • @1n5ighttrading69
    @1n5ighttrading69 Před 3 lety

    This was amazing! Thank you for doing this!

  • @Klausterfull
    @Klausterfull Před 2 lety

    Loved the macro explanation! 🙏

  • @Chalisque
    @Chalisque Před 4 měsíci

    I always find so much to vim that I haven't discovered yet. The args do and macro thing I must learn to make use of.

  • @avimehenwal
    @avimehenwal Před rokem

    god tier content .... instant sub. Thankyou for making this high quality video and sharing it (Y) kudos

  • @JulioOAO
    @JulioOAO Před 3 lety +1

    Best Vim's video ever!

  • @testertech
    @testertech Před rokem

    Instant subscribe, awesome content!

  • @JayJay-ki4mi
    @JayJay-ki4mi Před 4 lety +4

    Omg the prozac thing made me laugh. Love the channel name too.

  • @user-je8he7ox6p
    @user-je8he7ox6p Před 10 měsíci

    Great video, I learned a lot from this video!

  • @javiertw89
    @javiertw89 Před 3 lety +3

    You had me already convinced with Schumann, you didn't need to record all those macros!

  • @AtomToast
    @AtomToast Před 4 lety

    vim indent guides looks pretty nice, I might look into it as an alternative to indentLine

  • @lylez00
    @lylez00 Před 5 měsíci

    To help view the output of "git diff", I like to use: git diff | gvim -c set titlestring="output\ of\git\ diff" - &

  • @goonman1255
    @goonman1255 Před 3 lety

    Really good vid, please make more vim ones

  • @pouet4608
    @pouet4608 Před 4 měsíci

    What a gem!

  • @klimenkodr123
    @klimenkodr123 Před 4 lety +4

    Please do more, sir.

  • @yallaoui
    @yallaoui Před 2 lety +2

    Excellent advanced vim tips.
    Kindly use screen key so we can see the commands you type.
    Many thanks

  • @jhwheeler7
    @jhwheeler7 Před 4 lety +2

    Mind officially blown!

  • @YannMetalhead
    @YannMetalhead Před rokem

    Good tips.

  • @mback3713
    @mback3713 Před 5 měsíci

    it feels to me as though a sed or awk script would be better for the first 2 examples... but the third vim example is really cool!

  • @InputOutput10
    @InputOutput10 Před rokem

    Now I see how developers become 10x, my power level is too weak.

  • @MrMangkokoo
    @MrMangkokoo Před 3 lety +1

    How can I get the buffer list on the top of the window like yours??

  • @jasperzanjani
    @jasperzanjani Před 3 lety +3

    4:00 tl;dr - use `:argdo normal@c` to run macro at register c on all open buffers

  • @whatupmiked8514
    @whatupmiked8514 Před 4 lety

    Just curious what you are using for code completion engine? I see you are using fzf for search and this video put me over the edge into trying it. Thanks for the great video!

    • @semicolonsons
      @semicolonsons  Před 4 lety +1

      I'm using vim-lsp to get access to the Language Server Protocol. I've already recorded a video on that and will be releasing it on semicolonandsons.com instead of CZcams.

  • @FlaviusAspra
    @FlaviusAspra Před 3 lety

    We really need great refactoring tools like language servers. This way we can have the IDE in vim.

  • @Megalcristo2
    @Megalcristo2 Před 3 lety +5

    3:40 If you don't save and use :ea 1f you would be doing the same but without the need of using a plug-in.

    • @semicolonsons
      @semicolonsons  Před 3 lety

      Very interested in understanding this.
      Can you unpack your command a bit? I must admit I don't understand it (but am super eager to learn)

    • @Megalcristo2
      @Megalcristo2 Před 3 lety +2

      @@semicolonsons I learnt it from the help system, ea means earlier and you can move trought different states in your file thank to this command and "later" (I think, I don't use this last one quite often so I don't remember).
      If you use ea 10m you go back to the state you were 10 minutes ago, if instead of m you use f you move thought save states.
      You can think of it like a mini git.
      (stackoverflow.com/questions/18500352/how-to-undo-up-to-last-write-in-vim)

    • @semicolonsons
      @semicolonsons  Před 3 lety

      @@Megalcristo2 Amazing. You learn something new every day about vim.

  • @rmdes
    @rmdes Před 3 lety

    That made me want to learn vim :)

  • @Agililord
    @Agililord Před 2 lety

    Hey @Semicolon&Sons!
    I have a question. I'm trying to replicate the workflow of using `args` then `argdo`, hoping I can do similar with `vimgrep` and `cdo`. But it doesn't seem like the w on the command from cdo is actually writing the files, so the `cdo` stops and yells at me because there's no write.
    I am still fairly new to working with buffers, so maybe I'm not understanding why we need to delete the current buffer, or how to do that in order to make the writes effective. But if you have thoughts/have seen this and can think of a correction, I would be eternally grateful!

  • @mumk
    @mumk Před 5 měsíci

    Nice channel name bro, reminds me of steinway and sons

  • @liamf7072
    @liamf7072 Před 6 měsíci

    How do you get the alternating background colors for your start-of-line tabs/spaces?

  • @nodswal
    @nodswal Před 4 lety

    Loved the content, is this going to be a reoccurring subject? Looks like you removed the link to your "Show Notes"?

    • @semicolonsons
      @semicolonsons  Před 4 lety +1

      Yep, for sure. I've already recorded the next four videos, though I plan on hosting most of them on my own website. The problem is that CZcams doesn't let me modify exiting videos so I can't fix errors.
      Show notes are here: www.semicolonandsons.com/episode/Advanced-Vim-Workflows
      I also added a link in the description (should have put that there initially!)

  • @blank-vw2sb
    @blank-vw2sb Před 2 lety

    DOPE AS FAQ

  • @yujinyuz
    @yujinyuz Před 4 lety +6

    Thanks for this one!
    How did you set up your config to make it highlight while typing :%s/^function ?
    I'd also appreciate it if you enable screen keys so we could see what you're actually typing :)

    • @yujinyuz
      @yujinyuz Před 4 lety +2

      Aha! Found it: set inccommand=nosplit

    • @semicolonsons
      @semicolonsons  Před 4 lety +3

      @@yujinyuz It's a neovim only thing as far as I know

    • @yujinyuz
      @yujinyuz Před 4 lety

      @@semicolonsons Yeah. I'm using neovim so I don't have problems with it. I tried doing what you did btw, but apparently doing :%s/^function/foo/g doesn't match anything for me.
      while :%s/function/foo/g works fine. Any ideas why the ^ was not working in my case?

    • @semicolonsons
      @semicolonsons  Před 4 lety +1

      @@yujinyuz Ah yes. That's because I have `set gdefault` in my vimrc. Here's a good reference: vim.fandom.com/wiki/Search_and_replace

    • @damienw4958
      @damienw4958 Před 4 lety +2

      You can actually do it in vim too, `:set hlsearch` iirc, otherwise, check the arch wiki, I recently made an edit to the tips for this.

  • @primepicks101
    @primepicks101 Před 4 lety +2

    Good morning, Sir.
    I hope you are doing well. I would like to recommend you to do some videos about the vim's plugins that you use.
    Sincerely,
    a brazilian friend.

  • @godnyx117
    @godnyx117 Před 4 lety

    Great video man! Can I learn what do you use for autocompletion?

    • @semicolonsons
      @semicolonsons  Před 4 lety

      I've already recorded a video on the topic so stay tuned. In brief it's a combination of vim-lsp and the asyncomplete plugin.

  • @klimmesil9585
    @klimmesil9585 Před 2 lety

    I like how you say hate shtee ML because that's clearly my relationship with www

  • @pinpox
    @pinpox Před 4 lety +2

    Would you mind sharing your vim configuration files? I'd be interested to see them, your setup looks nice!

    • @semicolonsons
      @semicolonsons  Před 4 lety +4

      Here's a pretty recent version. I plan on doing a future video where I build it up piece-by-piece.
      gist.github.com/jackkinsella/aa7374a6832cca8a09eadc3434a33c24

    • @pinpox
      @pinpox Před 4 lety

      @@semicolonsons Thanks, that's great! I would be really interested in that video and probably others too!

  • @albert3407
    @albert3407 Před rokem

    what kind of editor is it? is it extended vim with plugins?

  • @Aronnax777
    @Aronnax777 Před 2 lety

    What is happening, how do you get it set up like that! And your prompt, I have heard about customizing your linux prompt, but you must have installed some software.

  • @patjustpat8178
    @patjustpat8178 Před rokem

    took me 30 seconds to subscribe

  • @heljhumenad
    @heljhumenad Před 3 lety +1

    This so blown my mind how did you do that ??? my skills in Vim is in beginners i need to learn more from you Thanks!

    • @semicolonsons
      @semicolonsons  Před 3 lety

      10 years of practice :)
      And enjoyable through every second

  • @snoopy8870
    @snoopy8870 Před 8 měsíci

    music at the beginning?

  • @mosk11tto
    @mosk11tto Před 4 lety +1

    This reminds me of emacsrocks, and that if anything is a compliment to a good video.

    • @semicolonsons
      @semicolonsons  Před 4 lety +1

      Never heard of it but I'm very curious to check out what the dark side looks like ;)

  • @mateoleoncamacho3222
    @mateoleoncamacho3222 Před 3 lety

    Hello! Not actually related to Vim, but I'd love to know the name of the music at the start of the video. Best wishes, great content!

  • @luukasportfors9414
    @luukasportfors9414 Před 4 lety +1

    Nice video and all but why is your intro a tiny part of Greig's A minor concerto?

    • @semicolonsons
      @semicolonsons  Před 4 lety

      You know your tunes! I just like it and it's old enough that I could find recordings that aren't subject to licensing fees.

    • @luukasportfors9414
      @luukasportfors9414 Před 4 lety +1

      @@semicolonsons Is your name somehow referring to steinway&sons aswell? xd

    • @semicolonsons
      @semicolonsons  Před 4 lety +1

      @@luukasportfors9414 I wanted to sound fancy and use alliteration at the same time. Plus something something object inheritance.

  • @kellysmith7357
    @kellysmith7357 Před 2 lety

    i

  • @ybbond_
    @ybbond_ Před 3 lety

    how can you change buffer while the one you're leaving is modified buffer? 3:09

    • @semicolonsons
      @semicolonsons  Před 3 lety

      Can't remember but I think I used a key mapping ]b that maps to :bnext

  • @sergeygong2224
    @sergeygong2224 Před 3 lety +1

    what a cool voice )

  • @arvindersingh9863
    @arvindersingh9863 Před 3 lety

    I'm using neovim and i use tab key to switch buffers. But switching happens after a delay, but when i use :bnext and :bprev for switching it works fast.
    Is there any solution you can suggest?

    • @semicolonsons
      @semicolonsons  Před 3 lety +1

      It may be possible that you have "tab + something else" mapped to another action and vim is waiting to see whether you end up pressing another key or just leaving it at tab. Check your mappings with something with :map

    • @arvindersingh9863
      @arvindersingh9863 Před 3 lety

      @@semicolonsons Yes I'm using tab key as completion key for emmet.vim. Thanks a lot

  • @hielke2332
    @hielke2332 Před 4 lety +1

    Not a vim question, but if I do a git diff on my machine it looks a lot messier than if you do it.

  • @paultwocock5421
    @paultwocock5421 Před 2 lety

    Vim, if u you're absolutely beginner
    This book "vim from wtf to omg" will be useful for you

  • @idvorkin
    @idvorkin Před 4 lety

    Can you share your dotfiles? Good to see other best practices

    • @semicolonsons
      @semicolonsons  Před 4 lety

      Gladly gist.github.com/jackkinsella/aa7374a6832cca8a09eadc3434a33c24

    • @idvorkin
      @idvorkin Před 4 lety +1

      ​@@semicolonsons Much obliged - github.com/idvorkin/Settings/commit/8420806df61e0b75eb61681562da79e175025379

  • @rolandrodriguez
    @rolandrodriguez Před 3 lety

    Fawesome thx

  • @gaurabkhatry7641
    @gaurabkhatry7641 Před 3 lety

    Which colorscheme is this?

    • @semicolonsons
      @semicolonsons  Před 3 lety

      Solarized I think, with light customization. Working on updating a publicly shareable vimrc

  • @kronaemmanuel
    @kronaemmanuel Před 4 lety +2

    Ummmm the audio sounds like you applied the background noise removal thing in audacity too many times.

    • @semicolonsons
      @semicolonsons  Před 4 lety +1

      Yea I totally know. I've figured out a way to get the audio a tad better in future.
      Anyway, hope you enjoyed the work flows :)

    • @kronaemmanuel
      @kronaemmanuel Před 4 lety +1

      @@semicolonsons i do enjoy your work a lot. I love your channel.

    • @semicolonsons
      @semicolonsons  Před 4 lety

      @@kronaemmanuel thanks man! I'm curious what world of development do mostly inhabit? What types of software and stacks?

    • @kronaemmanuel
      @kronaemmanuel Před 4 lety

      @@semicolonsons I use vim for React and web development mostly.

  • @comosaycomosah
    @comosaycomosah Před 3 měsíci

    lmao your name is amazing bro

  • @ahmaddynugroho
    @ahmaddynugroho Před 2 lety

    1:50 tips, use "dj" instead of "2dd"

  • @toequantumspace
    @toequantumspace Před 4 lety

    Vim rulez

  • @421sap
    @421sap Před 3 měsíci

    God bless you in Jesus' Name Amen ✝️

  • @thriftsimple561
    @thriftsimple561 Před 4 lety

    Huh?

  • @atrioom
    @atrioom Před 4 lety

    jesus, loose the echo oO

    • @semicolonsons
      @semicolonsons  Před 4 lety +3

      I know. Working on it. But COVID-19 means I'm stuck recording in my apartment which has big rooms and therefore terrible acoustics.

    • @atrioom
      @atrioom Před 4 lety

      @@semicolonsons Oh wow, I thought it was an effect you added later on xD Thanks for the vid anyways, nice tactics! :)