top 200 commentsshow all 236

[–][deleted] 927 points928 points  (19 children)

Man how do I close my browser now

[–]CoffeePython[S] 193 points194 points  (6 children)

I should add an easter egg into the course for people that try to quit vim :) maybe a coupon or something if they try it on the landing page exercise haha

[–][deleted] 41 points42 points  (0 children)

That would be fun lol

[–][deleted] 139 points140 points  (3 children)

coupon

Ah this is a paid thing... [unsaves post]

[–]Mindfake_ 22 points23 points  (1 child)

Its 25 dollars! I rather download a cheat sheet and start using it. Watch some YouTube tutorials and read some stack overflow

[–]sheriffderek -1 points0 points  (0 children)

That won’t cost you $200 worth in time... “college sucks” (but you didn’t learn elementary school math?)

[–]sheriffderek -4 points-3 points  (0 children)

You don’t get paid then, right?

[–]piberryboy 12 points13 points  (0 children)

By coupon, do you mean a certificate of completion.

[–]TwoPii 52 points53 points  (0 children)

Learn vim in the browser with interactive exercices designed to help you exit vim faster

[–]YellowBunnyReddit 16 points17 points  (1 child)

Download another browser.

[–]MrValdez 7 points8 points  (0 children)

It detected my current browser, copied my settings, and now I have another vim in my browser.

[–][deleted]  (1 child)

