News for hackers. Stuff that matters.
Re:What Is the Most Valuable Thing You Can Learn in One Hour? by jakobegger on Tuesday December 31, 2019 @09:31AM (#21921191)
> one hours is defiantly enough to get to know the main Vim bindings

I'm going to do an experiment. I've been struggling with Vim for a long time. I need to leave in about one hour. Instead of wasting time here on HN, I'll now spend an hour learning Vim.

I doubt that this will get me very far, but I'll let you know how far I got.

Re:What Is the Most Valuable Thing You Can Learn in One Hour? by jakobegger on Tuesday December 31, 2019 @10:35AM (#21921639)
OK, it's been about an hour. I learned the following:

- there's a visual mode for selecting text

- I can now yank and paste text in normal mode

- I learned to use :split and :vsplit to open new files, and ctrl-w to switch between them

- I learned a few new navigation commands

- I learned that there's a replace mode (R)

Definitely useful, and I hope I remember everything the next time I open vim!

But I still feel like I'm just scraping the surface. One hour is very little time to learn about the power of vim.

Re:What Is the Most Valuable Thing You Can Learn in One Hour? by erezsh on Wednesday January 01, 2020 @06:05AM (#21927584)
I've been using Vim and vim-derivatives almost exclusively for the past 15 years, and I think none of the things you mentioned are important to use vim.

The first and most important things to understand are:

- Normal mode is the default mode. Only leave it when you already know what you want to write.

- Movement follows the [<count>] <verb> <target> model. The most used verbs are: d, y, p

The most used targets are j, k, f, F, /, w, W, e, b

Other useful keys to know and use: a, A, o, O, *, ., %

And lastly, learn how to use macros! (q, @)

If you just learn everything I listed here (and it isn't much), until it feels natural, you already know 90% of what you need to boost your editing speed and use vim like a pro.

Re:What Is the Most Valuable Thing You Can Learn in One Hour? by jakobegger on Wednesday January 01, 2020 @08:25AM (#21927908)
I already knew some basics of vim, as I've been semi-regularly using it for a long time to edit files on the command line. Everytime I ssh into a server I use vim to edit text files. I can get everything done that I need to do.

My struggle with vim is that it just slows me down. I'm used to the way that text editors work on the Mac, and I'm really fast with them. Working in Textmate or Sublime or Xcode or even BBedit feels natural to me. But as soon as I switch to Vim, everything feels difficult.

I think a big problem with Vim is that it's really hard to learn when it's not your primary editor.

Re:What Is the Most Valuable Thing You Can Learn in One Hour? by caseyw on Tuesday December 31, 2019 @11:01AM (#21921926)
That's all good, but can you quit it? Sorry, had to be cheeky!
Re:What Is the Most Valuable Thing You Can Learn in One Hour? by 77544cec on Tuesday December 31, 2019 @12:08PM (#21922544)
Re:What Is the Most Valuable Thing You Can Learn in One Hour? by capableweb on Tuesday December 31, 2019 @03:34PM (#21924496)
Shocking stats about trying to exit vim:

> In the last year, How to exit the Vim editor has made up about .005% of question traffic: that is, one out of every 20,000 visits to Stack Overflow questions. That means during peak traffic hours on weekdays, there are about 80 people per hour that need help getting out of Vim.

Re:What Is the Most Valuable Thing You Can Learn in One Hour? by james_s_tayler on Tuesday December 31, 2019 @08:40PM (#21926057)
That's fantastic. All the vim people always raving about how much productivity they gain from vim, we can point to an objective measure of how much productivity it's ux destroys too.
Re:What Is the Most Valuable Thing You Can Learn in One Hour? by Zelphyr on Tuesday December 31, 2019 @12:54PM (#21922931)
You are just scraping the surface but that's ok. I've been using Vi/Vim for over 20 years and I'm still learning it but to me, that's what makes it so much fun! I learn a new thing (e.g.; `%` for toggling the cursor between matching things like parens) and then try to use that as much as I can for awhile until it's integrated into near muscle memory. Then I get the itch to learn more and so I dive back in.
Re:What Is the Most Valuable Thing You Can Learn in One Hour? by el_cujo on Tuesday December 31, 2019 @11:12AM (#21922023)
type vimtutor in your shell for the "intended" tutorial
Re:What Is the Most Valuable Thing You Can Learn in One Hour? by hombre_fatal on Tuesday December 31, 2019 @11:20AM (#21922107)
vimtutor sold me on vim in 10 minutes. o, O, p, P, y, I, A, etc. It was immediately obvious to me how it could be useful, having one-key shortcuts for the most common maneuvers in text editors, even if I were just writing prose.

Next time you're stuck somewhere without internet, as I was, give vimtutor a shot.

Re:What Is the Most Valuable Thing You Can Learn in One Hour? by OGWhales on Tuesday December 31, 2019 @01:54PM (#21923446)
Thank you. Just did this and finally understand vim and I have used some weird editors in my day. This really helped to give me an overview
Re:What Is the Most Valuable Thing You Can Learn in One Hour? by kaybe on Tuesday December 31, 2019 @10:25AM (#21921561)
The tutorial that comes with Vim is quite good.