An example on how I use vim to make my workflow faster.

Sdílet
Vložit
  • čas přidán 28. 07. 2024
  • An example of me using vim. I was super nervous. First time recording seriously. I messed up some words. I will try to make my next one better.

Komentáře • 12

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

    On the last substitute command, you used "g". This means for every occurrence in a line. You don't need this since, it can only happen once per line. Additionally, you use the caret (^) to force the pattern to start at the beginning of a line, making "g" even more superfluous.
    Vim has a builtin :sort command that works the same way as !sort although it's options are a bit different.

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

    Great video and it's always good to see how someone does macros and substitutions and take something from it.

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

    nice video, one question please, why comma in the regex?

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

      Commas are used as delimiters in csv files. I need to specify of our search.

    • @davidhenrryt
      @davidhenrryt Před 4 lety

      @@SeniorMarsTries yep commas are the defacto separator in csv, but your file is separated by pipes, that's why it's a bit weird, but I guess commas are converted by vim to the current csv separator?

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

      @@davidhenrryt yes. That is the case. I think I installed a plug-in.

  • @Mladenac
    @Mladenac Před 3 lety

    when you did search and replace with Confirm, you could've pressed A, and done it not using global command.
    I like the video since I learnt something. :-)

  • @007sya
    @007sya Před 3 lety +1

    you could use Python pandas for csv files

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

      You could have, but that would ruin the point of the video

  • @bew
    @bew Před 3 lety

    - '$bDA' what about '$bc$' or even '$bcw' (for change to the end of line, or change next word) ?
    - ':3,999norm...' what about ':3,$norm...'
    - in regex, to match numbers you can use '\d\+'
    - for the underscore to dot, you can simplify to: ':g/\d\+_/norm f_r.'
    You're welcome (;

  • @carlblomqvist
    @carlblomqvist Před 4 lety

    To me it would have made more sense to do both changes in one macro. For example
    qe0f_r.$bcwTRUE

  • @desubakadesu
    @desubakadesu Před 4 lety +7

    jjj...19x
    kkk...31x
    jjj...9x
    lll...17x
    kkk...11x
    jhhh...24x
    Oh God, stop it!