How do people git gud at vim?

How do people git gud at vim?

Unattended Children Pitbull Club Shirt $21.68

Yakub: World's Greatest Dad Shirt $21.68

Unattended Children Pitbull Club Shirt $21.68

  1. 2 weeks ago
    Anonymous

    >how do people
    They don't.
    They just use kate and IDEs

  2. 2 weeks ago
    Anonymous

    just use it regurally, and whenever you came across something you odnt know how to do just google it. That's the only way to learn it

  3. 2 weeks ago
    Anonymous

    First you'll just use it for reformatting and doing quick edits on a server, then you'll realize it's good enough for everything else as well. Simple as.

  4. 2 weeks ago
    Anonymous

    most did not, pine & irssi it was

  5. 2 weeks ago
    Anonymous

    vimtutor and actually use it

  6. 2 weeks ago
    Anonymous

    Genuinely makes no intuitive sense whatsoever

  7. 2 weeks ago
    Anonymous

    Just don't. Wasted years on this garbage just to revert back to chording. If you must use modal editing go with xah-fly-keys

    • 2 weeks ago
      Anonymous

      >xah-fly-keys
      >NOOOO you have to use the latest and greatest one guys opinion for moving you cursor, tasukete Black person man, I'm going INSANENEEE

  8. 2 weeks ago
    Anonymous

    If you think "is there a way to make this process faster?" then the answer is yes and you should always act on this impulse. This is how you get better organically. Getting lazy or passive during these moments is common but they are ideal learning opportunities and one should be aware of this.

  9. 2 weeks ago
    Anonymous

    Mods are asleep, post shortcuts

    • 2 weeks ago
      Anonymous

      ZZ saves and quits so you can open a better editor

    • 2 weeks ago
      Anonymous

      gj and gk go down/up a wrapped line

    • 2 weeks ago
      Anonymous

      J appends the next line to the current line

  10. 2 weeks ago
    Anonymous

    I’ve only seen Luke “Let me give you a 20 minute lecture about how living in the countryside lowers your living costs despite the fact every moron knows this obvious fact” Smith using Vim and even then he only does it because he thinks anything that makes him look like more of a boomer stereotype is based.

  11. 2 weeks ago
    Anonymous

    >How do I get good at playing the guitar?
    >How do I get good at baking bread?
    >How do I get good at speaking Spanish?
    >How do I get good at digital photography?
    >How do I get good at chess?
    >How do I get good at calling OP a gay?
    >How do I get good at public speaking?
    >How do I get good at yoga?
    >How do I get good at programming in Python?
    >How do I get good at gardening?
    >How do I get good at drawing?
    >How do I get good at swimming?
    >How do I get good at knitting?
    >How do I get good at playing piano?
    >How do I get good at woodworking?
    >How do I get good at investing in stocks?
    >How do I get good at writing poetry?
    >How do I get good at running?
    >How do I get good at cooking Italian cuisine?
    >How do I get good at video editing?
    >How do I get good at playing soccer?
    >How do I get good at meditation?
    >How do I get good at playing chess?
    >How do I get good at solving puzzles?
    >How do I get good at making israeliteelry?
    >How do I get good at playing the violin?
    >How do I get good at cycling?
    >How do I get good at singing?
    >How do I get good at interior design?
    >How do I get good at playing basketball?
    >How do I get good at calligraphy?
    >How do I get good at acting?
    >How do I get good at surfing?

    • 2 weeks ago
      Anonymous

      so what's your answer, smart guy?

  12. 2 weeks ago
    Anonymous

    I'm hijacking this thread to ask a specific vim question!!!!
    // Comment1
    // Comment2
    // Comment3

    foo = 1;
    bar = 2;
    baz = 3;

    What is the best way to append each comment after each line WITH a blank space separating them?

    I currently get by with
    >Start at first comment, first column
    >CTRL+V (enters visual block mode)
    >2j (select first column of all 3 comments)
    >$ (select up until end of line for all 3 comments)
    >h (remove newline from the selection)
    >y (yank)
    >4j (go to foo)
    >A (to append to end of current line)
    >space (to insert the blank space)
    >ESC (return to normal mode, or CTRL+O for normal mode for only one command)
    >p (paste the default register)

    Output:
    foo = 1; // Comment1
    bar = 2; // Comment2
    baz = 3; // Comment3

    Surely there's a better way???

    • 2 weeks ago
      Anonymous

      just something sloppy like that yeah, if there are only three lines it will take more time to figure out an efficient than to just do it
      but if there are like 7+ lines i would record a macro that does 1 line and then repeat however many times you want

      • 2 weeks ago
        Anonymous

        What do you mean? This approach is completely independent of the number of lines because the operation is the same. It's a one and done. You don't need to keep repeating it

        My question is if this is as efficient as it gets for this particular use case or if there's some way I could
        >Grab a whole visual block
        >Yank it
        >Paste it as is and auto-inserting a space since it's going beyond what is currently in the destination lines

        • 2 weeks ago
          Anonymous

          just something sloppy like that yeah, if there are only three lines it will take more time to figure out an efficient than to just do it
          but if there are like 7+ lines i would record a macro that does 1 line and then repeat however many times you want

          I'm hijacking this thread to ask a specific vim question!!!!
          // Comment1
          // Comment2
          // Comment3

          foo = 1;
          bar = 2;
          baz = 3;

          What is the best way to append each comment after each line WITH a blank space separating them?

          I currently get by with
          >Start at first comment, first column
          >CTRL+V (enters visual block mode)
          >2j (select first column of all 3 comments)
          >$ (select up until end of line for all 3 comments)
          >h (remove newline from the selection)
          >y (yank)
          >4j (go to foo)
          >A (to append to end of current line)
          >space (to insert the blank space)
          >ESC (return to normal mode, or CTRL+O for normal mode for only one command)
          >p (paste the default register)

          Output:
          foo = 1; // Comment1
          bar = 2; // Comment2
          baz = 3; // Comment3

          Surely there's a better way???

          I think I have found my own answer. The key is in an option called 'virtualedit' (thanks vim manual).

          :set ve=all

          >ctrl+v
          >2j
          >$
          >h
          >d
          >"_d3j
          >$
          >l
          >p

          Less steps and also we've made sure the comments in their original form were deleted above, along with not leaving a bunch of newlines.

          Also learning about the black hole register (_) was fun.

          • 2 weeks ago
            Anonymous

            gj

    • 2 weeks ago
      Anonymous

      Your solution is probably how I'd do it it too.

      If it's a lot of rows I might do something like
      :g///.m5 | -j

      If there's more stuff in the file than just those lines you may have to visual select the lines first (or put 1,7 or whatever the line numbers are, before the g)

      • 2 weeks ago
        Anonymous

        if you want it to be as few keystrokes as possible (if you're playing vimgolf or something) you could just type it as
        :g'/'m5|-j

        And to break down what it does:
        :g'<pattern>'<action> finds all lines with <pattern> and performs <action> for each of those lines. So in this case it finds all lines with a / (this assumes none of the variable names contain forward-slashes, otherwise the pattern would need to be different or longer (or using a range instead)). And then it moves that line 5 lines down (m5) and then (the vertical bar separates several commands) goes one line up with the - and joins that line with the next with the j.

      • 2 weeks ago
        Anonymous

        if you want it to be as few keystrokes as possible (if you're playing vimgolf or something) you could just type it as
        :g'/'m5|-j

        And to break down what it does:
        :g'<pattern>'<action> finds all lines with <pattern> and performs <action> for each of those lines. So in this case it finds all lines with a / (this assumes none of the variable names contain forward-slashes, otherwise the pattern would need to be different or longer (or using a range instead)). And then it moves that line 5 lines down (m5) and then (the vertical bar separates several commands) goes one line up with the - and joins that line with the next with the j.

        That's insane, thank you. And here I was happy with my new solution here

        [...]
        [...]
        I think I have found my own answer. The key is in an option called 'virtualedit' (thanks vim manual).

        :set ve=all

        >ctrl+v
        >2j
        >$
        >h
        >d
        >"_d3j
        >$
        >l
        >p

        Less steps and also we've made sure the comments in their original form were deleted above, along with not leaving a bunch of newlines.

        Also learning about the black hole register (_) was fun.

        How do you make it so that this last command also cleans up the newline at the top when it's done?

        • 2 weeks ago
          Anonymous

          I'd probably start by deleting the blank line. So then the full command is
          :4d|g'/'m4|-j

          Maybe there's some way to reduce the keystrokes even more, but I'd have to think. Really though, the way you wrote it first is how I'd do it in the moment. This is just if it were a lot more lines or I'd need to put it in a script or something.

          • 2 weeks ago
            Anonymous

            Makes sense. Thanks anon, you've taught me something new.

  13. 2 weeks ago
    Anonymous

    by using it, like you get good in everything.

  14. 2 weeks ago
    Anonymous

    holy shit just spend a while in vimtutor until you get the hang of it.

  15. 2 weeks ago
    Anonymous

    open the terminal, type vimtutor and press enter

  16. 2 weeks ago
    Anonymous

    A more important question WHY do people git gud at vim?

    • 2 weeks ago
      Anonymous

      i was on a g4 powerbook and couldn't get a better editor for it.

      it takes like ten seconds to learn. OooOoOhh hjkl except the arrow keys work. Press i to get a normal editor, esc then :w<enter> to save, everything else is just bonus, you can pick it up slowly over time.

  17. 2 weeks ago
    Anonymous

    It's in the saying moron. Buy l use git. Git gud!

  18. 2 weeks ago
    Anonymous

    Why would you use Vim instead of something normal like Xed or Notepad++?

  19. 2 weeks ago
    Anonymous

    >having 3 seperate interaction modes instead of just holding shift to do something will somehow make my workflow much faster
    I've read tons of posts on the internet that apparently being good at vim will grant massive efficiency gains, now I'm really tempted to try but honestly it sounds like a load of bullshit
    I can't see how this shit would be much faster than fully utilizing VSCodium shortcuts + command pallete

    • 2 weeks ago
      Anonymous

      if you just get some vscode vim extension you still have vsc's shortcuts and command pallete, just with a normal mode you can drop into when u dont feel like pressing shift right repeatedly

      • 2 weeks ago
        Anonymous

        p.s. the real gains aren't in speed, but in incredible comfy and lazy

  20. 2 weeks ago
    Anonymous

    by learning a 1 new keybind every day and sticking with it

  21. 2 weeks ago
    Anonymous

    I will never not find it funny that the quickfix list shortcut is
    :cope
    Because cope is what you're gonna be doing going through your compile errors with it. It's short for "quickfix window open" I guess.

    Which by the way, I seriously hope you're not jumping to a different terminal/tmux tile to do your compiling. You can just do it in vim with :make

  22. 2 weeks ago
    Anonymous

    Post handy random things you have in your .vimrc

    https://hastebin.com/share/ilozuwofar.xml

  23. 2 weeks ago
    Anonymous

    vimtutor

  24. 2 weeks ago
    Anonymous

    bot thread

  25. 2 weeks ago
    Anonymous

    >git gud at vim
    >all distributions switch their default editor to nano

  26. 2 weeks ago
    Anonymous

    fake it till you make it

  27. 2 weeks ago
    Anonymous

    We're getting into the real wacky shit now
    https://alok.github.io/2018/04/26/using-vim-s-conceal-to-make-languages-more-tolerable/

  28. 2 weeks ago
    Anonymous

    >install neovim
    >:Tutor
    >remap hjkl to jkl;
    >spend a week writing code in nvim
    >???
    >welcome to gigachad club

    how are so many Black folk don't get this

    • 2 weeks ago
      Anonymous

      hjkl to jkl;
      are you moronic perchance?

  29. 2 weeks ago
    Anonymous

    >The Joy of Vim, parts 1 through 3, by Jerry Peek

    https://www.jpeek.com/articles/linuxmag/2006-09/
    https://www.jpeek.com/articles/linuxmag/0610.pdf
    https://www.jpeek.com/articles/linuxmag/0611.pdf

  30. 2 weeks ago
    Anonymous

    Other than vimtutor, are there any games or websites that help learn the shortcuts?

  31. 2 weeks ago
    Anonymous

    Vimtutor and practice

  32. 2 weeks ago
    Anonymous

    Literally just run vimtutor. I don't know why people overcomplicate learning vim so much--it is honestly not that difficult at all. I'd say 80% of my understanding of vim stems from spending 30 minutes on vimtutor a decade ago, and that's more than enough to be reasonably proficient with vim (or to leverage vim keybindings in other IDEs/editors/applications). The other 20% has just come organically over time, either from picking up on little tricks or functions here or there, or from having a particular need and thinking to myself "there's probably a specific way to do this in vim", then looking it up and learning it. You don't need to know every little bullshit feature built into vim, nor do you need to be a hardcore terminal-only vim autist to derive benefit from learning vim keybindings.

    • 2 weeks ago
      Anonymous

      >hardcore terminal-only vim autist
      Who even uses graphical vim
      Graphical emacs I totally understand, but graphical vim?

      • 2 weeks ago
        Anonymous

        I wasn't referring to gvim, I was referring more broadly to using vim keybindings in other applications. I constantly see people dismiss learning vim because they think it's just some autistic terminal editor or whatever--but my point is that even if you aren't doing all of your work in vim specifically, vim keybindings are very portable and you can leverage them in other applications.

  33. 2 weeks ago
    Anonymous

    type 'man vim' in your terminal then practice using vim.

  34. 2 weeks ago
    Anonymous

    if I want to get into vim should I go with vim or neovim?

    • 2 weeks ago
      Anonymous

      doesn't really matter. neovim has slightly better defaults and all of the development/plugin focus is on neovim these days (if you have the desire to turn it into a bloated monstrosity)

      • 2 weeks ago
        Anonymous

        im coming from vscode, would the plugin ecosystem be more familiar with neovim?
        all I need currently is python and Go plugins for highlighting and static error catching and whatnot
        also a minimalist solarized theme

        • 2 weeks ago
          Anonymous

          If you're not going to be SSHing into other machines and whatnot, do whatever you want.

          If you are going to SSH into other machines, then vim is the sane option because it's everywhere. A simple config file is all you need to feel right at home (or something like Tim Pope's sensible defaults https://github.com/tpope/vim-sensible/ )

  35. 2 weeks ago
    Anonymous

    just use it

    • 2 weeks ago
      Anonymous

      necessary, but not sufficient
      There are tons of people who do things all the time and still suck at them because they never stop to explore and optimize. This happens especially if you are old or low iq

  36. 2 weeks ago
    Anonymous

    what else do i need to know?
    i know:
    movement
    ctrl-i/o
    search/replace
    registers but i never use any except the default one
    how to make and replay a macro
    probably other stuff but i don't realize now.
    oh and i have a shit ton of plugins and options.
    i don't know vimscript like at all, how important is it?

    • 2 weeks ago
      Anonymous

      you need [f]oward and un[t]il if that isn't already included in "movement"
      i.e. dfO deletes everything from the cursor to the next O
      same for "in" and "around" as in ci( to change in brackets, diw to delete in word, yi" yank in quotes.
      Important to note is that if the cursor isn't inside a pair of quotes, or brackets or whatever it will look ahead and do the action in/around the next pair it can find.

      . repeats the last action you did.
      * searches for the current word under the cursor.

  37. 2 weeks ago
    Anonymous

    this was a good guide for scripting

    https://learnvimscriptthehardway.stevelosh.com/

  38. 2 weeks ago
    Anonymous

    by having no life and no job

Your email address will not be published. Required fields are marked *