[HN Gopher] Show HN: I built an online interactive course that h...
___________________________________________________________________
Show HN: I built an online interactive course that helps you learn
Vim faster
Author : CoffeePython
Score : 630 points
Date : 2021-01-20 13:46 UTC (1 days ago)
(HTM) web link (www.vim.so)
(TXT) w3m dump (www.vim.so)
| ehershey wrote:
| It would be nice if you at least listed what the exercises are
| before asking for money.
| geordigeordi wrote:
| I agree to a degree. Listing a bit more about Vim itself for
| someone that might be coming from a development background but
| does not specifically know about Vim and it's benefits could be
| good, and maybe what TYPE of exercises will be involved (What
| will I be be able to do at the end) - but keeping the exercises
| a little secretive is great to keep interest :)
| buzzerbetrayed wrote:
| Wow, this is incredibly scummy. Basically your logic is, "If
| they knew what I was selling, they wouldn't buy my course.
| But if they don't know then I might trick a few of them in to
| buying something they don't want".
|
| edit: Note, I realize this isn't OP that I'm replying to. Not
| sure if what I wrote makes that clear.
| tomwojcik wrote:
| Couldn't find it anywhere either. Here is the list from twitter
| https://twitter.com/KennethCassel/status/1351916897823059970
| 488pista wrote:
| Thanks for this I always used nano or pico because it was easy
| and always wanted to use vi but found it really strange like to
| exit & save you have to do :w! or something like that.
| basher wrote:
| https://vim-adventures.com/ -- this one is perfect for kids (and
| free iirc)
| zappo2938 wrote:
| Make it multi player via websockets and a server
| rav wrote:
| Nice trial exercise on the front page. While trying it out, I
| wanted to use the backspace key, which in Vim moves to the last
| character on the previous line (when used on the beginning of a
| line, that is), but that didn't work - backspace on the start of
| the line doesn't seem to move the cursor at all.
|
| I was pleasantly surprised that cw and D are implemented
| correctly though, so props on that!
| mdaniel wrote:
| > backspace on the start of the line doesn't seem to move the
| cursor at all.
|
| AFAIK that's controlled by "set backspace=" and thus will vary
| based on one's .vimrc (or the system vimrc, installed by the
| package manager):
| https://stackoverflow.com/questions/18777705/vim-whats-the-d...
|
| One can see the current value of the backspace setting via
| <ESC>:echo &backspace
| exabrial wrote:
| sudo apt -y autoremove nano
|
| Sorry plebians
| mr-wendel wrote:
| Want to learn vim and make it stick?
|
| 0. Learn the basic movements and UI interactions. Do NOT use the
| arrow keys. Your future self will thank you tremendously.
|
| 1. Search DuckDuckGo for "vim cheatsheet" and find one that
| provides a good summary of commands thats organized to your
| liking.
|
| 2. Print it out and post it somewhere easily accessible to your
| working space.
|
| 3. Each-ish day, review the cheatsheet a bit and pick one one new
| kind of command that looks useful. Try to integrate that command
| into your workflow throughout the day. It'll be clumsy at first,
| but after you do it a few times you'll be surprised at how much
| faster this gets.
|
| Focus on movement and editing first. Take note of sequences that
| seem to take a lot of work, as almost guaranteed there is a
| faster way you can integrate in later.
|
| Once you've got a small core built up, do another review and
| research more specialized topics:
|
| - .vimrc, colors, and customization
|
| - plugins
|
| - buffers, windows, etc for quick workspace organization
|
| - macros ... and macros within macros!
|
| - visual blocks
|
| - various useful commands for advanced editing (e.g. regex based
| find in replace in an entire doc or visual block is epic)
|
| Give yourself time and try not to be too loud when you have your
| first "A ha!" moment when you randomly try a completely new key
| combo that you think _should_ work and it actually does exactly
| what you hoped.
| spondyl wrote:
| I have Vimari (Vim keybindings for Safari) installed and so
| pressing Esc and trying to navigate inside that window just
| scroll my actual browser window :( The irony
| TsukiZombina wrote:
| No
| Tepix wrote:
| If you want to internalize the vi cursor keys hjkl a good and fun
| way to do it is to play "hunt" (part of the "bsdgames" debian
| package, man page at
| https://manpages.debian.org/unstable/bsdgames/hunt.6.en.html ).
|
| Hunt is a text based 2d multiplayer labyrinth deathmatch game. It
| even has a unique feature: Labyrinth walls that you can shoot and
| that will eventually regrow (sometimes different than before).
| varbhat wrote:
| Before trying these courses , Please try _vimtutor_ that comes
| bundled with vim . After practicing with _vimtutor_ , you can try
| these additional courses.
| ajfjrbfbf wrote:
| I started with vimtutor, then installed IdeaVim in all my
| Jetbrains IDEs, it took me about a week to reach the same level
| of efficiency I had before.
|
| I don't understand how some people can say the learning curve
| is too steep. Sure it's a bit annoying at first, but it quickly
| becomes natural, and you don't have to use all features at
| first. It has allowed me to improve my touch typing a lot.
| Learning a programming language is a lot more work but hardly
| anyone ever complain about it.
|
| It's been maybe two months and I wouldn't think of using
| anything else than vim for serious code editing.
| sverhagen wrote:
| > I don't understand how some people can say the learning
| curve is too steep
|
| I am doing fine with vim for basic editing tasks and use it a
| lot (mostly when I'm already in the command line). But
| there's just only so many shortcuts I'm capable of
| memorizing. This is not a problem for me exclusive to vim, of
| course. In IntelliJ I also sometimes find an amazing new
| function that I then don't keep using since I've already
| exhausted my limited "inclination" of learning new shortcuts.
| Also, I don't think my productivity gains at this point are
| going to come from faster input anyway. Sorry, vim, it's not
| you, it's me.
| 40four wrote:
| I'm a full time vim user now, and I would say the
| 'productivity' gains are a bit of a pipe dream. That's not
| the reason I would recommend anyone learn vim. The best
| reason for me is that vim is just _fun_.
|
| When you finally become competent, it is an absolute joy to
| work with. It makes me think about editing in a totally
| different way. However the road to get to that point is not
| fun.
|
| I started out with basic tasks in the terminal, & vimtutor
| reps. Then graduated to using a VS code plugin. I would
| turn it on for 10-15 minutes at a time a few times a day.
| Usually turning it off once I realize I wasn't getting
| anything done :) But solid reps everyday over a few months
| and I got to where I learned more complex commands/
| movements. Eventually I never needed to turn it off!
|
| Then I began the configuration & plugin rabit-hole :)
| AlchemistCamp wrote:
| How many years have you been using it full-time?
|
| Do you ever miss the global commands not implemented in
| VS code's plug-in? I still do sometimes, like this:
| https://youtu.be/46Evprns18M
| 40four wrote:
| Full time a little over a year now I think.
|
| Yeah that's a good point. After a while you do start to
| realize the limitations of the VS Code plugin. That video
| is a good example. But once I got to where I could edit
| at equivalent speed I was used to, I dropped VS Code
| completely. I looked at the plugin as 'training wheels'.
|
| I'm not as hardcore as some. I still prefer to use GVim/
| Macvim. I'm not an 'everything must stay in the terminal'
| purist. I know some who are, but I still like being able
| to use the mouse to bail me out sometimes, and always
| have access to the system clipboard without having to
| recompile vim :)
|
| I don't go crazy with config & plugins, but I got my
| setup to where I have all the features I missed from VS
| Code, and that's enough for me.
|
| There is always more to learn though. I feel like I've
| been complacent lately, so you have to remind yourself
| sometimes to make an effort to seek out more advanced
| techniques.
|
| That video is a great example of some of the incredibly
| powerful things Vim can do! I'm a big fan of macros for
| repetitive tasks.
| Agentlien wrote:
| That's one of the strengths of Vim, though. There's a lot
| of structure to it, so you don't need to learn nearly as
| many shortcuts as you otherwise would.
| kkoncevicius wrote:
| first _vimtutor_ and then _:help user-manual_
| 40four wrote:
| The vim help files are fantastic. Well written, and clearly
| explain any feature you need to understand better.
| gbrown_ wrote:
| Yes! Sadly a lot of people skip over this despite vimtutor
| pointing to it at the end. Copy/paste below as the text
| doesn't need paraphrasing, but also because a lot of comments
| here seem to be advocating vimtutor as something more than
| the "brief overview" it is. This concludes
| the Vim Tutor. It was intended to give a brief overview of
| the Vim editor, just enough to allow you to use the editor
| fairly easily. It is far from complete as Vim has
| many many more commands. Read the user manual next:
| ":help user-manual".
| rjvir wrote:
| Looks like "vimtutor" is primarily text explaining the hotkeys.
|
| For me, the bottleneck to picking up vim has not been merely
| knowing the hotkeys, but more internalizing the commands and
| building muscle memory.
|
| The interactive game format of this website could possibly
| solve that, so it appeals to me.
| pksebben wrote:
| vimtutor is designed for you to use it regularly to train
| muscle memory
| D2187645 wrote:
| Vimtutor is free so you are the product.
| ansible wrote:
| Back in the day, playing /usr/games/hunt against other people
| would hone your VI movement keys muscle memory rather
| quickly.
|
| On the multiuser Unix systems at Purdue, it was typical to
| have at least half a dozen people on the server, with
| explosions going off like fireworks. We ran the mod where you
| could collect 200 ammunition for the nuke, which would
| destroy a third of the screen.
|
| https://man.openbsd.org/OpenBSD-current/man6/hunt.6
|
| We also had Larry Wall's (yes, that one) video game Warp,
| which was a lot more action-oriented than the original Star
| Trek video game. It also used the same hjkl movement keys.
|
| http://ftpmirror.your.org/pub/misc/unixarchive/PDP-11/Trees/.
| ..
|
| And of course there was Rogue and Nethack, but those are a
| lot better remembered these days.
| baconsteakey wrote:
| It says this in the 3rd or 4th paragraph:
|
| > It is important to remember that this tutor is set up to
| teach by use. That means that you need to execute the
| commands to learn them properly. If you only read the text,
| you will forget the commands!
|
| And it's free, not 15 USD or whatever this site is charging.
| ketzo wrote:
| Okay... but the difference between a piece of text just
| _telling_ me to use the commands so I remember them versus
| an interactive trainer that provides a structured setting
| for me to use them is pretty significant, no?
| jack_pp wrote:
| vimtutor is interactive. It's a text file that tells you
| what to do inside itself, so you modify vimtutor
| directly.. you would've known this if you had spent 10
| minutes trying it out.
| boogies wrote:
| > a structured setting for me to use them
|
| is provided by vimtutor. I wish people would take a
| couple hundred milliseconds to research things like this
| before posting about them -- most [GNU's Not] Unix
| commands take less time to run than a webpage takes to
| load, and installing their packages takes no more typing
| than a web search.
| reitanqild wrote:
| > I wish people would take a couple hundred milliseconds
| to research things like this before posting about them
|
| Have tried vimtutor twice. It is seriously confusing if
| you don't use US keyboard layout and there are probably a
| couple of other sources of confusion as well.
|
| I did well at school, I do well at work but not so well
| at vimtutor.
|
| So I think I'm kind of qualified to say that there's room
| for other resources besides vimtutor.
|
| Also the way you write it is kind of rude.
| psdhn wrote:
| I don't see anything on this site saying that it
| accommodates any non us qwerty keyboard layouts. Does it?
|
| Also vimtutor requires you to actually use the commands
| on the document. I don't think there is a single key
| press it doesn't explicitly tell you to press.
|
| Maybe do a quick run through so you can give an example
| of a place that is confusing?
| mumblemumble wrote:
| In a really minimalist way. I've been in the process of
| trying to hone my vim skills, and I've been through
| vimtutor more than once. About the only things I can say
| for it is that it's free and it works in a text terminal.
| This online course is promising, and I'm probably going
| to sign up. It's salient. Salient is good. Salience
| promotes faster, deeper learning.
| mhaberl wrote:
| For anyone wondering, you use it by executing vimtutor in
| terminal (not in vim).
|
| Also, you exit by pressing ESC and then typing :q (hit enter)
| libria wrote:
| How fitting that the tutorial for vim needs its own pre-
| tutorial for exiting.
| alfiedotwtf wrote:
| Having seen machines that have hundreds of Vim sessions
| opened because "system integrators" didn't know how to exit
| Vim, it should be the very first thing taught
| johannes1234321 wrote:
| Luckily vim finally got a bit better with that: on a
| Ctrl-C newer versions now show instructions for quitting.
|
| I remember my first vi sessions (typically via something
| like `crontab -e` where it wasn't clear to me it picked
| my "default" editor ... thus didn't know where to read up
| on it ...) some long time ago, where i knew `kill` before
| the right command ...
| Izkata wrote:
| It's also in the tutor, lesson 1.2
|
| But there's actually nothing special about vimtutor here:
| all it does is write a temporary file and then open it in
| vim.
| samstave wrote:
| Before replying to your post I upvoted, I had to hit a link
| called [REPLY]
| scottmcdot wrote:
| vimtutor might be a little too intimidating compared to a vim
| course in a browser.
| CoffeePython wrote:
| Yep I'd definitely recommend the same, vimtutor is great.
| asciimov wrote:
| What does $15 get me? I don't see any listing of the lessons.
|
| Why is this better than vimtutor?
| blangk wrote:
| I would also like to know this - as far as I could see, there
| was only one pretty meaningless lesson about alternate arrow
| keys - IMO, this doesn't sell Vim to a newbie, nor does it sell
| the $15 product
| xalava wrote:
| I know that vim is particularly enjoyed. The site looks nice and
| I wish you the best luck with this.
|
| But for beginners, I now recommend micro as a console text editor
| (https://github.com/zyedidia/micro). It's a one line install with
| all the shortcuts and display that have become a standard across
| editors.
| patrec wrote:
| Does anyone know who had the bright idea to replace vi with
| nano as the standard text editor and why this became some sort
| of standard?
|
| I really don't get it. Vi is unintuitive and unfamiliar to unix
| newebies, but at some point every even half-competent person on
| unix could use it enough to at least do simple config file
| changes. Plus, if you took time to learn it properly, you
| actually knew a quite capable editor. And the beginner
| unfriendliness could presumably have been mostly fixed, without
| much cost to existing expert users. For example by defaulting
| to some helpful status message how look at help and insert text
| (and have cursor keys and Ctrl-S etc. work as "expected" in
| insert mode). Or maybe a message "press Ctrl-D to enter newbie
| mode" that experienced vimers could just ignore but would
| provide CUA style keybindings and modeless editing to everyone
| else.
|
| Instead now everyone has to deal with a new (and for proficient
| users really quite worthless) editor with its own set of
| completely bizarre keybindings (not emacs, not readline, not
| vi, not CUA), but none of the upsides that come with emacs or
| vi's idiosyncracies. Ctrl-O to save? WTF? Literally the only
| advantage over vi is that it displays some instructions at the
| bottom, albeit not in a form any real newbie would understand
| at all.
|
| Nano (and by extension this) feel like the worst of all
| possible worlds -- what am I missing?
| easton wrote:
| The logic I always thought was that if you are working at the
| console on a server and dealing with the default $EDITOR, you
| most likely are doing some kind of emergency maintenance. In
| this scenario, you want to throw the most gentle/easy-to-use
| editor at the user to ensure they don't accidentally
| overwrite a file or something else because they've been
| trying to bring prod back up all night and can't see
| straight.
|
| If you use the box for more than 5 minutes a year, you'll
| probably change it to vim or whatever you prefer anyway.
| xalava wrote:
| I've just realized that nano was initially released in 1999!
| Apparently, they just copied pico key bindings, that was used
| as an extremely light editor.
|
| For the rest, there is to me a cultural divide between a
| sysadmin/dev culture with abstract interfaces, specific key
| bindings and options, configuration files, ... and the
| thousands of people with various backgrounds that are
| learning tech today, including the console, just to do
| something using computers.
|
| Micro is probably the best of both worlds. Try editing an
| admin file as a user and save.
| windexh8er wrote:
| I think some (maybe vim experts) jumped a bit too quickly to
| _vimtutor_. In some regard, I agree. But I tried the initial
| exercise on my 8 year old and was impressed, so I purchased to
| have access to the rest. I 'd say I'm a sub-par intermediate vim
| user - knowing enough to know that I don't know or use the true
| power of vim day to day, but have memorized a few "tricks" that
| seem to impress basic vim users. Hoping I can leverage this to
| break a few bad habits I've gotten into. Nice UI and I think the
| pricing is fair. Hopefully the content expands, but even if the
| service isn't around more than a few years I feel like the $15
| will have been worth it. Nice work!
|
| Edit: question for Kenneth - do you plan on expanding the
| content?
| CoffeePython wrote:
| There's been decent demand for some more advanced lessons. I'm
| considering adding more. Anyone who has bought already would
| get the additional lessons for free
| chapium wrote:
| There is no way I'd spend money on this. It looks like every
| tutorial on vim, but with a stopwatch. It would be more
| compelling if a TOC or summary of lessons were provided.
| koolk3ychain wrote:
| Hey, would you be open to selling the front end code you've used
| to stand up your course? Very curious of your billing backend as
| well!
| tyingq wrote:
| I do like the idea, but it doesn't seem to support some expected
| features.
|
| Like <esc>:5d doesn't delete line #5. I get "Not an editor
| command"
|
| Edit: Looked into it, and it's using the Ace Editor[1] with vim
| key bindings. Which seems like an odd choice for a Vim tutor,
| since Ace doesn't really try to be a true Vim workalike.
|
| [1] https://ace.c9.io/
| gnubison wrote:
| Implementing a full vi clone seems like a nightmare -- the
| POSIX specification makes me lose hope in humanity :) For
| instance, what does :delep parse to? I would never have guessed
| that it was the :delete command with the "p" flag (because
| :delete p deletes into "p).
| tyingq wrote:
| There's a WASM port of Vim: https://rhysd.github.io/vim.wasm/
|
| You can even do _" <esc>:e tutor"_ to run vimtutor. Also, _"
| <esc>:export"_ does an http download of the current buffer
| contents.
| maddyboo wrote:
| /%<cr>qqnxq@q@@@@...
| fctorial wrote:
| Another useful resource:
|
| http://vimcasts.org/
| brazzy wrote:
| See also https://www.openvim.com/
| _jcrossley wrote:
| Enormous vim fan here. I've been toying with the idea of 1:1
| "tutoring" of beginner vim and other Unix tools. If anyone might
| be interested in a free 1st lesson, send a DM!
| andreilys wrote:
| I've started dabbling in Vim and Unix tools. Would love to try
| out a first lesson, what's the best way to reach you? No dm
| feature on HN unfortunately
| billars wrote:
| now it is time to brag on how gets the best scores in Vim I think
| :) :
|
| Your average time was 0.32s. Click below to share your time on
| twitter and compete with your friends.
| julianlam wrote:
| /%x
|
| Perhaps? haha
| jimmar wrote:
| Yep. Then nxnxnxnxnxnxnxnxnxnx.
| _steady wrote:
| nice site
|
| could do with taking out your console.logs
|
| ```export default function KeyChar(props: any) {
| console.log(props); return ( <span className="text-gray-800 bg-
| gray-100 text-xl leading-5 py-0.5 px-3 border shadow-md border-
| gray-300 rounded-md text-center"> {`${props.keyChar}`} </span> );
| } ```
| russdpale wrote:
| Im immediately in a situation by where my cursor will not move
| but rather types letters.
| thotsBgone wrote:
| Can't remap keys, so colemak/dvorak users are hooped.
| CoffeePython wrote:
| Hey y'all!
|
| I built this interactive course after a year of learning vim and
| finding it to be extremely useful in my day to day development
| experience.
|
| The course is designed to give you lots of interactive practice
| so you can develop the muscle memory needed to effectively use
| vim.
|
| Would love to hear what you guys think about it :)
| alfiedotwtf wrote:
| Well done on building this.
|
| For some meta-advice: ignore all the salty comments in this
| thread... it must be a full moon
| Bluecobra wrote:
| Hello, I tried purchasing the lifetime access earlier with
| Google Pay and accidently bought it twice. I did not get any
| order confirmation email nor do I see the transaction within
| Google Pay. I was able to get in and do the lessons What should
| I do? I apologize for reaching out on a public website but
| there is zero contact information on vim.so.
| CoffeePython wrote:
| Hey, I just saw this. Please email me. Email is
| firstnamelastname@gmail.com
|
| I'm Kenneth Cassel. I think the confirmation should have gone
| to whatever email you use for google.
| enriquto wrote:
| I just see a gray screen (after enabling javascript).
|
| EDIT: with another browser, it seems to work, and it looks very
| cool! But I wonder, what is the interest of learning vim
| _outside of vim_? What are the advantages with respect to the
| similar tutorial "vimtutor" that comes with vim itself?
| CoffeePython wrote:
| Awesome, glad you got it working :)
|
| I use vim inside of vs code and it's been awesome for my
| workflow.
|
| vimtutor is a fantastic resource and I'd definitely recommend
| using it for anyone interested in learning vim.
|
| vim.so gives you more interactive exercises and helps to show
| you real life examples of where and how vim would be useful.
|
| Thanks for checking it out!
| drKarl wrote:
| If you use vim inside vscode check Onivim 2 out
| ahussain wrote:
| I purchased the course but was disappointed that it doesn't go
| much beyond the basics. For example, there is no tutorial on
| the dot (.) command, which is one of the main productivity
| hacks for vim users.
|
| There's also no mention of the slash '/' command, moving to a
| particular line number with 'Shift-G', 'dw' for deleting words,
| or any number of things that are essential to know if you want
| to use vim effectively.
| cassepipe wrote:
| Thanks for the feedback
| arthurcolle wrote:
| What does the dot command do?
| flaviuspopan wrote:
| Repeats the same command previously run. So if you used
| 'ci"' for (change text in quotes) and entered a new string,
| you can jump to a new line and hit . to replay your last
| series of commands.
| arthurcolle wrote:
| I only ever made it to running searches within vim with
| forward slash, but thanks this is useful to know. I love
| only using the keyboard but can never easily internalize
| all the useful macros that can be used.
| max_entropy wrote:
| Thank you for informing us. If the course doesn't even cover
| the dot and dw movements then I'll avoid it.
| akho wrote:
| I don't want to spend $15. Does it just tell you to run vimtutor?
| It should just tell you to run vimtutor.
| fingerlocks wrote:
| Can someone please explain to me _why_ I should learn vim? I 've
| made several attempts in my lifetime because I thought there
| would be some magical "ah-ha" moment, but it never came.
|
| Separate modes for command & insert just feels inherently clumsy
| and slow to me. Is there some other killer feature that can't or
| hasn't been reproduced by modern editors?
| dbrueck wrote:
| Speed of editing files (especially code, but not just code) is
| unparalleled. Anytime I have to use something besides vim, it
| feels like trying to run in knee-deep water - so sluggish.
| webo wrote:
| For me, it's mostly the key bindings rather than the program
| itself. I use vim key bindings on whatever the latest $editor
| is rather than learning its keyboard navigation. I got
| introduced to vim very early on though.
| keithnz wrote:
| there is no reason you "should" other than in some environments
| you may encounter vi so it is worth knowing the basics.
|
| There are many advantages, however, clumsy and slow is a common
| reaction. From what I've seen, some people get so put off by
| the different way of editing that they struggle, they find vim
| a very slow way to do what they were doing before vim -
| character based editing, moving around with arrow keys,
| highlighting, inserting, and deleting maybe with some block
| commands for things like selecting a word or more by using the
| shift key or ctrl key. Maybe with the help of the mouse to
| highlight things and edit. The thing with vi/m is there is a
| language that allows you to do similar editing but has many
| many combo effects, once you understand how things combo
| together, all kinds of things can be done really quickly.
|
| There's no real killer feature though, there's lots of cool
| features, one that often doesn't get mentioned much is that you
| can filter text through external programs, this combos with all
| the motion commands and other things, so very quickly you could
| write a snippet of markdown and change it into html by running
| it through pandoc, or write your own command line tools that do
| custom things, like querying things from your own apis /
| databases etc. Its powerful, because it combos with the rest of
| the vi/m language so you can use it in really creative ways.
| cgriswald wrote:
| I equate it to touch-typing. Do you think about each keystroke
| or do you just type? It's the same way with editing when you've
| learned it. I don't know that it has to be _vim_ but that's
| what clicked with me.
| eecks wrote:
| Spoiler alert: the ah-ha moment will never come. Will learning
| vim help you create the nexr facebook, tiktok, snapchat, insta,
| amazon? Not at all.
|
| Will it help you program better? nope.
|
| Will it help you be a better programmer? nope.
| fao_ wrote:
| > Can someone please explain to me why I should learn vim? I've
| made several attempts in my lifetime because I thought there
| would be some magical "ah-ha" moment, but it never came.
|
| It's faster. I've been using vim motions for almost 9 years at
| this point, 8 years in vim, vi, ex-vi, neovim, etc. Most
| recently I've moved to Doom Emacs (Which feels like an editor
| I'll be using in whatever forms it takes, for the next 20+
| years). The experience of when you get used to it is
| essentially that you are so practiced with the motions that
| they become sub-concsious, muscle-memory. I don't have to think
| about where to place the cursor, figure out where the mouse
| cursor is, deal with a bunch of weird pasting tricks. To delete
| a line I just have to will myself to delete it (using 'dd'),
| just like I don't have to think about the complex action of
| getting up off the bed, I just do it (At least, on days when Mr
| Depresso isn't visiting). Eventually, it feels like the editor
| is part of you. And at this point I can't give up vim motions.
| Editing in anything else is uncomfortable and painful because
| the ease and speed with which vim allows me to do complex
| motions and actions is so convenient.
|
| I can't speak for your experience, but for me I had to struggle
| through it a bit until I found the 'ah-ha' -- that might not
| come for you, or maybe you haven't found it yet, unfortunately.
|
| I would look into using more motions, don't see it as a
| replacement for Gedit, or Atom, or any of the mouse+keyboard
| text editors -- it's not. Trying to use it like those will lead
| nowhere.
|
| The trick that worked for me is to find motions that are
| convenient, and move ESCAPE to a more palatable key -- I
| swapped it with CAPS LOCK, since I pretty much never, ever have
| to use that key (I can always highlight 2 words with `v2w` and
| press `~`, which will swap the case of it, anyway). The
| 'finding of the motions' is important. I spend 90% of my time
| in a text editor moving, and cutting text, rather than typing.
| A motion like `}` allows me to move the cursor down a
| paragraph, `d}` will delete said paragraph, `v}y` will copy it,
| etc. Often I find myself deleting `t`o a place. So I can do
| `dt#` to delete to the comment at the end of a line. ^O will go
| to my previous cursor position, etc.
|
| I would also recommend looking up Practical Vim -- it's
| probably the best Vim handbook out there (Easily accessible via
| genlib if you want to try before you buy), and there are still
| things in there I haven't learned and integrated into my
| workflow yet (For example, `vi)` to fast-edit bracket
| sequences, that I haven't bothered with much).
|
| ---
|
| Regardless of all of that you need to decide if that effort is
| worth it _for you_. I know an extremely skilled programmer who
| writes and deals with extremely complex code just using Gedit
| (previously Geany).
| gnubison wrote:
| In vim, most commands take the form "[count] operator [count]
| motion". When you learn a new operator, you can use it with any
| motion that you know and vice versa; and you can add a count to
| either. To give a few examples:
|
| - gqip to format (gq) a paragraph (ip).
|
| - g?g? to ROT13 a line (doubling the operator makes it operate
| on the current line -- in this case, g?? also works).
|
| - y2w to copy (y) the next two words (2w) -- this requires you
| to be at the start of the word, but you could use y2aw if you
| were in the middle of a word.
|
| - dj to delete (d) two lines (j); see ":h linewise".
|
| - dt. to delete (d) until a period (t.), not including the
| period.
|
| - y% to copy (y) until the matching parentheses (%). If you
| aren't already on one, vim searches until a "(", which means
| that you can use this to copy a C-like function call.
|
| Additionally, a subset of these operators and motions are
| available in plain vi, which is available on any POSIX system
| (Linux, macOS, *BSD, ...)
|
| It should be possible to do this with a "regular" type of
| editor, where you have a keyboard shortcut to, for instance,
| select to the matching parentheses; there just aren't any
| editors (that I know of) with the same range of motions and
| operators as vim.
|
| Not moving to the arrow keys or using ctrl-, alt- far outweighs
| the cost of switching between insert and normal mode.
| rossmohax wrote:
| > but you could use y2aw if you were in the middle of a word.
|
| Wow, how does it work? Why y3aw doesn't fully work for 3
| words (it captures space before the word I started with)?
| vbrandl wrote:
| y2iw should copy without enclosing spaces. My mnemonic is
| "inner word" vs. "a word".
| gnubison wrote:
| Playing around with this, [count]iw seems to have some
| really strange behavior -- I need to do 3iw to select two
| words, 5iw to select three words, etc.? I'm not sure if
| I'm missing something. (I normally don't use many text
| objects; bdw is in my muscle memory instead of daw, for
| example.)
| _proofs wrote:
| perhaps whitespace token is considered a word:
|
| 2 words 1 spaces = 3 tokens 3 words 2 spaces = 5 tokens 4
| words 3 spaces = 7 tokens ... maybe?
| fingerlocks wrote:
| I appreciate the tutorial, but I probably do already "know"
| vim, but it's not part of my muscle-memory. Context switching
| to something like writing an email or filling out a web form
| really makes it not worth getting too comfortable with all
| these esoteric shortcuts. Do you write all of your emails in
| vim and browse the web on the command line as well?
|
| From reading the rest of the replies, it sounds like the real
| answer is "because it's everywhere", which isn't really
| satisfying. I don't work on lots of machines that aren't my
| own (embedded/mobile space, which _don 't_ have vi
| installed!), so I don't actually encounter it everyday
| despite living on the command line.
| sigil wrote:
| > Do you write all of your emails in vim and browse the web
| on the command line as well?
|
| Yes! I use mutt + vim. Composing emails in a textarea is a
| terrible experience by comparison. (Respect to emacs mail
| mode users, that's a great option too.)
|
| I also use w3m for browsing technical stuff, and use tmux
| for copy & paste into vim.
| gnubison wrote:
| Sorry -- I never know when to assume a large amount of
| knowledge or a small amount of knowledge. The worst for me
| is "ctrl-w" to delete a word backward in Insert mode, and
| to delete a tab in the web browser :) Vim is in my muscle
| memory and it's faster for me, so that's why I use it. It
| might be faster for you and it might not be faster for you,
| and if you don't need the portability for POSIX machines
| it's probably not worth the time.
| 2iP1zbR wrote:
| CTRL+W messes me up sometimes. when i'm in split screen
| mode with two panes i'll often tap CTRL+W twice to switch
| panes. very confusing when you forget to exit insert
| mode.
| bmurphy1976 wrote:
| If you live and breath the command line it's a great skill to
| have because it's available everywhere and it's a very powerful
| editor. If you're not a heavy command line user, you are
| probably fine sticking with whatever you already know.
| ttt0 wrote:
| Modern editors often implement a vi mode, so technically
| everything already has been reproduced in modern text editors.
|
| Aside from just decades of experience in efficient editing of
| plain text files over slow connections plus all the modern
| stuff on top, I'd say text objects, which is one of the first
| things you learn about vim. And it's not a web browser.
| Fellshard wrote:
| Higher precision in intent for many standard operations. These
| aren't perfectly Vim commands, but from the Vim-like 'evil
| mode' for emacs, I have some examples of common idioms I use
| frequently:
|
| - 'I want to change the name of this variable. <cw> (Change
| Word)'
|
| - 'I want to copy the contents of this braced block. <yi{>
| (Yank Inside Matching-braces)'
|
| - 'I want to surround this word in parentheses. <vaws(>
| (Visual-mode (region selection) Around Word Surround-with
| Matching-parens)'
|
| You get used to the separate modes fairly quickly. Your
| existing editor already works that way when switching between
| 'region' and 'insert' modes; it's just the command mode that
| throws people off initially. It's not that rough, especially if
| you have a reasonably placed key to return to command mode.
| fao_ wrote:
| > - 'I want to surround this word in parentheses. <vaws(>
| (Visual-mode (region selection) Around Word Surround-with
| Matching-parens)'
|
| Holy shit, thank you. I've been looking for something like
| this for half a decade and never found it (I don't even know
| how I missed it!)
| Fellshard wrote:
| I believe Vim-proper needs a plugin for that behaviour, so
| keep that in mind.
| artificialLimbs wrote:
| bcw()<Esc>P will do it without plugins.
| fao_ wrote:
| Do you know what plugin it is? I will try to search for
| an evil version (Or I could just write my own, but my
| task list is large and my energy very low these days)
| wraithy wrote:
| This is vim-surround by tpope[1]. It does way more than
| just basic brackets!
|
| [1]: https://github.com/tpope/vim-surround
| benjaminogles wrote:
| https://github.com/tpope/vim-surround
| mellavora wrote:
| ysiwb yank-surround-in-word-brackets also does it. If you
| have https://github.com/tpope/vim-surround/ installed.
| Fellshard wrote:
| Thanks for the translation! I'll keep that around for
| future reference.
| spectramax wrote:
| Could you please explain why we use Yank here? From what
| I understand yank puts the surround-in-word in a
| register.
|
| But there is nothing surrounding the word! I thought yank
| was for copying and pasting stuff. I can't understand why
| ysiwb works :(
| gnubison wrote:
| I believe that this is just an arbitrary choice that
| doesn't collide with other keys and is fairly consistent
| with the other keybindings -- cs for changing delimiters,
| ds for deleting delimiters, and ys for creating
| delimiters.
| thesteamboat wrote:
| The thesis of vim is that editing is more fundamental to the
| act of writing than inputting text. The default mode, normal
| mode, is entirely shortcuts to do editing tasks better and
| easier. Moving around the document, and moving or deleting text
| are the primary concern.
|
| What's more, as several other commenters have alluded to, vim
| thinks of editing as a language. There are verbs like cut or
| copy or paste, and there are nouns like [this] sentence or
| [this] word or one word backwards or from here until the letter
| j. Once you start building sentences of editing commands (e.g.
| copy from here to the 3rd next instance of the a line starting
| with 'Hello' namely <y3/^Hello>) the flexibility it offers is
| unparalleled. This is all done from your default context
| without fingers leaving the keyboard. Once you achieve fluency
| (admittedly not a trivial task) there is no context switching
| for any editing task, it becomes reflexive and subconscious.
|
| Other stuff, like macros and registers, or easy access to
| regexes and ex commands help extend this, but the core reason
| why vim is still used today is this strength.
|
| I'd highly recommend another classic response, given here,
| elaborating on the nature of vim as a language for editing:
| https://stackoverflow.com/questions/1218390/what-is-your-mos...
| cartoonfoxes wrote:
| Having worked both as a sysadmin and a developer, vim is more a
| benefit to the former by virtue of its ubiquity. Learn vim if
| you know you will be encountering vim.
| neop1x wrote:
| Because it is full-featured editor running fully in text mode
| (so you can run it on the remote server or over a serial line)
| and uses short commands for most text edit needs. In comparison
| nano provides only very basic feaures (like Notepad) and emacs
| (according to Stallman) is like an operating system with more
| complicated keyboard shortcuts. Of course you can run
| VisualStudio Code over VPN but that would waste too much
| network traffic and the input would lag more.
| jeromenerf wrote:
| > why
|
| There is no reason really, you either hear the call of the wild
| or you don't and it's perfectly fine if you prefer emacs, acme,
| nano or vscode.
|
| The simple fact that the choice is so large is that people
| "click" in many interesting ways.
| Tepix wrote:
| If you work a lot on the command line on UNIX and Linux
| systems, vi is the best choice for many because it is extremely
| widely available and it is also very powerful once you have
| mastered it.
| fingerlocks wrote:
| Sorry, but this is the same non-answer I have heard my entire
| life.
|
| I do primarily work on the command line and I can assign
| $EDITOR to anything I want. So what makes it so much more
| powerful than the plethora of other editors in the space?
| bspammer wrote:
| Vim removes mental load while typing. It won't make you
| significantly faster, or even really a better programmer in
| any measurable way. What it does is make the experience of
| writing text, and especially writing code, far more
| pleasant.
|
| If I ever have to write something nowadays without vim,
| everything feels clumsy and imprecise. If I want to go back
| a couple of words and change something, I feel like I'm
| playing a timing minigame. I have to hold the left arrow
| key exactly the right amount of time. Most of the time I
| overshoot a couple of characters, and have to tap the right
| arrow key to get to the right spot. Now repeat the same
| timing minigame holding backspace. Ah crap I deleted too
| much better undo a couple of times. Now I can finally make
| my change.
|
| All of this is just unnecessary friction between your brain
| and the computer that anyone who hasn't learned vim accepts
| as a fact of life, but it becomes completely intolerable
| after spending the time to learn.
| gnubison wrote:
| If you deal with many machines, it's very possible that
| they don't all have your preferred editor (unless it's vi).
| vi is on _every_ POSIX system.
| tasuki wrote:
| > Separate modes for command & insert just feels inherently
| clumsy and slow to me.
|
| Interesting, I have the opposite experience. In normal mode, I
| can do a lot using very few keystrokes. In editors without
| modes, there's always a lot of keyboard shortcuts which are
| difficult to remember and hard to execute.
| bdamm wrote:
| Because the text motions, once learned, are extremely powerful
| and will cause your relationship to textual data to
| fundamentally change. All while avoiding wrist injury, because
| some critical keys (f, t, g, j, q) are so lettered due to the
| location on the keyboard. Think of your keyboard as more like a
| piano than an alphabet.
| ystad wrote:
| Any similar course for tmux ?
| Twisell wrote:
| Well I think the nice point of doing excercise in a web browser
| is that you can quickly switch to another tab and search for
| daring questions such as " by the way why on earth does this
| monstrosity want me to use hjkl? That don't make any sense!!!!"
|
| https://catonmat.net/why-vim-uses-hjkl-as-arrow-keys
|
| For a mostly data/SQL guy wanting to learn more about coding it
| still don't make much sense but at least I know why and I can
| move on. When I was trying vimtutor in a CLI interface I was less
| curious and more WTF F... this is pure madness kind of mood.
|
| Dunno if I'll subscribe but nice first experience through this
| demo.
| sodapopcan wrote:
| HJKL also allows you to keep your fingers on the homerow at all
| times which is really great. I had issues with RSI that when
| away when I started using Vim properly. Travelling to the arrow
| keys now feels like a painful task to me! Of course, as a
| sibling comment mentioned, hjkl is the worst way to move
| around--"power users" generally only use them to move a
| char/line or two.
| pandemic_region wrote:
| Not when using Dvorak, here's how it maps from Qwerty: H->J
| J->C K->V L->P
|
| Still works pretty well, i've gotten used to it.
| mynameisash wrote:
| Fortunately, j & k are next to each other, and I never
| noticed any disconnect in vim w/Dvorak. I never use h & l
| -- mostly space, w/W, or b/B. But I also learned Dvorak
| before vim, so I never got used to hjkl.
| Jtsummers wrote:
| I played a _ton_ of Nethack in college and adopted Dvorak
| at the same time. hjkl work remarkably well with Dvorak,
| and I found it so much more natural than the same letters
| with Qwerty.
|
| j and k being next to each other makes their relative
| motion sensible still. And the new positions of h and l
| keep them in the correct relative position to indicate
| left and right, but easier to use. The right index finger
| is already on h and the pinky needs to move up one key
| for l. And up/down is now the left hand, with right/left
| being on the right hand.
|
| I've found emacs to be similarly more sensible and
| comfortable, using default key bindings, with Dvorak than
| Qwerty.
| arendtio wrote:
| On the other side, it is probably the most unnecessary
| inflicted pain for beginners. Even after years of using vim
| on a daily basis, I can't get used to hjkl and still use the
| arrow keys. I tried a few times with different approaches,
| but it never lasted more than a few days. So pushing someone
| new to use hjkl for navigation is so unnecessary and just
| kills a lot of motivation for very little value.
|
| Starting with deleting, yanking and pasting would be a lot
| more fun. Even navigation with gg and G plus numbers would be
| a lot more useful too. Like when you get an error message
| that is caused by line 42, you know why you want to use vim
| next time.
| montalbano wrote:
| The way I got used to hjkl home row was by completely
| disabling the arrow keys in my vimrc file (in normal and
| insert modes). I was struggling before that though.
| cptnapalm wrote:
| Opposite problem: I get so used to hjkl, I screw up
| everywhere else for awhile.
| rtlfe wrote:
| I got a fancy keyboard with layers and set one to have
| arrow keys on hjkl so I can use them everywhere.
| bdamm wrote:
| Yup, I wish all text fields had a vi mode.
| johannes1234321 wrote:
| I sometimes use arrow keys (especially when in edit mode
| and I don't want to reach up to escape ...) hjkl really
| shines when combined with other operations like `d5l` or
| even smarter things.
| iflp wrote:
| Maybe the problem is that you are not supposed to rely
| solely on hjkl for navigation? Not sure how others use it,
| but for me most of the navigation are performed with <C-d>
| / <C-u> / search (long range) or f, w, b etc (shorter
| range, usually with modifiers). hjkl are almost always used
| in combination with these to adjust the initial / final
| location of the cursor.
| sodapopcan wrote:
| I don't disagree that it might not be the best thing to
| introduce to new users right off the bat. It's really nice
| if you force yourself to get used to it, but it's also cool
| to never use them. Not using them does give you four free
| homerow keys to map! But they're really nice if you can get
| used to them.
| fantod wrote:
| The most shocking thing to me was that after weeks of
| struggling to get used to hjkl for navigating in vim, I
| realized that I had already been using jk for navigating up and
| down on numerous sites (reddit, gmail, twitter) for YEARS.
| tasuki wrote:
| > " by the way why on earth does this monstrosity want me to
| use hjkl? That don't make any sense!!!!"
|
| Indeed, why? Using hjkl is about the worst way to move around
| in vim...
| runeb wrote:
| When you consider the concept of home row keys and touch
| typing I find it very natural, actually. Its ergonomic and
| very fast if you get into the habit of resting your fingers
| on the home row.
|
| Though you may have been alluding to more powerful movements!
| X6S1x6Okd1st wrote:
| /%<CR>qqnxq19@q is clearly the solution to the "navigate to %
| and delete it"
| drKarl wrote:
| Or f%x
| X6S1x6Okd1st wrote:
| That doesn't finish the challenge
| bdamm wrote:
| It does, actually. But you have to precede the command
| with <num>G to go to the correct line.
| tasuki wrote:
| The correct answer!
| biohax2015 wrote:
| lolwut
| enriquto wrote:
| > the nice point of doing excercise in a web browser is that
| you can quickly switch to another tab and search for daring
| questions such as (...)
|
| On the contrary... I'd say that if you are _outside_ a browser,
| it is somewhat easier to have a browser window side by side and
| ALT-TAB between both. Having two tabs visible at the same time
| is a bit cumbersome.
| MetalGuru wrote:
| On the contrary, having a giant monitor with two tabs open...
| /s
|
| Who cares? So nit. You could hotkey to switch between two
| windows of the same program.
| Deivuh wrote:
| Is there anything similar for emacs?
| teddyh wrote:
| Maybe this: https://www.masteringemacs.org/
| xwdv wrote:
| But why? Vim comes with a tutorial: vimtutor
| kaladin_1 wrote:
| It's "gamefied" vimtutor... Also, he must have learned a tonne
| of vim building the game.
|
| Though, I totally agree with you, haven't seen anything that
| beats vimtutor, except maybe for a vim cheatsheet as reference
| material.
| mihaifm wrote:
| If you're looking to practice the h,j,k,l keys in a fun way,
| simply play Nethack or other roguelikes that support these
| movement keys. In 2-3 hours you'll be flying around the map and
| you won't even know how you're doing it.
| amelius wrote:
| Is there an easy way to kill another vim instance if you open a
| file for the second time in another window, preserving the edit
| buffer?
| Syzygies wrote:
| I liked the first exercise, then I had to use the mouse to
| dismiss my success dialog! I thought the whole point of vim was
| ...
|
| (That's up there with Haskell package management depending on
| "global variables" in a fixed settings file.)
| 0xTJ wrote:
| It seems cool, though I agree that not knowing
| DeanWormer wrote:
| I like how this uses repeated actions to help learn.
|
| A free resource I really like is simply running `vimtutor`. It
| gives you a text file with exercises and you edit that text file
| directly.
| ryan-allen wrote:
| Is there a list of all the types of lessons?
| fokinsean wrote:
| Does anybody have recommendations on how to go from "comfortable"
| to "expert"?
|
| I've been using vim as my daily driver via the intellij plugin
| for a few years. I mostly just navigate and never do anything
| complicated, it gets the job done.
|
| For example I mostly use w, d, o, hjkl, y, p, w, b, t and
| recently discovered the `c+i` combo which is awesome.
|
| But I feel like there's still a side of vim I haven't conquered.
|
| Any tips?
| brianvli wrote:
| I use vim as my main driver at work. Some things that helped me
| out personally:
|
| - Playing some vimgolf and seeing what neat tricks people used.
| This is where I learned about "."
|
| - Going into the deep-end of just using vim (or just vim in
| IntelliJ without the mouse) will make you notice all the issues
| that make you unproductive with only vim e.g getting around
| with only hjkl is really slow so you might investigate other
| ways to navigate or deleting a word always involves getting to
| the end of the word and using lots of backspace may make you
| wonder if there are more efficient ways to do the same thing
|
| - if you decide not to go into the deep-end, just being more
| picky about how much you're spamming certain keys may help you
| gradually incorporate new commands into your flow
| ludston wrote:
| I found that learning q has made coding without vim very
| annoying.
| westoque wrote:
| yes! my path to "expert" was more in the lines of questioning
| my commonly used editing functions:
|
| 1. how to delete text inside a double quote and go to insert
| mode? - c+i+"
|
| 2. how to move to the end of line? - $
|
| 3. how to delete everything before "x" character and go insert
| mode" - c+t+x
|
| ...
|
| EDIT: updated mistakes.
| nsomaru wrote:
| > 1. how to edit words inside a double quote? - "ciw"
|
| ciw will change inner word, ci" will change inside quotes
|
| > 2. how to move to the end of line? - "g_"
|
| $ is generally used as the noun object to represent "end of
| the current line"
|
| > 3. how to delete everything before "x" character" - "ctx"
|
| dtx would delete everything before the next x. ctx would
| delete and then put you in insert mode :)
| westoque wrote:
| thanks for correcting my mistakes :)
| phonebucket wrote:
| > For example I mostly use w, d, o, hjkl, y, p, w, b, t and
| recently discovered the `c+i` combo which is awesome.
|
| In addition to these, I've found (my personal experience,
| ymmv):
|
| 1) f/F to jump to next/previous occurrence of character to help
| navigating within a line very effectively, in conjunction with
| ; and , to jump around within these occurences. 2) use relative
| line numbers in conjunction with your hjkl.
|
| E.g. jump up 5 lines and go to the start of a bracket is
| '5kf('. If it's a nested bracket you want, then '5kf(;'.
| fokinsean wrote:
| nice, thanks for the tips
| jchook wrote:
| Maybe try vim golf for fun.
|
| I would recommend using vim in the console without the mouse
| because your editor will always give you a way out of learning.
|
| Every time you get stuck or feel inefficient, do a web search
| and learn one thing.
|
| Learn to use and love :help.
|
| I think a few plugins can really improve the experience such as
| coc, ultisnips, vim-surround. Also set some settings like
| relative number and highlighted yank.
|
| Some other stuff to investigate... zz and scrolling, folding,
| G, macros, registers, f, $ and ^ and 0, %, }, ctrl-o, ctrl-]
| and ctags, formatting gq = etc
|
| Edit: also remembered enable set hidden and use buffers and
| splits (eg :sbp). Use markers. Also I like the fzf plugin for
| quickly opening files etc.
| blueagle7 wrote:
| Mayte try learn vim the hard way?
| https://learnvimscriptthehardway.stevelosh.com/
| fokinsean wrote:
| This looks great! Thank you!
| windowojji wrote:
| Read the _user manual_. I 'm not trying to be snarky - the user
| manual is explicitly something that isn't the same as the
| reference and the _user manual_ is called out as the next step
| after `vimtutor`.
|
| Start with `:h user-manual` and go from there!
| RMPR wrote:
| Practical Vim by Drew Neil is definitely a way to go. It
| teached me stuff I wouldn't have discovered otherwise.
| colinbartlett wrote:
| I've been using Vim for many years and felt like there was
| constantly stuff to learn. So a partner and I started an email
| newsletter that sends tips twice a week:
|
| https://vimtricks.com
|
| The idea was that by forcing myself to write about Vim
| consistently, I would learn and absorb more and boy has it
| worked.
| clashmeifyoucan wrote:
| thanks for making this! The undo from insert mode1 one sold
| it for me :)
|
| [1] https://vimtricks.com/p/undo-from-insert-mode/
| yjftsjthsd-h wrote:
| Um. I think that's wrong, though. Pressing c-u just erases
| to the beginning of the line in insert mode, it's not an
| undo.
| clashmeifyoucan wrote:
| Ah, I guess should've tried before saying. Just excited
| there's a way.
| yjftsjthsd-h wrote:
| Oh, I was excited too:) So excited that I immediately
| tried it...
| colinbartlett wrote:
| Updated the post, thanks!
| fokinsean wrote:
| Looks great, subscribed!
| clashmeifyoucan wrote:
| As an aside, I love the vim keybinds with IntelliJ combo, vim
| makes it so easy to navigate and perform operations, eg. the
| one I use most being dt<some char> to delete until a char.
|
| Never can seem to get vim selections and deletions right
| though, because it deletes the character after the cursor as
| well so the mouse comes clutch there.
| ttt0 wrote:
| RTFM. Seriously.
| leokennis wrote:
| Hate to be a negative Nancy, but on a bog standard Chrome on a
| bog standard Windows 10, in the first exercise the HJKL keys do
| nothing. The arrow keys do work...
| CoffeePython wrote:
| Oh strange, I haven't had anyone report this bug yet. I'll look
| into it. Thank you for letting me know!
| cbm-vic-20 wrote:
| noremap <Up> <Nop> noremap <Down> <Nop> noremap
| <Left> <Nop> noremap <Right> <Nop>
|
| There, now your arrow keys do nothing, too! (This is a good way
| to "train" yourself to not depend on the arrow keys.)
| password321 wrote:
| Or just use vim adventures, vim tutor for free...
| godot wrote:
| A tangential question, why is .so the new cool TLD to use for
| tech startups/projects?
|
| I know the lack of availability of .com/other common TLDs is a
| problem. I understand the reasoning behind using .io to represent
| software/saas startups (stands for inputs/outputs). I don't
| understand .so though. From what I remember, Notion was probably
| the first high profile startup using it, and it just kinda took
| off. Searching "why .so domain" comes up with nothing except a
| Reddit thread with the Notion founder saying it was mostly
| because it was just an available TLD for "notion" at the time.
| CoffeePython wrote:
| It was just a good domain name that was available and I bought
| it lol. Not sure why the trend exists.
| ketanmaheshwari wrote:
| Just last week we took a detour from our normal project that I am
| doing with my daughter and started teaching her vim. We used
| vimtutor and found it quite useful. I will definitely give this a
| fair trial.
| chris_wot wrote:
| Can I get a list of the areas you cover?
| CoffeePython wrote:
| There are 10 exercises and 1 video that shows how I use vim in
| my normal development workflow.
|
| The lessons are:
|
| - Basic Navigation
|
| - Command Basics
|
| - Insertion
|
| - Append
|
| - Deletion
|
| - Word Level Navigation
|
| - Select Mode
|
| - Advanced Word Level Navigation
|
| - Yanking/Putting
|
| - Matching within tags {} () "
| chdlr wrote:
| Or maybe just read/bookmark this single post:
| https://stackoverflow.com/questions/1218390/what-is-your-mos...
| Havoc wrote:
| That's neat. Inspired me to give it another go. Thanks
| farbrortumm wrote:
| Quick tip, this would make a great gift for people. Would be nice
| to have a "Send this as a gift to someone" option.
| ilaksh wrote:
| I know I felt a constant social pressure to learn vim or emacs
| over the years in order to fit in with those religions.
|
| I gave in to that social pressure early on. But even 30 years ago
| in the early 90s when I started learning vim (and Linux), vim and
| emacs were very dated programs.
|
| Over the course of thirty years I have managed to finally learn
| how to set up syntax highlighting, terminal colors, and spaces vs
| tabs and do a basic cut and paste operation. But the cut and
| paste never works in a sensible way for me and I always end up
| having to fix something after pasting. So I am probably still
| doing that wrong after thirty years. Lol.
|
| I suggest using sshfs or Docker and then you can just use a
| graphical client. Even gedit is a huge advantage over vim in my
| opinion (especially if you also have fish in another window). I
| like how lightweight and simple it is and I think it's really
| underrated. But also VSCode, Sublime, maybe Atom. Maybe WebStorm.
|
| There is nothing wrong with using nano in the terminal. It's more
| modern than vim and probably going to be much more productive. I
| recommend if you are embarrassed about using nano and someone
| asks, think of it as if someone asked you if you are Christian or
| Jewish. You can just say you are agnostic about editors, and use
| a modern tool.
|
| Also take a look at TextAdept in the terminal. It is customizable
| with Lua.
|
| I really like Jupyter Notebooks for lots of things. It's a great
| implementation of literate programming, especially if you take
| advantage of the markdown to explain things thoroughly. Of course
| a lot of teams are not going to like that but there are projects
| where you can.
|
| Back in the early 90s there was this thing called Borland Turbo
| Pascal which had things like mouse usage, automatic syntax
| highlighting, F1 for instant contextual help, an integrated
| debugger. Those were the days. Lol. You can configure vim to do
| all of those things in kind of a janky way, but it's so
| convoluted, I feel like they should award a PhD if you achieve
| that. And they don't. So it's not worth it.
|
| People love to glorify the "power" of vim commands. But it's not
| that way because the original author knew some secret to power
| editing. It's that way by default, because when it was created,
| commands and modes were the paradigm by default because of
| historical terminal limitations. A few people were still using
| Teletype at that time. Real-time editing was not even a thing.
|
| The terminal they initially developed vi on did not have separate
| cursor keys. That's why it doesn't use cursor keys, not because
| it's some deliberate choice they made to save time and be more
| "advanced".
|
| http://xahlee.info/kbd/keyboard_hardware_and_key_choices.htm...
|
| I just feel like not only are people repeating the mistakes of
| their fathers, but even their grandparents at this point. It's
| not 1978 anymore. It's 2021.
| necrotic_comp wrote:
| That's fine!!! I don't think vim (esp. neovim) is janky at all,
| but part of it is how your brain works. If you want to use nano
| or vscode or whatever, there shouldn't be any social pressure.
|
| I think it comes down to how people like to use their tools and
| how they like to shape their working environment. I've gotten
| my vim/linux machines into a place where editing code is
| comfortable, and I'd love to share it with people, but I
| understand that they may not want to do it. And that's fine!
|
| Use what works for you to get your work done!
| ilaksh wrote:
| Also I actually use vim a lot more than VSCode which I have
| not used much.
|
| But I also think I wasted a lot of time over the years
| figuring out how to use it and how to set it up. I am trying
| to save some people a lot of time. I actually think I am
| still wasting time with it and its because of social pressure
| to use an outdated program. Its like some kind of
| psychological thing that has me compelled to be irrational to
| fit in.
| ilaksh wrote:
| It's not something about "how my brain works". That's a
| sneaky way of accusing me of being too dumb to use those
| editors. But the user interfaces from 35-40 years ago are
| bad. Objectively. Unless you are using them on the terminals
| from the 70s or 80s.
| necrotic_comp wrote:
| I am absolutely not calling you dumb! Emacs doesn't work
| for my brain at all, but Vim does. There are lots of tools
| that are made for different kinds of people and they all
| help us towards getting to a certain result.
|
| I don't think it's fair to say that the user interfaces are
| bad, though. The defaults may be bare bones, but the point
| is that they are programmable environments that allow you
| to tailor them to your needs if you want to.
|
| That's it.
| ilaksh wrote:
| Ok, I'm sorry but I believe you are incorrect. People do
| not have different brains that way. Just like they don't
| have different 'learning styles'. That sort of thing is a
| discredited myth.
|
| I also think that it is objectively true and not only
| fair but also important for people to start to point out
| how bad these interfaces are. At some point traditions
| start to become a drag on society.
|
| One of the core principles of user interface design is
| useful defaults. And there are many better modern editors
| with equal amounts of programmability as well as useable
| and useful defaults.
| necrotic_comp wrote:
| I don't understand that line of reasoning, and it seems
| like you're being obstinate for the sake of being
| obstinate. I hope you understand that even though you
| might feel one way, other people may think another and
| there's no orthodoxy.
|
| Have a good day.
| ilaksh wrote:
| Of course people have different opinions.
|
| That's not what you said though. You said brains work
| differently.
| necrotic_comp wrote:
| Brains do work differently - if they didn't, everyone
| would learn at exactly the same pace if given exactly the
| same input, and people would all have the same
| preferences. There's a reason why the term "neurotypical"
| exists.
|
| You don't like what I like, and that's fine, but I can
| tell you that I _like_ the design of older computer
| systems more than I like the design of modern computer
| systems. There 's a reason why I use the tools I do and
| why I can write really good software really fast with
| them.
|
| You can argue that they're dated, and that's fine, but
| you're arguing that if we like them that we're wrong, and
| that's not okay.
|
| I'm realize I'm shouting at the wind, though.
| ilaksh wrote:
| You are interpreting my statement "brains don't work
| differently" here in a disengenuous way which is both
| more narrow and different from the exact context of the
| discussion.
|
| And suggesting that people who don't appreciate vim are
| slow learners. Which is not okay.
|
| But I think we can both agree on one thing. Its not
| productive to continue the discussion.
| AlchemistCamp wrote:
| I don't think calling the subject matter the OP is trying to
| teach "a religion" or predicting downvotes on your comment is
| productive.
|
| The 2nd is definitely against the site guidelines.
|
| To address your other comments, I can share a personal
| anecdote. When I started programming, I basically just learned
| the bare minimum VI commands to get around. I didn't see it as
| "a religion" or a relic from the past, but I saw a fairly steep
| learning curve that wasn't a high priority for me to tackle at
| the time.
|
| Years later, I did get into it. It's been good for me in terms
| of efficiency, but much more importantly, it's been good for my
| health. At the end of 2017, I had severe RSI and from working
| an extreme schedule on a startup and a poor ergonomic setup. My
| wrists were so injured that it hurt to even brush my teeth.
|
| I got an ergonomic keyboard, and made a concerted attempt to
| use the mouse as little as possible (and balance that little
| bit between both hands). I made VIM my primary driver,
| regardless of what other editor I was using. Even on web pages,
| I attempted to use keyboard navigation where feasible,
| especially in email and similar apps.
|
| As a result, I've no healed to where I do full-time weeks at
| the keyboard again and I will probably always be grateful to
| VIM (and Kinesis!)
| ilaksh wrote:
| I'm not allowed to predict the downvotes? I'm just supposed
| to "take it like a man"?
|
| It absolutely is like a religion and an enormous amount of
| time has been wasted with people feeling they need to learn
| how to use these extremely outdated programs with user
| interfaces invented 40 years ago.
|
| I am trying to save some people some time. The fact that you
| are trying to stop me from doing that indicates to me that I
| have committed heresy. That is why you want to have my
| comment declared invalid. It contradicts your worldview.
| Zababa wrote:
| > I'm not allowed to predict the downvotes? I'm just
| supposed to "take it like a man"?
|
| In the guidelines
| (https://news.ycombinator.com/newsguidelines.html):
|
| > Please don't comment about the voting on comments. It
| never does any good, and it makes boring reading.
| ilaksh wrote:
| Okay, if someone shares the same specific type of disability
| due to repetitive stress injury, then yes, that is a good use
| case for vim.
| cupofcoffee wrote:
| Lots of people use vim just to appear hardcore and not because
| it confers serious editing advantage.
|
| Vim itself is a really really bad editor. It's so obvious that
| it was written by a programmer with commands like 5dd, 6gg etc.
| I find it so ridiculous that a computer program can be that
| much loved and yet it doesn't even provide line numbers out of
| the box nor indentation. Does a person really need to spend
| half an hour googling just to tell vim to indent Java code as
| they type.
| __m wrote:
| I think it does offer editing advantages, though they don't
| matter that much unless you work in a sweat shop. For me it's
| just fun going like "look mum, no mouse"
| Bluecobra wrote:
| Thanks for posting this. I have been using vi(m) for at least 15
| years and finally got the hang of yy only recently. I used to
| work at a Solaris shop a long time ago and had to learn vi to get
| anywhere. I wish I had this then!
| jehlakj wrote:
| This is neat but newcomers beware. This is the easy part. Setting
| up your config and plugins is why most people go back to ides
| triangleman wrote:
| Aren't you supposed to avoid plugins and config so that vi/m
| will be familiar everywhere you go? That's the advice I've
| gotten on this board.
| krysp wrote:
| If you setup your dotfiles correctly, your vim environment
| should be accessible with a simple `git pull`.
|
| The plugins are very worth it, there's no need to handicap
| yourself locally just so your environment matches some bare
| bones server config.
|
| And regardless, the basic vim motions are always there - you
| don't lose much when just editing some config files on a
| server even if you have to use vanilla vim
| bdamm wrote:
| My approach is to just use all the tools. I use clumsy IDEs
| when I really need powerful debugging. I use vim when I need
| powerful editing/macros. Sometimes I do code browsing with
| ctags. Sometimes I do code browsing with Eclipse. There's no
| need to be a purist.
|
| Except vim. No plugins into vim. That is sacrilege.
| smogger914 wrote:
| Hey, this looks interesting, but I am getting an error trying to
| checkout.
|
| VM465:1 POST https://api-vim-so-
| prod.onrender.com/api/v1/billing/create-c...
| net::ERR_CERT_INVALID
| qwerty456127 wrote:
| Does it include practical use cases demonstrating how vim tricks
| can really come in handy in real life? This probably is the
| hardest part for me - I can't imagine a case where I would like
| to use any of them I've ever read about (yet I still feel
| interested).
| corytheboyd wrote:
| Not a mega power vim user, but maybe this qualifies. I use vim
| as my git editor. When doing interactive rebase, if I want to
| squash/fix commits, for example, I go to the first commit I
| want to change the command for, 'ciw' to change the command,
| 'esc' to exit exit, then for the subsequent commits I want to
| squash/fix, just use '.' to replay those same commands to the
| new line. Works very well! I love using vim as the git editor,
| it's stupid fast, and doesn't take you away from the command
| line
| julianlam wrote:
| That's a neat tip, thanks for sharing that, this is the exact
| use case I was looking for.
|
| I was hoping to kick the can on learning vim macros down the
| road, and so here we go...
| corytheboyd wrote:
| No problem! Happy to help with things I wish people told me
| long ago :)
| CoffeePython wrote:
| Yes it does, all the exercises past the basic navigation one
| are real life use cases for how it can be used.
|
| I need to add some better copy and examples on the landing page
| so people will know what they're getting.
|
| Here's a video on twitter that demonstrates one of the
| exercises
| https://twitter.com/KennethCassel/status/1351178904686514178...
| h2000 wrote:
| Nooooooooooooooo!
| ryeguy_24 wrote:
| I never buy things but this just hit on my exact pain point of
| trying to get good at VIM. The one thing that's holding me back
| is understanding how much content there is behind the 15 dollars.
| I really liked the demo exercise but are there only 10 more
| behind that?
| Deivuh wrote:
| I'm considering learning more vim besides "esc /insert and :q :w"
| and this might be a great start.
|
| As an emacs user it's frustrating having to install emacs to do
| some config editing whereas in my experience vim is included
| everywhere. e.g. my router.
| swirepe wrote:
| You've also got "u" for undo. That's another one for you.
| corytheboyd wrote:
| This looks great! Do agree with others though, that you should
| expose the course sections. I don't use vim as my main IDE but I
| still do use it for quick edits and commit messages, so I don't
| know nothing about it. Would be great to see if the course is
| more/less/same as my current working knowledge. But also a one-
| time $15 isn't bad at all, thank you for not trying to make this
| a subscription :)
| __m wrote:
| Most IDEs have a vim extension that gives you the basic vim
| editing behavior. It's great to get into it without having to
| dive into plugins, buffers, windows etc.
| viach wrote:
| The typical conversion rate is ~1/100, so you'll need 10000
| visitors to earn 1500$ this month (optimistically). The next
| month you'll need another 10000 to earn the same amount. Taking
| into account the amount of work put into this project, what's
| your marketing strategy besides Show HN posts?
| CoffeePython wrote:
| I worked on this for 3 days. I've been getting around 1k on
| average visitors from direct traffic and twitter since I
| launched it into access around 10 days ago.
|
| I'm going to work on SEO next for it :)
| joemclarke wrote:
| He also extracted the tech to build his next product, slip.so
| which should generate some nice revenue for him as well.
| heroHACK17 wrote:
| This is great!
|
| Another great resource I gotta plug is
| https://github.com/ThePrimeagen/vim-be-good. Essentially the same
| but it's a native vim plugin. It's free, doesn't require a login,
| and did I mention it's a native vim plugin?
| cbm-vic-20 wrote:
| This guy also streams on vim topics frequently on Twitch.
|
| https://www.twitch.tv/theprimeagen
| andai wrote:
| Also YouTube!
| https://youtube.com/channel/UC8ENHE5xdFSwx71u3fDH5Xw
| CoffeePython wrote:
| Oh this is neat! I haven't seen this one around before :) I'll
| have to check it out. Thanks for sharing
| wes-k wrote:
| I'm tempted to buy it, but I don't know what I'm getting. What
| will this teach me? Do I already know it?
| ctrlp wrote:
| I you want to learn vim movements quickly, start using a browser
| plugin with vim keybindings like VimFX it Vimium. Stop using the
| mouse to browse the internet. You'll get hours of practice doing
| something you'd do anyway. The muscle memory will be there when
| you open vim. Also, turn off arrow keys in vim. Vim is keyboard
| and home row centric, all else follows. Also doing dojo exercises
| like on commandlinefu.cim helps.
| mrslave wrote:
| I advocate organic learning for Vim and often other tools like
| it. Learn to do the bare minimum first, which for Vim is modes
| and how to exit. Then, after you find yourself doing something
| slowly a few times over, search how to speed it up (e.g. yank &
| paste, different buffers, macros). This is also a good counter
| argument for "the learning curve is too steep".
| rohithkp wrote:
| Need something like this for Emacs/org-mode
| claytongulick wrote:
| My (issue?) with vim is that I've been using it so long, all day
| every day, that I can't remember any of the commands - I only
| have muscle memory.
|
| If someone asks me how to do something, I have no idea, I have to
| physically pretend like I'm doing it on a keyboard to figure out
| the command.
| andreygrehov wrote:
| Pro tip to exit vim: Shift+Z+Z
| elliotec wrote:
| I'm bothered by this because Vim is free, with only a hopeful
| plea for a donation to a charity for helping Uganda as the
| "payment."
|
| It feels a tad unethical to be charging for a slightly more
| fancy, maybe kinda gamified, vimtutor. Like, just make a vim
| plugin that does this in vim and let that be your community
| donation.
|
| But I suppose business is business eh.
| umvi wrote:
| I'm not bothered by it. I've thought about making a SaaS where
| I basically just host pre-compiled FOSS packages for esoteric
| cpu architectures. So that way if you have a <insert random
| CPU> embedded linux system, you can quickly grab a precompiled
| `tshark` for example without figuring out how to build it
| yourself. Sure, it would be better as a free service, but I'm
| not super motivated to do that in my highly limited spare time.
| I would be super motivated if I were compensated for my effort
| with cash, however.
|
| Making something paid vs. free can be the difference between it
| existing and not existing. I'd rather have this exist and be a
| paid app than not exist and be free.
| ivanhoe wrote:
| yeah, but again nothing stops you (or me, or anyone else
| reading this) to do it for free... except we will not, as we're
| busy earning money in other ways, so I don't think any of us
| can really claim a moral high ground here - and tutoring people
| for money is certainly much better than not tutoring them at
| all...
| thotsBgone wrote:
| It's not "unethical" to charge money for a product that you
| made from scratch. People on this website really like that
| word, "unethical". Makes me wonder if they even know what it
| means. "Unethical: something you don't like."?
| CoffeePython wrote:
| I don't agree with the viewpoint but the revenue here has
| helped me sponsor one of my favorite open source projects
| FastAPI at $250/mo.
|
| There's value in providing teaching on something that is free.
| I've bought learning tools/apps for many different programming
| related topics and loved the value they provided.
| i_am_andy wrote:
| I have to recommend this too:
|
| https://vim-adventures.com/
|
| I used it to get to grips with vim
| buzzerbetrayed wrote:
| I love vim-adventures. It was the only way I was able to stay
| motivated to learn vim well enough for it to "stick". I just
| hate that you can only buy 6 month access to it. I'd happily
| pay 2-3x the price for lifetime access, but the fact that I can
| only buy 6 more months makes me pretty sure that they won't be
| getting any more money from me. I think I would still hop on
| for a few minutes every few months to practice up on some stuff
| that I forgot.
| ignitionmonkey wrote:
| Have you tried contacting the developer?
| anonymoushn wrote:
| I have contacted the developer and offered $10,000 for a
| perpetual license, but it was not for sale.
| reasonabl_human wrote:
| /s? If not, I'll rebuild that and offer you a lifetime
| license for $9,999 as a hackernews discount ;)
| anonymoushn wrote:
| no sarcasm, not currently on offer
| greenbay20 wrote:
| Awesome idea, gamifying learning vim seems the way to go.
|
| Minor detail: I would recommend you set up the keyboard focus on
| the game as soon as the page loads. Saw a comment mentioning that
| the HJKL keys were not working and the same happened to
| me...right until I clicked on the command-line box in order to
| have my keyboard focus it.
| slowhand09 wrote:
| $15 for lifetime access... rubs chin... I'm old. Would you take
| $5 as my life is 2/3 gone?
| tux1968 wrote:
| No offence to OP intended at all, but as these things often go,
| you're paying for the lifetime of the site, not your own.
| syndacks wrote:
| It was a joke
| simonebrunozzi wrote:
| Even though, admit it... If the course is really good, the
| extra $10 are nothing compared to the several hours of
| frustration that you could save.
| irrational wrote:
| Or save all frustration and just don't use vim ;-)
| pc86 wrote:
| It seems one of these vim tutorials comes up every 6 months
| or so, and the one thing they're all missing is a
| convincing explanation of why someone should learn all the
| esoteric incantations of a 30-year old text editor.
| 2iP1zbR wrote:
| it's nice not having to constantly lift my hand to use
| the mouse when i'm just looking through files and making
| small changes. i can keep my hands on the keyboard for up
| to an hour and get stuff done, so long as the task at
| hand only requires a command line interface and a text
| editor.
| pletnes wrote:
| If you think vim is frustrating for a beginner, you have no
| idea what it feels like to edit text in non-vim for a half-
| assed vim user. Really, I don't master vim after >1decade,
| but that's not necessary.
| NovaDev wrote:
| Pair programming is a real pain for me when most of my
| colleagues just don't use Vim.
| ranit wrote:
| irrational indeed :-)
| chongli wrote:
| I've used vim for many years now. It is true, learning vim
| makes it very frustrating when you find yourself having to
| use another editor. Luckily, vim is pretty much everywhere
| so those situations are rare.
| maskedoffender wrote:
| I find that vim really shines in editing text on touch
| screens with on-screen keyboards. I can do complicated
| commands without doing too much typing out digging
| through menus or using ctrl alt whatever keys.
| MetalGuru wrote:
| What devices with on-screen keyboards are you running vim
| in?
| stingrae wrote:
| it's actually the lifetime of your email address
| medecau wrote:
| you're going to outlive the site
| shafin_ wrote:
| Easiest way to learn vim is to force yourself to use vim
| noarchy wrote:
| The only time I use vim _is_ when I am forced to use it.
| bdamm wrote:
| Then you will never learn vim. Which is fine, not everyone
| needs to be a vim ninja.
| Vaslo wrote:
| In the same vein, we learned excel shortcuts by unplugging the
| mouse
| vz8 wrote:
| Show HN: I built an online interactive course that helps you
| learn vim* faster
|
| *You have a small typo in your title: should be spelled "emacs"
| ;)
|
| Kidding aside, the course is fun, nice work.
|
| Per other comments in the thread, if you want to integrate vim
| muscle memory and browsers, check out the Vimium extension for
| Chrome (granted, I've overwritten the defaults with emacs, but
| the idea has still been helpful and minimized mouse use).
| SiteRelEnby wrote:
| Emacs tutorials can be one line: "ctrl-x ctrl-c".
| mettamage wrote:
| So can vim by typing: vimtutor
| yjftsjthsd-h wrote:
| That's, ah, not the same joke:)
| vz8 wrote:
| An Ode to Quitting Vim:
|
| ESC
|
| Ctrl-C
|
| ESC
|
| Ctrl-Q
|
| ESC
|
| Ctrl-Z
|
| * dangit, suspended *
|
| fg
|
| ESC
|
| :q
|
| E37: No write since last change (add ! to override)
|
| !
|
| E37: No write since last change (add ! to override)
|
| !:q
|
| E37: No write since last change (add ! to override)
|
| @!&^#!&!!:q
|
| E477: No ! allowed
|
| _Reboots Server_
| dubya wrote:
| Teach a man to fish: Ctrl-Z kill -9
| %1
| geordigeordi wrote:
| I've been considering Vim for a while now.. If I do choose to
| pick it up this will definitely be my first choice! Looks great
| :)
| CoffeePython wrote:
| Wow thanks! Learning vim is fun :) I'm glad to see so many
| people interested in it
| unwoundmouse wrote:
| Do macros -> delete % break it? I tried to race the first
| exercise by setting up a macro to speedrun the first example and
| i got something where multiple % showed up
| CoffeePython wrote:
| I guess it does! Haven't seen anyone do this before. I'll look
| into fixing this though!
___________________________________________________________________
(page generated 2021-01-21 23:02 UTC)