Live data from Hacker News

Interactive Vim tutorial

openvim.com

91–100 of 230 posts

Re: Interactive Vim tutorial

#91
post #64

Went through the tutorial, but I still don't think I really get why so many people seem to like Vim so much. The only thing there I noticed which was new to me from a functionality standpoint was the repeated commands feature. Anyone have some better examples of things you can do with Vim that make it worth learning over a GUI-based editor like Atom?

What has always sold me on Vim is the fact that you can "compose" key commands, and as a result, you effectively can build your own commands.

For example, the `d` key begins the `delete` action, the `i` key means `inner` (or `current`) and `w` means `word`. From that, you can deduce that `diw` deletes the current word.

I figured that command out myself, among many other ones, and that only works because of the composable nature of Vim's modal editing.

Vim's macro system is also rather amazing, IMO. I haven't used Atom much, so I don't know if it's comparable, but I will usually set up several macros and compose them together to do mass edits of things.

Re: Interactive Vim tutorial

#92

A little off-topic, but if you like working in Vim, try using cVim[1] for Chrome. It really makes your browsing experience a lot faster, especially if you're on a laptop. [1] https://chrome.google.com/webstore/detail/cvim/ihlenndgcmojh...

Is there anything better about this than vimium? The most disappointing thing about using an extension for this is when I open dev tools or a tab fails to load. I love luakit because the browser itself lets you set up vim like commands. Unfortunately I had to give up trying to build it for macOS

yes i agree with you about not being able to use it in dev tools is super annoying. the author did mention a workaround for it in the reddit thread but it never worked for me.

Re: Interactive Vim tutorial

#93
post #78
post #64

Went through the tutorial, but I still don't think I really get why so many people seem to like Vim so much. The only thing there I noticed which was new to me from a functionality standpoint was the repeated commands feature. Anyone have some better examples of things you can do with Vim that make it worth learning over a GUI-based editor like Atom?

I think the strongest arguments for vim are: 1. The main benefit of vim or any editor is not some fancy feature like macros or visual block editing. Although vim has those and they are great, they only become useful in about 20% of situations. When coding, you spend much more time reading code than writing it. That's why vim has you in Normal mode most of the time, where you can't type at all, and the whole keyboard…

I have to disagree with #1, vim normal mode is emphatically not about navigation, it's about editing. It's basically a command grammar where navigation (motions in vim parlance) can be combined with the various commands.

The key observation behind its design is that programmers and sysadmins spend much more time editing than entering new text, and therefore it is asinine that 40 of the keys on the keyboard are permanently dedicated to typing out literals when there are very obvious editing operations that give you a lot more leverage.

Re: Interactive Vim tutorial

#94
I have to say how confusing I found this demo without a US keyboard. In section 10 I spent far too long pressing Shift+3 and wondering why it wouldn't progress even though I was pressing the pound key (£).

Re: Interactive Vim tutorial

#95
post #77

Honestly though, is it even worth learning? I've tried learning VIM a few times and always gave up, and feel like my editors shortcuts cover most cases anyway. There's also not that many times where I feel like coding speed is required. Honestly curious how much more productive you guys feel after learning VIM.

Personally, I would say it's probably not worth learning for most people. And I say this as a huge fan and many-year user of vim. I'll tell you why I like vim, and you can see if it resonates with you, and if not that's totally valid IMO.

The reason I use and like vim isn't because it improves my productivity. I mean, there's a chance it does, but I kinda doubt it makes that big a difference.

The reason I use vim is because I enjoy using it way more than any other editor. That's because with vim, the amount of time between me deciding on a specific change to make, to it happening, is almost instantaneous. In other editors, I have to spend time moving the cursor around, selecting stuff, etc. In vim, there's usually a command to get what I want done immediately. Not to mention that, with additional plugins, you can get some insane functionality that doesn't exist elsewhere (and you can easily customize vim to add commands that are relevant for you).

I don't think this impacts productivity, but it just makes vim more fun. And (in all seriousness), it's ruined me for other IDEs and editors. Even though there's a chance I'd be more productive in e.g. PyCharm, I can't make the switch because I'd miss too many things from vim.

Btw, it took me a long time to get semi-descent in vim, as I assume it takes most people. I did it not just because vim was a better editor and I was hooked, but because I enjoy playing with and customizing editors. So the amount of time I wasted (and still waste) on vim was enjoyable, so it was worth it to me. I wouldn't consider it productive time well spent though.

Re: Interactive Vim tutorial

#96
post #42

All these tutorials are like taking beginner French. If you want to learn French live in France. If you want to learn Vim you have to live in it. Use it for your development full time. Then over time you start to see it's power. For me on Windows, GVim was the only sane option. Mostly because the Windows console can't fully handle syntax highlighting / italics. However it's also a good transition world. You've got al…

GVim works quite well with Powershell. I used it heavily a year ago when I was on a console crusade. Put this in your $profile and you can open it just by calling "vim": Set-Alias vim "C:\Utilities\vim74\vim.exe"

Both powershell and the dos prompt still go through the console. It's quite amazing to have Vim running in a native Windows prompt but when you use it full time the little things start to get to you.

Re: Interactive Vim tutorial

#98
post #42

All these tutorials are like taking beginner French. If you want to learn French live in France. If you want to learn Vim you have to live in it. Use it for your development full time. Then over time you start to see it's power. For me on Windows, GVim was the only sane option. Mostly because the Windows console can't fully handle syntax highlighting / italics. However it's also a good transition world. You've got al…

The Ubuntu shell on Windows 10 comes with vim and syntax highlighting.

As far as I know, the Ubuntu shell still uses the console. There is indeed highlighting but basically only 8 colours that are dubiously split to make 16. A recent Windows update was supposed to give 256 colours but I tried and couldn't get it to work. Even then though you still haven't got bold or italics. It's these little things that I missed.
Post reply on HN