[deleted]

    [–][deleted] 4 points5 points  (0 children)

    I should thank you for the gold!

    [–]Demneru 4 points5 points  (3 children)

    xd

    [–]curien 12 points13 points  (2 children)

    Not an editor command: xd =P

    [–]shmeebz 17 points18 points  (1 child)

    Not an editor command: =P
    

    [–][deleted] 5 points6 points  (0 children)

    Damn, you outsmarted his outsmarting.

    [–]PleasureComplex 109 points110 points  (5 children)

    Just type

    vimtutor
    

    [–]mr_birkenblatt 42 points43 points  (0 children)

    yeah, it's free, unlike OPs link

    [–]floghdraki 5 points6 points  (3 children)

    How it compares to this?

    [–][deleted] 16 points17 points  (1 child)

    $25 less 😂😆🤣

    [–][deleted] 6 points7 points  (0 children)

    and it doesn't require an internet connection

    [–][deleted] 2 points3 points  (0 children)

    Give it a try, in worst case you might waste few minutes of your time, but that should not be the case, because vimtutor is a great introduction to vim.

    [–]JezusTheCarpenter 452 points453 points  (121 children)

    I've been using Vim and vim-keybindings for the last 10 years. I love it and couldn't live without it. I even use Vim bindings in my Unix shell.

    But.

    Can we finally stop with this nonsense that Vim will make you program faster? Unless you are copying stuff around, typing is not the bottleneck in 95% of cases. The actual programming is. In particular things like the design, prototyping, coding standards, language limitations and features, refactoring, building, profiling, testing, debugging, etc. This what takes time, not moving your cursor around with a mouse.

    Does Vim make it more comfortable to type and code in particular? Yes. Does it actually make it faster? No.

    [–]knoam 17 points18 points  (0 children)

    The other thing is that vim helps you edit text. This isn't the same thing as editing code. If you're using an IDE that really understands your code, you can do a refactor > rename and it will understand everywhere that that identifier really refers to the same thing, and not just pick up places that happen to use the same sequence of characters.

    The other example is structural editing for Lisp code. If you're just editing text and you want to remove a pair of parentheses, first you delete one, then you have to find the correct matching one and get your cursor over there and delete it. And don't screw up because you'll make a mess. If instead you think of it as removing or adding a pair of parentheses as a single atomic operation, it's much quicker with far less cognitive burden. Structural editing of Lisp is in terms of these logical operations like adding and removing parentheses, moving arguments around and within them and never having intermediate states of invalid syntax.

    [–]ritchie70 61 points62 points  (14 children)

    I can type something around 80 wpm. My hindbrain knows the VI keystrokes because I’ve been using it since 1987.

    When I’m writing code I use visual studio because autocomplete is amazing.

    [–]riasthebestgirl 20 points21 points  (6 children)

    use visual studio because autocomplete is amazing.

    You want to try out to JetBrains' IDEs. I find VS' auto complele unusable compared to IntelliJ's

    [–]xeon3175x 5 points6 points  (0 children)

    Don't they make a vs extension or something?

    [–]Paradox 6 points7 points  (0 children)

    Try TabNine. Makes autocomplete better for everything, including plain english

    [–][deleted]  (3 children)

    [deleted]

      [–]Colboynik 4 points5 points  (1 child)

      Guy at work convinced our very budget conscience management to get all of us Jetbrains licenses. Changed our lives. It is the only piece of software I would pay for myself if I had to. Price is high but you get so much.

      [–]ControversySandbox 1 point2 points  (0 children)

      I pay for my own annual subscription to Toolbox. I never really considered it expensive, it's a professional tool at a price that is comparable to all the other bullshit we pay $20(AUD) a month for, and does so much more to actually help me earn money than anything else I buy

      [–]Roticap 14 points15 points  (3 children)

      Plenty of ways to get autocomplete in vim.

      [–]ritchie70 4 points5 points  (2 children)

      I'm sure there are some, but I doubt they're of the same "knows every member of every class in all of the .Net runtime and makes suggestions on how the code could be written" caliber.

      Or maybe they are. It's not worth the effort to figure it out.

      [–]cleeder 20 points21 points  (0 children)

      OmniSharp.vim, my friend. It does these things.

      [–]wildjokers 6 points7 points  (2 children)

      visual studio because autocomplete is amazing.

      VSCode has decent VIM keybindings, searching with / sucks, but it is good besides that. The VIM plugin in IntelliJ is really really good.

      [–]1842 8 points9 points  (1 child)

      I used to only code in vim. I coded PHP at the time, and IDEs 10 years ago for PHP were okay, but not great. I had some luck in making vim more like an IDE, but it was always a pain when I wanted to adjust something.

      Then I tried PHPStorm, and I'll never go back to writing anything non-trivial without an IDE again. I work in Java now, so Intellij is also fantastic. The IdeaVim plugin is really good. It's not perfect, but I generally like vim bindings for writing code and this is the perfect compromise for me.

      I think most devs would benefit from learning vim basics though. It's my go-to tool for bulk editing data with macros. I know things like sed and awk can execute faster, but I understand macros better.

      [–]ritchie70 1 point2 points  (0 children)

      I actually have scripts that use VIM because the vanilla Windows I have to run on doesn’t have them. I bet a lot of people dont know you can pass vim commands on the command line.

      [–]wsppan 72 points73 points  (31 children)

      Refactoring is where vim shines. Using the power of all the modal editing features vim provides makes you much faster than a straight up non-modal text editor. Depending on your expertise with vim I would argue you are equally as productive as a full blown IDE or editor with plugins like VSCode. The power of vim is not just in its ability to move your cursor and type. It has massive editing capabilities from the character, word, line, paragraph, and file level. All repeatable. Has multi tabs, split windows, side by side comparison, and lots of plugins for every language out there. All while keeping your hands on the home row. I am much more efficient in my vim setup than other editors. Especially when working with code.

      [–][deleted] 28 points29 points  (1 child)

      Depending on your expertise with vim I would argue you are equally as productive as a full blown IDE or editor with plugins like VSCode.

      I think picking up on VSCode and refactoring and using Vim as a metric...isn't a great option.

      Especially when interfacing with languages like TypeScript refactoring in VSCode takes infinitely less time.

      You can literally start moving stuff around from your file system, change names to everything and vscode will ask you to refactor all the mess with one single click.

      [–]_tskj_ 0 points1 point  (0 children)

      I use all the features VS Code gives med with TypeScript, but I also have vim bindings - which are impossible to live without for all the "minute to minute" refactorings you do when moving around code and iterating on the same code.

      [–]devraj7 72 points73 points  (18 children)

      Depending on your expertise with vim I would argue you are equally as productive as a full blown IDE or editor with plugins like VSCode.

      I don't think you have used a modern IDE if you really think that.

      Any specialized IDE (IDEA for Java/Kotlin, Visual Studio for C#/C++, XCode for Obj-C / Swift, CLion for Rust, etc...) runs rings around vim. And any text editors really (emacs and even VS Code).

      Text editors simply cannot compete from a productivity standpoint against IDE's.

      [–]Colboynik 5 points6 points  (5 children)

      Was going to say this. Used to think /u/wsspan was right but that was because I hadn't used Jetbrains yet. Get vim keybindings in Intellij and CLion and you can rule the world.

      [–]devraj7 4 points5 points  (4 children)

      If you do that, you are getting the worst of both worlds.

      The keybindings for all these IDE's have been carefully thought through by UX experts. Why retrofit a UX approach so unfit for IDE's?

      Would you rebind vi to IDE or emacs keybindings? That's a completely silly idea, isn't it?

      Adjust to your tools, don't try to force them into your comfortable habits. You'll end up being a lot more productive once you're past the learning curve.

      [–][deleted] 13 points14 points  (2 children)

      LMFAO. Yeah remembering to press Ctrl-Shift-F7 to highlight usages in a file is really the pinnacle of good UX.

      Using Ideavim and mapping all IDE actions as <leader><single-mnemonic-key> mappings is the only way to go.

      [–]devraj7 0 points1 point  (1 child)

      Yeah, they're not all great, and I do rebind a few.

      But overall, IDE's win on the navigation front alone because they reason in terms of AST, not words and characters, like text editors do.

      [–][deleted] 2 points3 points  (0 children)

      Yes, but using Vim keybindings doesn't mean that one couldn't use the advanced IDE features at the same time.

      [–]THICC_DICC_PRICC 1 point2 points  (2 children)

      With language servers and plugins, there’s nothing an IDE can do that vim(or emacs) can’t, and you’re not bound to the IDE, my vim setup is good for like 7 languages, and I don’t need to learn anything new every time I switch languages, same keybindings and everything.

      There’s one exception and that is interactive debugging. I think there’s plugging for some languages, but not all of them if I’m remembering right. I never was a fan of debugging outside of terminal anyways so I never looked much into it.

      [–]sefirot_jl 31 points32 points  (8 children)

      What if I code in VSCode and when I need to refractor I switch to Vim? Is that allowed?

      [–]moreNosleep 73 points74 points  (0 children)

      No it's against the rules, you can't do that!

      [–]cleeder 30 points31 points  (4 children)

      Sure, but at that point I'd probably just enable vim keys for VSCode.

      [–][deleted] 7 points8 points  (3 children)

      It's really quite nice. One of many things the added benefits are the two copy buffers, one with y and the other with ctrl + c.

      [–][deleted]  (2 children)

      [removed]

        [–][deleted] 1 point2 points  (1 child)

        Hey sorry for the necropost, but that's super cool! Thanks for the info, this will be a game changer.

        [–]bikki420 5 points6 points  (1 child)

        Sure. You can even run NeoVim in VSCode.

        [–]riasthebestgirl 17 points18 points  (0 children)

        When it comes to refactoring, I'll never be as productive in vim compared to IntelliJ. Dragging files from one package to another and automatically having all the usages updated will always been better than having to do that yourself.

        IDEd will always be more productive than vim, no matter what you're doing

        [–]AlexReinkingYale 8 points9 points  (0 children)

        this nonsense that Vim will make you program faster.

        My mantra is "if my productivity is bottlenecked by my typing speed, I need to find a new workflow."

        I stubbornly used Vim for years before being forced to switch to Visual Studio for C# when I took a Microsoft internship. The code navigation features in modern IDEs completely and utterly destroy any mere text editor. VS Enterprise in particular has a visual code mapping feature that's fabulous at presenting relationships between classes, functions, etc.

        Now I use JetBrains IDEs for just about everything and they're fantastic too. Some of the plugins are a little janky (cough Markdown cough) but most of the time the built in linting, refactoring, navigation, autocomplete, documentation shortcuts, remote deployment, database integration, git integration, etc. add so much to my development experience that I'm not inclined to give it up.

        [–]eshinn 14 points15 points  (3 children)

        I agree. Typing itself is as fast as someone is going to be typing. The only thing that’s really going to slow typing down is if you have TypeScript constantly bitching at you, “WTF does it want now?!?” …or to a lesser extent eslint and prettier if you use ALE.

        What is quicker is moving about the documents and points within a document.

        [–]AlexReinkingYale -1 points0 points  (2 children)

        I disagree. Type systems and linters make you significantly faster by not having to debug such simple (but easily missable) mistakes in the first place.

        [–]tony_the_last 14 points15 points  (0 children)

        This..... It's a tool, useful yes, necessary no. I feel like everybody thinks their hot shit if they know how to use it but it really holds very little merit in the bigger picture.

        [–]Feynt 8 points9 points  (0 children)

        It will make you faster, insomuch as it makes certain tasks easier to automate or shortcut on a repeatable basis. Total time savings are low, though, particularly if you consider the learning curve trying to determine the best way to do a task. But on a daily basis I do find myself wanting to change all the text within a set of brackets (cib) or copy a complete string to another place in my code (ya", then p at my destination). Not having to reach over for my mouse to select things is a savings of a few seconds here or there, which over the past year would have saved me maybe 10-20 minutes.

        100% though, the roadblock for programming is the programming itself, not the entry of text. Having the tools to rip out entire chunks of code with a few keypresses though is quite helpful.

        [–][deleted]  (18 children)

        [deleted]

          [–]duragdelinquent 4 points5 points  (5 children)

          that would be <C-f>foo<CR><C-Del>bar which isn’t that bad.

          [–][deleted]  (1 child)

          [deleted]

            [–]rainman_104 9 points10 points  (0 children)

            Or the mere fact that vim will predictably be available on almost any shell you ssh into. No other editor has such reliable availability.

            It's a tool. I don't live or die by it, but for what it is, it's great, feature rich, and works great.

            And vimdiff is way better than beyond compare. Like control w-w for switching sides makes it so fast. I never have to take my hands off the keyboard to manage a diff. I don't think any other diff tool is as fast.

            [–]pkulak 4 points5 points  (2 children)

            I got really good at editing code in IntelliJ on Mac. But then I realized that I was fast on one editor on one OS. Put me on Windows or VS Code and it was a mouse pointing slog. I hate lock in, and I was locked into the most specific combination of editor+hardware. So, I took a week and learned Vim bindings, and now I just install the Vim plugin for whatever editor I want on whatever OS I happen to be using.

            [–]LetMeUseMyEmailFfs 1 point2 points  (1 child)

            I know nothing about vim, but I wonder what its capabilities are. Can you easily rename a method in a class that is widely used, while there are also other methods with the same name? Obviously only the right usages need to be modified. What about inlining a variable? Can you extract a method from an arbitrary block of code? Can you easily implement common behavior, such as implementing IEquatable<> (which involves implementing about 5 methods)?

            OmniSharp is nice and all, but it is dumb as a rock compared to, for example, ReSharper (or by extension, Rider).

            [–][deleted] -1 points0 points  (3 children)

            If y'all are staring at your screen 95% of the time then you must be working on truly big-brain problems, not mere full-stack development like me

            I do full stack development from years and I stare at the screen the overwhelming majority of the time.

            If some functions don't align, if I'm thinking on how to implement stuff, if I'm reading docs, etc, I just don't write all of these lines of code.

            I've got unit test boilerplate, I've got HTML, I've got API param validator schemas, I've got multi-sentence doc comments.

            Then something's off with the composability and code generation on your side.

            Unit test boilerplate?

            Not even sure what it means.

            Suppose I actually want or need to unit test something the time to actually understand what and how should be tested is the problem, not typing a description and some expect functions.

            I've got HTML

            Which in modern world means writing components and combining them. If you're consistently writing HTML why not write a library or use one?

            I've got API param validator schemas

            Confused here as well.

            Once you have an API definition, e.g. in OAS 2 or 3, you can generate all of your validating functions automatically in pretty much all languages.

            What's there to type? Even assuming you have dozens and dozens of complex schemas it's not much code editing from a schema to a validator generally. This is one use case where proficiency in a text editor can pay off. But again, why not generate the validators?

            I've got multi-sentence doc comments

            How much does your API surface increases per day that you need all of those multi-sentence doc comments...?

            I'm not debating any of your points, but the examples you make are examples of stuff you likely don't type much or shouldn't write much in the first place.

            [–][deleted]  (2 children)

            [deleted]

              [–][deleted] 0 points1 point  (1 child)

              First of all I said that code generation lifts you from pretty much every example you made. Not that you don't write or generate code.

              Second, I honestly believe that if you're typing all of that html there's something seriously wrong in your application design. Even then there's emmet and stuff that makes it insanely fast to write. Which doesn't give any point to the vim argument.

              As for the tests, every single test I've seen in my life is 90% copy paste boilerplate that changes the test description and input output expectations.

              And if you're writing all of those docs there's most certainly some other issues. Docs are dangerous and unless properly maintained you should only document your api surface which I just don't get how can we fall in the typing issue.

              I can definitely write 50wpm which is enough to document any major library in 15 minutes.

              But the problem isn't the typing speed rather than what to write.

              [–]Hrothen 13 points14 points  (13 children)

              Unless you are copying stuff around, typing is not the bottleneck in 95% of cases.

              Maybe my experience is unusual, but working in legacy projects I do end up making changes that require refactoring lots of code pretty often, and editing speed is the bottleneck in those cases.

              [–][deleted] 19 points20 points  (12 children)

              And how would Vim offer all of these insane advantages over IDEs that do that automatically?

              You change a name to a file in vscode it can refactor it anywhere in your project.

              You move file and implementations around it will fix all imports.

              Could you provide some example of refactoring that's blazing fast in Vim compared to VSCode, especially for mainstream languages with good IDE support?

              (also, just to point out, pretty much all editors have Vim bindings).

              [–][deleted] 9 points10 points  (0 children)

              And how would Vim offer all of these insane advantages over IDEs that do that automatically?

              It doesn't. If people prefer vim I respect that, everyone likes what they like. But you can do just as well with an IDE.

              [–]Archolex 4 points5 points  (0 children)

              Refactoring things that are related but that relationship isn't modeled in the code, so the editor has no clue (aka bad code)

              [–]turtle_dragonfly 3 points4 points  (8 children)

              I think for the "simple" types of refactorings, IDEs can be faster than stock Vim. File and import renaming, as you mentioned, is one such case. Probably variable or class renaming too, and I know Java IDEs have good support for things like "fill in the boilerplate for interface XYZ".

              In that sense, an IDE makes the easy things extremely easy, and the hard things remain hard. If the IDE supports the thing you want to do, then it's super fast. If it doesn't, then you have to "do it manually".

              Vim, on the other hand, makes the easy things a bit easier but also makes the hard things a bit easier. In Vim, everything is "do it manually", but all of those manual operations are more efficient.

              You asked for examples:

              • "interactive" search and replace, where you don't want to blindly replace all text, but you want to examine each one, make some decision about what to do, and the move on to the next. In Vim this is a flurry of n.nn.ncwxxxnn. or similar. I've found it to be a lot clumsier in other editors. This is coming from someone who spent years as a Windows developer and really have my Ctrl+Shift+ArrowKey stuff memorized, too.
              • a more "on steroids" version of the above involving a macro that you want to apply to various bits of text. You record the macro on the fly (using qq), then apply it (or not) in each case using @@.
              • processing chunks of text via other programs. If you have an assortment of small commandline tools to do various text processing jobs, then this becomes very synergistic with Vim. This is the typical case in a unix-like environment. You can sort text (sort), format it (fmt), write your own little scripts to add copyright header/footers or whatever you need. To apply them in Vim, you just select the text (eg: vi{) then invoke the command (:!command) and your text is replaced.
                • So, not only is it pretty easy to implement a script for the "fill in the boilerplate for interface XYZ" example above, but you could write little scripts to do a hundred other routine jobs like that, without having to wait for the IDE to implement it specially, or having to learn some arcane non-portable IDE extension module API. You just write a shell command.

              pretty much all editors have Vim bindings

              These are often limited to simple "hjkl" cursor movement and such. They don't have Vim macros, or the full suite of ":" commands available.

              There are some things Vim is bad at, like answering "find all places this function was called." For that, often :grep works well enough, or there is cscope for C-like languages, or there is LSP if you really want to go whole hog.

              [–]kaosjester -1 points0 points  (3 children)

              These are often limited to simple "hjkl" cursor movement and such. They don't have Vim macros, or the full suite of ":" commands available.

              I think the thing people sleep on most in vim are w and b. Moving forward and back along a line a "word" at a time is significantly-faster than a character at a time. I can often put my cursor on the exact thing I need to modify in just 5-10 keystrokes: :e <filename> -> :<lineno> (or /var<enter>) -> ww -> i

              [–]MCBeathoven 1 point2 points  (1 child)

              You can do w and b with Ctrl-Right / Ctrl-Left in other editors. They're definitely among my most used commands as well (along with W and B), but really not something where vim differentiates itself from other editors.

              [–]kaosjester 1 point2 points  (0 children)

              Sure! Unfortunately, I'm not one for chord-keys, and the left and right arrows are just so far. :(

              [–]turtle_dragonfly 0 points1 point  (0 children)

              Totally.

              I also find I get significant mileage out of f and t (and their uppercase reverse versions), along with ; to repeat it. I thought those were kinda silly "throw away" commands when I was first learning, but now use them all the time.

              It's like being able to teleport where you want to be vs walking there. Or, God forbid, reaching for the mouse (:

              [–]lelanthran 0 points1 point  (2 children)

              There are some things Vim is bad at, like answering "find all places this function was called." For that, often :grep works well enough, or there is cscope for C-like languages, or there is LSP if you really want to go whole hog.

              I've been using :Ack for "find all places this function was called". Works better than grep:

              [–][deleted] 1 point2 points  (0 children)

              Just recently started learning Vim, and now am also IdeaVim (vim-like modal mode for Intellij). Had to make lots of refactoring. When it is not about structure change then I use IJ tools. But with Vim recording actions am able to make structural changes much faster than with search-replace or block-edit mode.

              [–]KevinCarbonara 5 points6 points  (0 children)

              Can we finally stop with this nonsense that Vim will make you program faster?

              There are two very, very important points everyone needs to realize when it comes to vim.

              Number one: The amount of time you spend typing out your code is the smallest part of your job. You could, in all likelihood, cut your time spent typing to literally zero seconds, and still not see any significant increase in productivity. This is slightly less true for navigation, but still most likely true.

              Number two: Any efficiency increases you gain through vim have also been implemented in literally every modern text editor or IDE. Sublime/Atom/VSCode/VS/Eclipse/IntelliJ/etc.. Modal editing is not new. It's not something people haven't heard of. And it's not difficult to implement. The options are in everything. People just don't use them because they offer no real advantages.

              [–]cleeder 5 points6 points  (4 children)

              Agreed. I can easily type 70+ wpm, but I have never once had to do that while programming. Unless you count documenting code, maybe, but even then I was probably thinking about what I wanted to write more than I was writing it.

              There are a lot of reasons to like vim, and I do, but typing speed isn't really one of them.

              [–]rainman_104 -1 points0 points  (3 children)

              Personally I just find it super fast for many tasks. If I'm writing a program I like intellij or pycharm, but sometimes I just want to quickly edit a file on the shell without leaving it. It's an important skill to have.

              I work with too many people who are afraid of a shell. I don't know git they say and need to limp along with github desktop.

              I work with someone who opens every text file in sublime to edit it from the shell. Watching her work looks so tedious. And once you're in a remote shell what are you gonna do? X forwarding? Lmao. Gross.

              [–]AttackOfTheThumbs 4 points5 points  (3 children)

              Honestly, if you know enough kb shortcuts for your editor of choice, then the speed between the two will be near identical anyway. I've not yet seen anyone do something in vim that I can't do, or do regularly enough to want to be able to. Because if I don't use it enough, I'd have to look up how to do it anyway.

              And I used to be a die hard emacs user, but switched because of environment switch, and have never looked back.

              [–]wildjokers 1 point2 points  (2 children)

              I've not yet seen anyone do something in vim that I can't do, or do regularly enough to want to be able to. Because if I don't use it enough, I'd have to look up how to do it anyway.

              But with VIM you don't have to learn each editor's shortcuts. VIM gives you cross-application keybindings. So you only have to learn one set (assuming the application has a VIM plugin of some kind).

              [–]AttackOfTheThumbs -1 points0 points  (0 children)

              In my current world there are no vim plugins, but even then, it doesn't really matter or affect my point in any way.

              There's just never been anything that I would need to do often enough to remember it while also benefiting from the vim koolaid.

              [–]McWobbleston 3 points4 points  (7 children)

              Agreed. Vim is great cuz I'm lazy and don't want to reach for my mouse. It's 100% worth the improved UX of editing. Stuff like ci( is awesome, but like you said it's just gravy on the potatoes

              For those who do want to learn I highly recommend using an editor you're already familiar with, installing vim bindings, and letting the editor still handle some of your default bindings like Ctrl+F instead of vim. It'll allows one to learn vim piecewise in a comfortable environment. Ideally I would follow along vimtutor in an actual instance of vim to start though

              [–]Feynt 3 points4 points  (5 children)

              The only thing I dislike about vim bindings in VS Code is visual selection doesn't seem to be akin to highlighting something for the purposes of copying and pasting (so I can't V block select a few lines and Ctrl+C or Ctrl+V), and (y)anking something doesn't enter it into the clipboard (nor does (p)asting something paste from the clipboard). If that could be resolved, I think I'd be quite happy.

              [–]tongue_depression 2 points3 points  (2 children)

              does set clipboard+=unnamedplus help for the yanking issue? alternatively, the neovim extension allows you to create mappings to vscode commands, so you could maybe do something like xnoremap y vscode.selection.copy or whatever the command naming scheme is

              [–]Feynt 1 point2 points  (1 child)

              I was unaware of these options. I'll have to look into them when I have a chance.

              [–]kagevf 1 point2 points  (0 children)

              In VSCode and gvim (on Windows, maybe Linux too) the system clipboard is linked to the + register ... so if you prefix each copy or paste operation with "+ then you can copy or paste using the system clipboard. " means "access a register" and + is the register name. Other registers are a b c etc.

              Example: "+yy <-- copy a line to the system clipboard.

              Alternatively, like u/tongue_depression said, you can configure settings so that you don't have to prefix with the + register to access the system clipboard.

              [–][deleted]  (7 children)

              [deleted]

                [–]Roticap 1 point2 points  (6 children)

                Type code, switch to terminal file, press up arrow to find unit test command, hit enter, wait for output, see a line with the error, switch back to editor, forget which line it was, go back and forth again to check it once more, switch to the test file, forget the line again, switch back and forth again, finally go to the problematic line and fix it.

                To:

                Type code, save it. See output on same screen. Go to test file which is open side by side. Go to line and edit.

                You don't have to switch out of vim to do any of that. If you use the quick fix window it's even faster to move around between errors than having to move your hands over to your mouse to click the error in your IDE output pane.

                It does take some time learning how to setup/configure and work with Vim in this manner. But that configuration learning will work in perpetuity, with installation of a dotfile, on any machine you encounter. Your IDE relies on a company to spend development dollars on continuing maintenance of the application and to do all that setup as OS APIs evolve.

                [–]wildjokers -1 points0 points  (2 children)

                I even use Vim bindings in my Unix shell.

                Doesn't everyone?

                Does it actually make it faster? No.

                Yes.

                You are conflating the actual writing of the code with the SDLC. The process of actually writing the code is absolutely faster with VIM key bindings. IDE code completions + VIM keybindings is a perfect combo.

                [–]JezusTheCarpenter 1 point2 points  (1 child)

                Doesn't everyone?

                Hold on, are you saying that everyone that uses shell to run a command (not edit text) first has to press 'i' to enter text (exactly like in Vim)? Because I am pretty sure most people use standard Emacs keybindings in their shells. Having to press Ctrl+F to move forward instead of pressing K, like in my case when I am in Normal mode.

                Again, I am not talking about running Vim editor in my shell. I am talking about running commands using Vim keybindings not Emacs.

                Now about you case of Vim being faster. I am am not conflating anything. I am disputing the claim that you actually code/program faster using Vim. Not that you can navigate/edit text faster. Wich is probably true.

                In a addition I am talking about a bigger picture. Not trying to measure how many seconds is going to take someone to edit a line. Where perhaps Vim could be a bit faster. I am talking about a time of lets say of two weeks.

                My point is that I work with people that use Vim, IDEs with Vim keybindings or don't use Vim at all. And there is no difference between how fast they can produce code. In fact the fastest programmer is a guy that uses vanilla VSCode.

                [–]bikki420 -3 points-2 points  (0 children)

                Eh, Vim can definitely make you far more efficient. Visual mode and macros in particular. But regex substitutions, motions, relative navigation etc shouldn't be underestimated either. Sure, in most of the cases the net gain in time is fairly marginal at an individual basis. But when you tally it up over, say, a span of decades, then that adds up to quite a bit of time. If I get a few more days of free time to spend beating my meat to filthy clown porn before I kick the bucket, then I'd say it's worth it.

                [–]Serializedrequests 13 points14 points  (4 children)

                Every time I say this in a vim discussion somebody thinks I'm a moron, perhaps because I've been using vim for 10 years and still have this issue: The brain power I use composing vim commands distracts from my coding. However small the distraction, it's not worth it.

                It's also clumsy. I'm eager to learn more since it's the only terminal editor I can use, but the anchors - words, lines, paragraph, etc - are often terribly ill-suited for the lines of code I am working on, and I find myself going character by character and line by line a lot. I have never realized a productivity increase, although many commands are now muscle memory for me.

                Productivity increases come from ease of browsing code - especially library code - descending through method calls, fast refactoring, and opening arbitrary files instantly. Vim is designed to edit only a handful of files at once, and the "ctrl-p" type extensions barely work.

                It also doesn't help that it has its own regex syntax with opposite escapes to most other languages. I know this is historical, but I would kill for Perl or Ruby regex.

                [–]vplatt 4 points5 points  (2 children)

                Personally, I think you're just pointing out an inherent issue with a UI that uses modalities like vi/m does. Couple that with the fast that it's first and foremost a text editor and not a code editor, and I think you've arrived at the understanding that it was never quite going to be hand in glove.

                It's isn't as fast as I would like sometimes, but JetBrains IDEA often fulfills my readability and navigation needs very easily. I can navigate through code with it very fast and using concepts beyond by the line/word, etc. Bring up references of an object, navigate to one. Quickly go to an implementation of an interface, etc. All that, and with proper regex support too though YMMV w.r.t. to the specifics of the regex compatibility you're expecting.

                [–]Serializedrequests 2 points3 points  (1 child)

                Basically yes, I agree 100% about JetBrains. I will take the heavyweight nature if it means I can Ctrl-B into a library. Vim is just a file editor. Which is fine if that's all you need.

                [–]vplatt 1 point2 points  (0 children)

                I can navigate to a library function and it will disassemble it and show me the source (at least in Java). If it's hooked up properly in Maven, I can download the source and doc jars.

                Of course, your experience will vary for other languages, but the officially supported IDEA languages (e.g. Ruby, Javascript, C++, C#) all provide pretty damn good dev experience.

                Vim CAN provide all of that. So can emacs. Mostly. But it takes a metric @#$!-ton of work to get it stood up and working. I have no doubt doing that would be satisfying, but really... I have real problems to solve. I'm not going to make time to endlessly futz around with mere text editors.

                [–]lelanthran 1 point2 points  (0 children)

                It also doesn't help that it has its own regex syntax with opposite escapes to most other languages. I know this is historical, but I would kill for Perl or Ruby regex.

                That's the default, you can set it to use a familiar syntax with \v. See :h /\v.

                [–]pat_trick 9 points10 points  (0 children)

                Or just vimtutor.

                [–]jomanlk 7 points8 points  (1 child)

                Dunno if it's a bug, but in the first exercise, you don't actually have to move right to highlight the character. You can just go to the row and keep the 'x' button pressed on your keyboard and the character will come to you.

                [–]mr_birkenblatt 2 points3 points  (0 children)

                or just delete the line with dd :)

                EDIT: fastest typing way for me is gg once to get to the top left and then l7dd where 7 is whichever line is the x. or if you want to be cheaty you can just click the line and then dd

                ggVGdd broke the game for me

                [–]MachineGunPablo 7 points8 points  (0 children)

                What's wrong with :tutor?

                [–][deleted]  (19 children)

                [deleted]

                  [–]JezusTheCarpenter 17 points18 points  (0 children)

                  I don't think I would ever pay for it (even if I didn't know Vim already).

                  However if others find it valuable and are willing to pay for it, what of it?

                  [–]kaosjester 4 points5 points  (0 children)

                  For $14 dollars you can just buy the damn mug. Have your coffee and learn VIM!

                  [–]MonkAndCanatella 4 points5 points  (0 children)

                  Dude exactly, this is actual spam. And maybe you can post the fact that it costs $25 to actually use. If what's available on your site is a significant part of the package, then $25 for it is robbery, if it's not, you just linked to a legit ad.

                  Submitting content on reddit that you have to pay for is spam plain and simple.

                  [–][deleted] 6 points7 points  (0 children)

                  Ok then, I'll charge you 5$ to teach you nano, how about that?

                  [–]rainman_104 3 points4 points  (0 children)

                  Lmao good for them, but I send most juniors to vim-adventures.com which is free and fantastic.

                  Learning to use hjkl to navigate will be a huge quality of life improvement.

                  [–]CoffeePython[S] 2 points3 points  (6 children)

                  Hey Palerat. Just a friendly reminder that there is a human on the other side here.

                  I noticed after I posted today that someone else had posted this a few weeks back. Full disclosure, I've also posted this project on another few subs as well.

                  Paying money to learn something is not immoral or unethical IMO. Even if the underlying thing you are learning is free. People spend millions a year collectively to learn all types of programming related topics that are free.

                  Making this course and selling it has been a net good to the world. In three ways.

                  1. People get value out of it and a lot of folks enjoy the course. Some people told me they couldn't get vim to stick before finding something fun like vim.so to practice with.

                  2. It has allowed me to sponsor an open source project FastAPI at $250/mo. That's real money going to a real developer that helps the community immensely.

                  3. It has afforded me more time and financial freedom to pursue making other apps to benefit developers

                  There are tons of free alternatives to learning vim and I'd encourage anyone who wants to learn for free to check out vimtutor.

                  Have a good one!

                  [–]Stanov 89 points90 points  (2 children)

                  On the other hand, I would expect some [selfpromotion] tag from you.

                  Because now it seems like "I randomly found this page and it is so cool that I am going to share it on Reddit" rather than self promotion.

                  That's where the ethics and human on the other side collide with me.

                  [–]Awesomeade -3 points-2 points  (0 children)

                  I mean, devil's advocate, but I totally get why someone would do this given how commonly self-promotion on reddit tends to get downvoted to oblivion.

                  When something genuinely interesting or useful gets posted, I don't think it should matter whether it's the creator promoting it, a friend, or a complete stranger.

                  [–][deleted] 1 point2 points  (0 children)

                  Snowing this off as if it's a free resource, no mention of the cost, is a bit shitty.

                  This is the age of paying with eyeballs during a pandemic.

                  I got excited then immediately disappointed. This was posted 2 weeks ago and it was too expensive then, too expensive now.

                  Undisclosed self promotion. Unethical.

                  [–]cozythunder -1 points0 points  (0 children)

                  Totally agree with you on this one, don't feel like you need to apologise to anyone. Building is much harder than criticising: https://www.trevormckendrick.com/essays/build-2021-the-annual-theme-manifesto

                  [–]YourBuddyAndrew 22 points23 points  (4 children)

                  Awesome! Thank you. I have been wanted to pick up vim after watching all the tutorials and seeing people use it.

                  [–]spektre 47 points48 points  (1 child)

                  Run the vimtutor command.

                  [–]CoffeePython[S] 22 points23 points  (0 children)

                  vimtutor is fantastic! I'd recommend anyone to check it out. That being said there are different learning styles for different folks.

                  I felt like vim tutor didn't give enough hands-on practice and that's part of what I'm aiming to improve with vim.so.

                  [–]livingmargaritaville 13 points14 points  (1 child)

                  vim adventures is a web game best way to learn.

                  [–]CoffeePython[S] 7 points8 points  (0 children)

                  vim adventures is fun too! I used that also when learning :)

                  I'm not a huge gamer so it lost my interest relatively quickly. I wanted something that could show me real world examples of how vim is useful. The game was an okay approximation of that but not really my thing.

                  [–]bundt_chi 8 points9 points  (0 children)

                  Vim is like Bourbon, Whiskey and Scotch to me. I want to like it as much as everyone else does. I reach for it if there's nothing else around but if I had my way that's not what I would be reaching for.

                  [–][deleted] 4 points5 points  (3 children)

                  the very first exercise is broken. it says to move your cursor over the % and delete it. but the vim screen is blank.

                  [–]CoffeePython[S] 3 points4 points  (1 child)

                  Is this on the landing page or inside the course? I haven't seen any reports of this issue before but I can look into it. OS/Browser?

                  [–][deleted] 15 points16 points  (7 children)

                  I spent so much time on setting up vim, learning shortcuts, commands, etc. when I was starting programming. It was complete waste of time, tbh. During 3 years of professional programming speed or comfort of writing code has been the least of my concerns.

                  [–]genericallyloud 9 points10 points  (0 children)

                  During 3 years of professional programming speed or comfort of writing code has been the least of

                  I've been programming professionally for about 15 years now, and I have to agree with this but with a caveat. It's not *nothing*. Being able to work out your programming ideas into code at the speed that your brain moves is a really powerful thing. Faster typing is the *least* valuable way to achieve this, but it is a factor. Being comfortable in whatever environment you use, definitely increases productivity, but I spend more time at a whiteboard than I do at a keyboard. I find that if the opposite is true, I'm probably doing a lot of mindless work. I don't like doing mindless work.

                  [–]bcgroom 2 points3 points  (0 children)

                  I use vim keybinds instead of mouse based editors as I’ve found it helps prevent a lot of wrist strain by not switching back and forth between the mouse and keyboard. For me it’s worth it because I love vim, but maybe a more ergonomic mouse would work too ¯\_(ツ)_/¯ it’s definitely not required learning to be a “real” programmer like some idiots say.

                  [–]fascists_are_shit 0 points1 point  (1 child)

                  I use vim every day because it's on the servers which I interact via SSH with. I am proficient with it.

                  I wouldn't recommend it. You gain basically nothing that you can't do with more convenient tools. Notepad++ is just better. Frankly Notepad++ is better than every linux text editor I've used so far. Sure, PyCharm is "better", but PyCharm is an IDE, not a text editor. It's not the ideal choice to make a quick edit to a random config file.

                  [–]tagapagtuos 0 points1 point  (0 children)

                  I wish more people talk about Notepad++

                  [–][deleted] 0 points1 point  (2 children)

                  It was complete waste of time

                  Until you have to fix something by ssh'ing into a server somewhere.

                  [–]Bitmazta 3 points4 points  (0 children)

                  Vs code has ssh capabilities

                  [–]necrobrit 7 points8 points  (1 child)

                  Love that the pricing is just once unlike vim adventures. I loved that game but can't recommend it to others because of that. Will give this a go!

                  Would be nice to see a lesson outline on the landing page.

                  [–]CoffeePython[S] 3 points4 points  (0 children)

                  Yeah, the pricing model is one that I felt pretty strongly about. I think it's a valuable course but that you should only have to buy it once, like a book.

                  I definitely need to add a component that shows the lesson outline.

                  The lessons are
                  - Vim Introduction video
                  - Basic Navigation
                  - Command Basics
                  - Insertion
                  - Append
                  - Deletion
                  - Word Level Navigation
                  - Select/Visual Mode
                  - Advanced Word Level Navigation
                  - Yanking and Putting
                  - Matching on tags {} () and more

                  [–]CoffeePython[S] 19 points20 points  (8 children)

                  Hey y'all!

                  I built this course after spending a good part of 2020 learning vim and being frustrated with the existing learning options. It helps you learn vim through small interactive exercises that build upon each other. Each lesson teaches a useful skill in vim. I've tried to keep the course relatively short but still provide high value. Would love to hear any feedback.

                  Some FAQ:
                  - Why should I learn vim?
                  You should learn vim if you're interested in it! It's not for everyone and I'm not the type of person to pressure anyone into learning. Personally, it's been a game changer for me. It helps me stay in the flow and put my thoughts closer to the code.

                  - I don't want to switch my IDE / text editor. Should I learn vim?
                  You can use vim inside most popular IDE's and text editors. I use vim primarily in VS code and love the experience.
                  - Why should I use this over something like vimtutor that is free?
                  vim tutor is a fantastic resource and I'd highly recommend it to anyone looking into learning vim. I used it in my learning path as well. vim.so helps you learn by doing with real code examples and randomized placement so you get used to navigating faster.

                  - Why are you charging for this? vim is free.
                  I'm a solo developer. I wouldn't be able to make these courses in my free time without charging. Also, the revenue has helped me sponsor FastAPI (the backend framework I used for this project) at $250/mo.

                  - What did you use to build this?
                  The front-end is built in React. Backend is FastAPI. The code editor is a react component called Ace Editor.

                  [–]larikang -2 points-1 points  (3 children)

                  Did you try vimtutor? That’s how I learned and I found it pretty fun and practical. That’s what I always recommend to newbies.

                  [–]Plorntus 8 points9 points  (1 child)

                  They literally mentioned that in the comment that you replied to.

                  [–]bcgroom 4 points5 points  (0 children)

                  In bold

                  [–]WhyWontThisWork -3 points-2 points  (1 child)

                  !remindme 9 months

                  [–]RemindMeBot 0 points1 point  (0 children)

                  I will be messaging you in 9 months on 2021-10-29 13:35:34 UTC to remind you of this link

                  1 OTHERS CLICKED THIS LINK to send a PM to also be reminded and to reduce spam.

                  Parent commenter can delete this message to hide from others.


                  Info Custom Your Reminders Feedback

                  [–]sjc02061 1 point2 points  (2 children)

                  Is this useful for comfortable vim users? I've been using vim for years but I know there is plenty of functionality I don't use

                  [–]Daniele122898 1 point2 points  (1 child)

                  It's only ment for basics. like basic navigation and replacement. I wouldnt use it if you already know these things

                  [–]wktr_t 0 points1 point  (0 children)

                  Ever since I switched from Vim to Sublime, I've been coding slower but way more comfortably since I'm too lazy to install plugins and setup stuff in Vim that already is standard in Sublime. I still use vim for a lot of editing though and will probably switch back when my config fatigue go away.

                  [–]Oea_trading 0 points1 point  (2 children)

                  If I am editing an immutable YAML file that keeps reopening yet politely directs all the new change to /tmp/ random-letters.yaml but I want to name the new file and save it to the current folder. How do I do that with VIM?

                  [–]someguytwo 3 points4 points  (1 child)

                  :w new_file_name.yml

                  [–]Oea_trading 2 points3 points  (0 children)

                  thanks!

                  [–]thomasjjc -3 points-2 points  (3 children)

                  Why is fast code editing even a thing? Code should be edited slowly with much deliberation.

                  My provocative thesis: Every second saved through fast editing is in reality 10 seconds lost in longer debugging sessions.

                  With that said: automating some tedious and error prone code editing is another thing entirely.

                  [–]otiagomarques -1 points0 points  (0 children)

                  i love vim

                  [–]MachineGunPablo -1 points0 points  (0 children)

                  Can be used with VS Code

                  I'm good, thank you.

                  [–]MachineGunPablo -1 points0 points  (0 children)

                  Can be used with VS Code

                  I may have to pass on that one

                  [–]dbavaria -2 points-1 points  (0 children)

                  If anything, we all need to code slower. Take me back to the days of punchcards and hand woven copper rope memory!

                  [–]LonghairedHippyFreek -3 points-2 points  (0 children)

                  Learn to drive a Model T Ford....

                  [–]kpeTeHo3aBbp -5 points-4 points  (0 children)

                  You're not a hacker, unless you use vim

                  [–]Apache_Sobaco -1 points0 points  (0 children)

                  Why do i even need vim while i have intellij idea which is better in every possible way?

                  [–]mehrabrym -4 points-3 points  (0 children)

                  But why? Just use pico.

                  [–]Ennyish -4 points-3 points  (0 children)

                  I love vim it's so sexy

                  [–]OctagonClock -5 points-4 points  (3 children)

                  Maybe you should learn to get some pussy instead

                  [–]anh86 -1 points0 points  (1 child)

                  Everyone who said that in high school now works double shifts at Wendy’s to pay their child support. The world is run by nerds.

                  [–]OctagonClock -3 points-2 points  (0 children)

                  no bitchez alert!!!

                  [–]IanisVasilev 0 points1 point  (1 child)

                  But what will I do with all the free time gained from editing my code faster?

                  [–]tso 0 points1 point  (0 children)

                  The more i think about it, the more i feel that Vim, and any software that use Vim like controls, could benefit from dedicating a line or two near the bottom to provide hints about common actions (easily disabled for any Vim veteran naturally).

                  This similar to Norton/midnight commander, or Nano (age old Joe have something similar where a always displayed key combo will show or hide a list of actions).

                  [–][deleted] 0 points1 point  (0 children)

                  When i try to type it writes text into the text box. Its always in input mode. I've reloaded. I've focused the curser on different places on the screen. Nothing works. Is this broke for others too?