« BackVIM Mastergithub.comSubmitted by Fluffyrnz 16 hours ago
  • cramsession 14 hours ago

    I'm surprised they don't even mention vimtutor. It's preinstalled on every machine with vim (to the best of my knowledge). This seems like a cool project, but might as well give a shout-out to the original concept.

    • nunez 13 hours ago

      vimtutor is to Babbel what this is to duolingo. Many will prefer learning through a game but some want a more textbook approach. Honestly, anything to get more people on vim and emacs is a good thing in my book!

      • tim-kt 11 hours ago

        > vimtutor is to Babbel what this is to duolingo

        It took me half a minute to realize that you probably meant "vimtutor is to VIM master what Babbel is to duolingo".

        • teo_zero 11 hours ago

          Isn't it exactly the same thing? If a:b=c:d then a:c=b:d.

          • hombre_fatal 9 hours ago

            The problem is that it's not the relationship between vimtutor and Babbel that you're comparing to the relationship between vimmaster and Duolingo.

          • nunez 4 hours ago

            Thats exactly what I meant to say. Thanks!

        • absolute_unit22 10 hours ago

          I actually opened this hoping it’ an alternative to vimtutor but for experienced/intermediate users.

          Is there such a thing? I feel like someone has probably made something this - something that progressively works through soem of the more complex features of vim.

          I’ve found soem absolute gems mostly through online blogs and reading through vim docs

          If anyone has any repos that’d recommended I’d be happy to try!

          • TrainedMonkey 10 hours ago
            • godelski 5 hours ago

                >> hoping it’ an alternative to vimtutor but for experienced/intermediate users.
              
              I think you missed the part where the parent said this...
        • ptarjan 2 hours ago

          https://www.vimgolf.com/ is what taught me to VIM

          • baalimago 2 hours ago

            I like the idea of vimgolf, but almost every "good solution" is a regexp replacement. Which is a problem since outside of vimgolf, I've very rarely used i. The usecase of vim regexp is quite narrow, basically only used in converting files between formats (a task I'd rather use other tools for)

          • MrResearcher 11 hours ago

            I generally recommend to exit either via :xa (save all & exit) or :qa! (discard all and exit), bound to ZZ or ZA respectively. If you exit via :q or :wq, it just closes the current buffer, and moves to the next one. E.g. if you have a neotree open along with the editor, you type :wq, it closes the editor buffer and moves you into the file tree, which can be very confusing for beginners.

            • prmoustache an hour ago

              There are cases where you would not necessarily want to save all buffers. To me it is an eletrical term.

              • nurple 10 hours ago

                Neotree `close_if_last_window` config setting is helpful for this case.

                • pwillia7 10 hours ago

                  just do :wq :wq :wq :wq etc

                  :P

                  • johnisgood 25 minutes ago

                    That is what I do. I thought I was the only genius.

                    • yakshaving_jgt 3 hours ago

                      Noooooooo!

                      Make some key bindings. Bind leader to space, and make a leader mapping for writing to the file, and another mapping to quit. Avoid chords.

                      • Izkata 10 hours ago

                        :wqa is the same as :xa and is probably easier to remember

                        • opan 7 hours ago

                          Are you sure? IIRC :x only writes the file again if there's a change where :w(q) always writes again (which takes longer when editing a remote file via scp://). For a non-exiting version of :x there is :up. I bound :up to <leader>fs after I learned about it. I used to have :w on the same keybind so it was a straight upgrade. Now I can just quick hit it at any time and there's no waiting around if the file hadn't changed. Saves some time and annoyances.

                        • MikeTheGreat 7 hours ago

                          What does the :P command do?

                          /s

                          • nthdeui 2 hours ago

                                                                                    :P :Print                                                                                      
                              :[range]P[rint] [count] [flags]                                                                                                                        
                                                      Just as ":print".  Was apparently added to Vi for                                                                              
                                                      people that keep the shift key pressed too long...                                                                             
                                                      This command is not supported in Vim9 script.                                                                                  
                                                      Note: A user command can overrule this command.                                                                                
                                                      See ex-flags for [flags].
                      • nickandbro 14 hours ago

                        Very cool site! Working on my own similar project:

                        https://vimgolf.ai

                        To learn new vim motions. Have since gotten distracted by life, but need to actually finish it.

                        • _diyar 13 hours ago

                          Neat idea! Nit: maybe offer the first few exercises without requiring a login, that way I can get a feel for it before deciding to sign up.

                          • mac-attack 12 hours ago

                            The required login/sign-up, privacy policy and lack of apparent open-sourcing seems antithetical for the average Linux user. You're going after a niche of a niche of a niche with this one, good luck lol.

                            • rs186 12 hours ago

                              I'd argue that the average Linux user likely knows how to use vim for the most basic editing but isn't necessarily motivated to learn vim. Intermediate users will be able to name a few modes in vim and navigate somewhat efficiently, that's about it. Only advanced users and those who really want to master vim (in other words, hardcore nerds) will try to make the most out of vim and use as few strokes as possible to navigate/edit, which is what these tools/sites are for. That's a few "niches" there.

                              • opan 7 hours ago

                                I think once you start trying to use the occasional macro and/or make custom keybinds it pushes you further into the vim golf mindset. When you're saving an action to be repeated 100 times you really gotta get it right. I learned a lot of advanced movements due to macros as well. Like } and ) and marks (only just recently learned apostrophe jumps to marked line while backtick jumps to marked character on the line after years of always using apostrophe). I recently spent a half hour or so making two keybinds to insert the date/time in my preferred format at the end or start of a line + return the cursor to where it was before. While about half of the process was the same for both binds, I ran into multiple issues with the start of line version. Like, `I` for insert at start of line in neovim places your cursor after whitespace instead of before it, so instead had to use 0 and then insert stuff relatively. Also found out marked characters are based on the numbers of characters into the line, so if you add new stuff to the start of the line and then return to your mark, you won't be on the same word. 14 characters in before, 14 characters in now. I worked around that by counting how many I was inserting with my date text + spaces and such, then adding that # and l (move right) to the end of the keybind to make up for the difference. It was pretty satisfying when it finally worked.

                                • nickandbro 6 hours ago

                                  You are truly a vim master. Yes, that's exactly the reason why I used containers to host the vim instances, as using a DOM based vim library wouldn't record each stroke accurately. Thank you for trying my site out.

                              • nickandbro 12 hours ago

                                Good feedback

                                • fuzzythinker 3 hours ago

                                  Will you be removing the sign-up/in then?

                            • raldu 12 hours ago

                              Back from when those screencasts were a thing,

                              http://vimcasts.org/episodes/

                              • eej71 16 hours ago

                                There is also this one

                                https://vim-adventures.com/

                                • ixwt 15 hours ago

                                  I think this one asks you to pay for it after a bit. Not that there's anything wrong with that. Just felt bad about getting a little bit in, and then being hit with a decent pay wall.

                                  • jrm4 15 hours ago

                                    Right, I mean, author has the right to do this -- but it still seems like a gloriously stupid thing to try to get someone to pay for in this way; like what market is this?

                                    Like, I'd bet "Pay $10 if you like it" / ReaperWare would earn this person literally an order of magnitude more money.

                                    • omidmash 14 hours ago

                                      Yep. I was trying to buy some licenses for my school, and they only offerend subscriptions in which I am not interested. A shame! Such a great game.

                                      • Dilettante_ 11 hours ago

                                        >ReaperWare

                                        What does this mean? All I found on the Google was a company that produces sim racing gear.

                                        • hug 9 hours ago

                                          Presumable the pricing model for Reaper? https://www.reaper.fm/purchase.php

                                          • jrm4 5 hours ago

                                            haha you got it

                                            Wait, I'm the first to say that? That should be a thing.

                                      • reddare 15 hours ago

                                        Thank you for the warning.

                                        I found a pricing dialog after clicking “buy a license”, it said that six months of full access to the game costs $35.

                                        • JoshTriplett 15 hours ago

                                          Personally, I would happily pay for vim-adventures, but never monthly. It provides one-time value, it should have one-time cost. I'd much rather pay a one-time cost and get a downloadable local copy.

                                        • nomilk 14 hours ago

                                          I paid for it, was worth it for me. Reason: I did vimtutor 4 times and was learning but found it super painful/boring, but really wanted to learn vim keybindings. Vim adventures made learning keybindings and muscle memory just tolerable that I could do 1h in the evening even after a long/busy/tedious day. I probably would have persisted learning vim keybindings without it, but it definitely made doing so less painful.

                                          • merelysounds 13 hours ago

                                            A free alternative for learning just hjkl, nethack supports this way of moving[1]. Remember to keep your index finger on ‘j’ (don’t shift your hand to ‘h’), to build the muscle memory.

                                            [1]: https://nethackwiki.com/wiki/Direction

                                          • palata 9 hours ago

                                            I paid once, but it's valid only for 6 months. I would reuse it once in a while for fun, but I won't pay again and again.

                                          • godelski 12 hours ago

                                            This was quite weird and honestly a bit infuriating. Just felt like it was encouraging really bad habits in vim.

                                            You start out and you only have `h,j,k,l` available to you (despite what the help says). So just end up holding the keys and maybe that's fine but then that first level is WAY too big.

                                            Like I got to the second area and it starts talking about word motions and then you try `w,b,e` and it then tells you those keys aren't available. That's not even the first character you talk to that is mentioning movement keys while those keys remain unavailable to you!

                                            I rage quit after unlocking `w,b,e` and moving back to that chest at the beginning only to realize I had forgotten there was a space between the word and punctuation meaning I'd need to unlock something like `B`, `0`, `^`, or even the ability to use numbers which a character had already mentioned to me...

                                            [1/10] do not recommend. I believe most people will be able to read half of `vimtutor` before you will unlock the `b` key in this game as well as have a much better understanding of how vim actually works.

                                            I highly suggest vimtutor to people because what a lot of people miss while learning vim is that there isn't actually much to remember. There's sets of motion keys and sets of command keys. The beauty of vim is that the commands are putting these together. For example, say you learn `b,w,e` and then you learn `d`. You now automatically know `db, dw, de, dd`. You didn't learn 4 new things, you learned 1 new thing. Similarly learning `B,W,E` isn't learning 3 new things, you learn one new thing: capitalized motion keys work on WORDS instead of words (aka: big movements)

                                          • benjaminclauss 15 hours ago

                                            These little tutorials and games are great. I played VIM Adventures.

                                            However, one thing I really struggle with is learning when I can be doing something more efficiently. I rarely use markers, anything beyond default registers, commands, and so on.

                                            I'm giving Neovim a try for my systems course trying to get better but I do wish these sorts of games pushed me to get better at these more advanced usage tricks.

                                            • soperj 14 hours ago

                                              Oh man, I use markers all the time. ma y'a

                                              mark a spot, then yank or delete everything to that line. Way easier to do it accurately rather than 13yy or however many lines you're yanking.

                                              • zeke 14 hours ago

                                                You can use <shift>v then move to your start line and type y or d. This way you see the text marked before yanking or deleting. <control>v is similar. And gv will reselect the marked area.

                                                • dwater 13 hours ago

                                                  And if you have line numbering on you can y123G. I learned enough Vim 25 years ago to be good enough and I'm happy I did. When I was writing code every day I picked up a little more but I've lost most of it, and what I'd want people to know who are considering it is you never need to be a Vim Master. You can learn enough Vim in 30 minutes to make it beneficial to you for the rest of your life.

                                                  • Izkata 10 hours ago

                                                    I turn on relative line numbering so that y123G might be y8j and vim will show me the 8.

                                                • ramses0 13 hours ago

                                                  ma, mb, mc => 'a, 'b, 'c => ...just being able to "tag" each of the three functions you're working with (comparing, copying, moving code, whatever) it's eventually worth it to get them into your muscle memory. And once you "get" marks, then you "get" registers "for free".

                                                  • soperj 11 hours ago

                                                    and this is why i always read vim articles... i've never used registers in my life.

                                                    • ramses0 5 hours ago

                                                      I'll use them in macros fairly frequently: vawy'f => function name, vi{y'b => body, vi(y'a => args

                                                      ...or y'x to keep something kindof handy that I can drop in at the right place (sometimes with a macro...)

                                                          qadi('xpq => @a => @@...
                                                      
                                                      (Record macro "a", delete inner parentheses, paste from the "x" register, stop recording => play macro "a" => play last macro...)

                                                      If I keep "x" clean/protected then I can delete or edit the rest of the time all willy-nilly and not worry about clobbering what I'm trying to paste into the right spots.

                                                • j1mr10rd4n 9 hours ago

                                                  > learning when I can be doing something more efficiently

                                                  hardtime.nvim[1] (or vim-hardtime[2] if you're old-school) do exactly this but within your editing session. There's an associated blog post[3] explaining the rationale behind some of the workflow choices and you can of course bring your own.

                                                  [1]: https://github.com/m4xshen/hardtime.nvim

                                                  [2]: https://github.com/takac/vim-hardtime

                                                  [3]: https://m4xshen.dev/posts/vim-command-workflow

                                                  • codyb 11 hours ago

                                                    I created a ViM Message of the Day script that I added to my shell to give me a prompt every time I opened a new shell (Which I do constantly in ViM and Tmux since I've created leader key shortcuts in both)

                                                    https://github.com/cboppert/motd

                                                    You might have to futz with it a bit, and I think I've added some other stuff in there since then (love the toggle-light-mode script which toggles several things either to Dark or Light mode at once so I can switch environments easily, however have never gotten it to fully automate, so I have to manually type goDark or goLight depending. Humbug!)

                                                    Anyways, it's great cause it gives you one tip or command at a time, and so you can sort of slowly grow without really having to dedicate much time to it.

                                                    • JackMorgan 6 hours ago

                                                      I wrote up some exercises to help build the muscle memory of advanced vim commands: https://github.com/steveshogren/10-minute-vim-exercises/blob...

                                                      • charlie-83 10 hours ago

                                                        Check out vim golf. They are fun puzzles but you also realise lots of little optimisations you can incorporate into regular use

                                                      • ekusiadadus 7 hours ago

                                                        The fact that Vim has been debated for decades is proof that it’s one of the greatest pieces of software.

                                                        • rochak 2 hours ago

                                                          For me, it is close to perfect.

                                                        • pixelentry 14 hours ago

                                                          This one is also nice to get going: https://www.vim-hero.com/

                                                          • johnhamlin 10 hours ago

                                                            I got the muscle memory for hjkl down by playing https://vimsnake.com/

                                                            • jrh3 7 hours ago

                                                              Remapping my CAPS LOCK key to the ESC key is the greatest keyboard hack ever.

                                                              • qezz 11 hours ago

                                                                Cool idea, yet the first level broke me: typing :qa enters Insert mode, and it's not possible to delete the command input with a backspace.

                                                                Hopefully it's easy to fix

                                                                • jama211 12 hours ago

                                                                  Even though I don’t have much use for vim, and I have opinions on tools like this going beyond a certain level of efficiency because IMO the true bottleneck is usually decision/design based not implementation based, this just kinda looks fun and the appeal of vim as just a thing that feels cool to use when you have mastery of it sounds cool.

                                                                  Kinda like how it feels good to play an instrument when you’re good at it, or something.

                                                                  I might give it a try!

                                                                  • drwu 12 hours ago

                                                                    Agree that decisions/designs are important.

                                                                    However, not everything can be well designed at the beginning. Skills of editing will affect efficiency, especially in a try-and-error loop of new ideas/approaches, where only a rough design exists.

                                                                    Besides, some niche editing tasks (which may involve column editing, macro recording then batched execution, regex based operation, encoding transformation etc.) may otherwise require writing awk/sed or even perl/python scripts as subprojects to achieve, if one does not known the editor well.

                                                                    • jakupovic 11 hours ago

                                                                      >column editing

                                                                      I haven't seen any other editor that comes anywhere near the capabilities provided by VIM. I spend a lot of time manipulating data into columnar form and for anything early vim does it effortlessly.

                                                                  • DavidCanHelp 10 hours ago

                                                                    Here's 8 chapters on how to exit Vim: https://github.com/cloudstreet-dev/Vim-with-Vigor

                                                                    • jack_pp 10 hours ago

                                                                      What I don't understand is how anyone who actually learned the basic movements can go back to using arrows or mouse to move inside text. Like sure, use VScode but if you actually took the time and know how to move in vim when will vanilla editing beat vim plugins for popular editors?

                                                                    • chamomeal 10 hours ago

                                                                      Learned vim with a game like this. It was a vscode extension, I don’t remember what it was called.

                                                                      Anyway it’s easily the best time investment I’ve ever made, period. Takes a couple days of messing around, and you can basically never leave modal editing behind! It’s just so much better. I’m still not even a vim master. Just the basic motions and commands are enough to never want to give em up. Throw macros and registers on top… delicious.

                                                                      Also without vim I never would have tried helix, which is just absolutely the smoothest and most frictionless editing ever. Very minimal setup, too

                                                                      • godelski 10 hours ago

                                                                          > I’m still not even a vim master.
                                                                        
                                                                        I can do some things that people using vim for decades didn't know was possible. I'm still not a vim master. How does one ascend to the levels of TPope?

                                                                        Joking aside, I think that's one of the nice things about vim. There's always more to learn. Not in the way that you're missing something but in the same way this is true for any programming language. It's because these tools are so flexible they can do just about anything

                                                                        • ramses0 5 hours ago

                                                                          Vim isn't an editor, it's an interactive programming language for text processing.

                                                                               :%norm 0f"ldt"i...
                                                                          
                                                                          There are so many times (even per day) where I'll say to myself: "ahhh, I'll just 'vim' it rather than writing a program..."

                                                                          If I'm not going to have to do it a bunch, sometimes vim itself is faster than writing a script to do whatever random task I need done.

                                                                          • godelski an hour ago

                                                                            Try `vim -c`. Or better, in your terminal press <C-x><C-e>

                                                                        • MikeTheGreat 10 hours ago

                                                                          Searching for "vim game" this is the only thing I found:

                                                                          Vscode Vim Academy

                                                                          https://marketplace.visualstudio.com/items?itemName=kaisun.v...

                                                                          Does that look like what you used?

                                                                        • alabhyajindal 10 hours ago

                                                                          Tried the challenge mode - would like to see support for Ctrl + [, acting as escape!

                                                                          • godelski 10 hours ago

                                                                            Also on team <C-[>!

                                                                            Why remap? This is native. Maybe your keyboard has brackets in a tough place but that also makes it sound like it's hard to use arrays

                                                                          • sheerun 14 hours ago

                                                                            I like how it starts with how to exit vim, but let's be honest: word jumps are not that common to teach second

                                                                            • twile 14 hours ago

                                                                              This is cool, I would love to see some more rounds and vim lessons! I use a lot of these basics on the daily.

                                                                              • omidmash 14 hours ago

                                                                                I really dig this. I might work on it a bit to include it in my lessons.

                                                                                • linhns 14 hours ago

                                                                                  Nice job. Ideal next level should be macros.

                                                                                  • indoordin0saur 14 hours ago

                                                                                    Yeah, this is a great idea. Seems like there are others out there. I am intermediate in VIM and use it very frequently so the basic stuff I have down, but I am slow when doing advanced things. If anyone has a game like this but has advanced topics and is good for practicing those advanced topics I'd love to hear about it.

                                                                                  • joshcsimmons 11 hours ago

                                                                                    cute but should go much harder/further

                                                                                    • absolute_unit22 10 hours ago

                                                                                      That’s what I’m kind of looking for. Something that shows more advanced features.

                                                                                      I feel like most of these tutorial like apps just scratch the surface and are more beginner focused.

                                                                                    • ixtli 13 hours ago

                                                                                      Needs more levels!

                                                                                      • jasoneckert 8 hours ago

                                                                                        Ah, yet another brave soul seeks to gamify the ancient art of Vim. Admirable.

                                                                                        But Vim is not merely a tool... it's a discipline. A lifestyle. It is not learned in an afternoon, nor in a weekend sprint of neon-highlighted tutorials. No, Vim is best learned like one reads a long, weathered tome: slowly, reverently, one page at a time.

                                                                                        It begins humbly: i to whisper your intentions. <Esc> :wq to seal your work with a sacred rite. Then, perhaps days or weeks later, a revelation: "Wait… I can delete four lines with 4dd?!"

                                                                                        You do not master Vim. You grow into it. Each new keystroke discovered is like finding a hidden passage in a familiar castle. What begins as a cryptic incantation eventually becomes second nature... muscle memory and magic intertwined.

                                                                                        So yes, make it a game. But know that Vim is not beaten. It is befriended over years, not minutes.

                                                                                        • hexasquid 2 hours ago

                                                                                          Anyone can learn :q to quit vim

                                                                                          But can anyone truly quit vim? No

                                                                                        • mac-attack 12 hours ago

                                                                                          Played around on the official website until i tried to delete a word and closed the tab by a mistake. Saved it for future reference.

                                                                                          Edit: Went down a rabbit hole and see pacvim (https://github.com/jmoon018/PacVim) is in the official Debian repo as an option as well.

                                                                                          • compass_copium 9 hours ago

                                                                                            ed Master when?

                                                                                            • chasil 12 hours ago

                                                                                              I really don't want to learn much more of vi than is documented in the POSIX standard:

                                                                                              https://pubs.opengroup.org/onlinepubs/9799919799/utilities/

                                                                                              I'm in busybox and on OpenBSD quite a bit, and all the vim embellishments would be a clutter of my neurons.

                                                                                              • jnwatson 11 hours ago

                                                                                                Cool that you're into retrocomputing, but many of the rest of us think perhaps some features added to vim from the last 30 years might be useful.

                                                                                                That vi was standardized was one of the many failures of POSIX as an idea. The very idea that we should freeze a text editor for all time is silliness in the extreme.

                                                                                                • JdeBP 8 hours ago

                                                                                                  Don't let on that OpenBSD does not have vi either. Its vi is actually nvi, yet another vi clone, that Keith Bostic derived from elvis.

                                                                                                  • chasil 11 hours ago

                                                                                                    While you may be a detractor, Apple appears to be an ardent admirer.

                                                                                                    https://www.opengroup.org/openbrand/register/

                                                                                                    • enneff 8 hours ago

                                                                                                      Yet they ship macOS with vim installed and zsh as the default shell.