geekhack

geekhack Community => Other Geeky Stuff => Topic started by: alexjd99 on Tue, 24 November 2015, 22:44:53

Title: How did you learn to use Vim?
Post by: alexjd99 on Tue, 24 November 2015, 22:44:53
I'm having a very hard time learning Vim, so I was curious if anyone knew any way for me to learn without feeling like I'm being hit by a bus  :p
Title: Re: How did you learn to use Vim?
Post by: nathanrosspowell on Tue, 24 November 2015, 22:59:42
Prepare to be repeatedly ran over by that bus, for a few weeks -or- just quit now!

There is no easy way to learn. Persistence is key. You are remapping the way your brain works, it takes time.
Title: Re: How did you learn to use Vim?
Post by: intelli78 on Tue, 24 November 2015, 23:09:39
For me, it didn't stick until I just started practicing keystrokes over and over. You just have to drill them into your brain by actually typing them repeatedly. Reading about them won't help--going through the motions will.
Title: Re: How did you learn to use Vim?
Post by: rowdy on Wed, 25 November 2015, 03:34:43
I was using vi on Unix systems many years ago.

Then when Linux was invented and I started using it, somehow I got on to elvis (another vi clone).

Then I dabbled with FreeBSD, which has more like the original vi.

Now I generally use CentOS 6/7 and Debian 8, which include vim.

Mostly I just use vim as if it was elvis or vi.
Title: Re: How did you learn to use Vim?
Post by: toneman77 on Wed, 25 November 2015, 09:53:16
I'm having a very hard time learning Vim, so I was curious if anyone knew any way for me to learn without feeling like I'm being hit by a bus 
Try the command vimtutor in the command line and/or http://vim-adventures.com/ both helped me a lot.
Title: Re: How did you learn to use Vim?
Post by: henz on Wed, 25 November 2015, 09:57:43
The cheat sheet

http://www.viemu.com/vi-vim-cheat-sheet.gif (http://www.viemu.com/vi-vim-cheat-sheet.gif)
Title: Re: How did you learn to use Vim?
Post by: potatowire on Fri, 27 November 2015, 06:57:31
Vimtutor is a great call, and I have heard good things about interactive sites like vim-adventures.com, but the best tool I found while learning was videos. The ones I liked best (it was a while ago, so there may be better ones out there now) were by Derek Wyatt (http://derekwyatt.org/vim/tutorials/). I enjoyed his presentation style, and it helped me to see Vim in action, rather than just reading about it.
Title: Re: How did you learn to use Vim?
Post by: osi on Fri, 27 November 2015, 07:09:13
Another vote for vimtutor here. Also, if you are throw into a situation where vi/vim is your editor, you can learn fairly quickly :D
Title: Re: How did you learn to use Vim?
Post by: vkulla on Thu, 24 March 2016, 19:29:02
I learned the basics really quick with a little game:
http://vim-adventures.com/

Title: Re: How did you learn to use Vim?
Post by: hashbaz on Thu, 24 March 2016, 20:10:10
I tried and failed a couple of times to "get into" vim before finding vimtutor. It did the trick of getting me over the initial hump. Nine years later, can't use anything else.
Title: Re: How did you learn to use Vim?
Post by: pr0ximity on Thu, 24 March 2016, 20:23:11
Using it, the only way to learn. I doubt you'll really lose *that* much productivity starting with hjkl and two modes (insert and visual). At that point it's identical to Notepad.

 Add stuff on top slowly, like w, e, and b for navigating through words, and start looking into selections and copy/paste.

Once you're comfortable with that, look up how to do things when you have the need to.
Title: Re: How did you learn to use Vim?
Post by: njbair on Thu, 24 March 2016, 21:05:54
Vimtutor, like everyone else.

Now the real question is, how did I re-learn Vim when I switched to Dvorak?
Title: Re: How did you learn to use Vim?
Post by: alexjd99 on Fri, 25 March 2016, 21:06:46
Vimtutor, like everyone else.

Now the real question is, how did I re-learn Vim when I switched to Dvorak?

By becoming a masochist?
Title: Re: How did you learn to use Vim?
Post by: noisyturtle on Sat, 26 March 2016, 01:42:30
Too hard for me, I gave up in less than 2 hours.
Title: Re: How did you learn to use Vim?
Post by: rowdy on Sat, 26 March 2016, 02:09:08
Vimtutor, like everyone else.

Now the real question is, how did I re-learn Vim when I switched to Dvorak?

Everyone else?

I didn't :p
Title: Re: How did you learn to use Vim?
Post by: kittenpolice on Sat, 26 March 2016, 02:16:51
A friend of mine swears by Practical Vim by Drew Neil. I can't vouch for it, but it's on my list of books I'm going to read this year.
Title: Re: How did you learn to use Vim?
Post by: naasfu on Sat, 26 March 2016, 02:49:22
Too hard for me, I gave up in less than 2 hours.

i think i got about as far before getting frustrated.  i think i'm too old to learn new (well, vi is rather old) tricks.

maybe i'll try this vimtutor sometime.
Title: Re: How did you learn to use Vim?
Post by: frarees on Sat, 26 March 2016, 04:05:30
Struggled for weeks before I jumped into vi modes. Learning curve is quite big for what I'm used to see on text editing, as it represents a new (old?) paradigma I wasn't used to.

Found this guy's post interesting (https://benfrain.com/learning-vim-front-end-coding-month/). He talks his experience, some plugins he uses on vim and how important and personal vimrc is.

The change didn't happened until I decided to actually use vim for small edits, then started using it to write small programs. After several days using it I found it quite natural, and I don't feel like going back. You start with a few commands basic commands (e.g. dw, gg, r, C...) and as you go you find out more interesting ones that fit with your usage (e.g. ciw, viB were some good ones in my case). It was worth the change for sure :thumb:

Good luck!
Title: Re: How did you learn to use Vim?
Post by: rowdy on Sat, 26 March 2016, 04:36:12
There's a sort of intro here: https://www.linuxvoice.com/learn-to-love-vim/

Not really a tutorial, according to Mike, but seems to give a reasonable overview of lots of vim's features.
Title: Re: How did you learn to use Vim?
Post by: njbair on Sat, 26 March 2016, 07:26:05
Vimtutor, like everyone else.

Now the real question is, how did I re-learn Vim when I switched to Dvorak?

Everyone else?

I didn't
Rowdy I thought you wrote Vim.
Title: Re: How did you learn to use Vim?
Post by: iLLucionist on Sat, 26 March 2016, 07:47:52
I read "Learning the Vi and Vim Editors" (O'reilly, Robins et al.) cover-to-cover. And I forced myself to use vim exclusively, even when it became frustrating.

Took me a week to get the basics in my muscle memory up to the point that I didn't really had to think about them. With basics, I mean hjkl for navigation, dd to delete line, motions, text objects, etc.

The more advanced stuff like customization and vimscript took me a month or so to become and feel comfortable with (what plugins, when NOT to use plugins, personal .vimrc, etc.).

But honestly, you keep learning new stuff with vim or getting new preferences. And now I'm curious about emacs / spacemacs.
Title: Re: How did you learn to use Vim?
Post by: thelectronicnub on Sat, 26 March 2016, 23:01:01
i didn't

nano best editor
Title: Re: How did you learn to use Vim?
Post by: rowdy on Sun, 27 March 2016, 04:44:34
Vimtutor, like everyone else.

Now the real question is, how did I re-learn Vim when I switched to Dvorak?

Everyone else?

I didn't
Rowdy I thought you wrote Vim.

I have written a few editors in my time, but nothing like vim.
Title: Re: How did you learn to use Vim?
Post by: iLLucionist on Sun, 27 March 2016, 05:48:17
i didn't

nano best editor

nano? for real? what about mcedit?
Title: Re: How did you learn to use Vim?
Post by: jwaz on Sun, 27 March 2016, 05:57:04
i didn't

nano best editor

nano? for real? what about mcedit?

(https://imgs.xkcd.com/comics/real_programmers.png) (https://imgs.xkcd.com/comics/real_programmers.png)
Title: Re: How did you learn to use Vim?
Post by: iLLucionist on Sun, 27 March 2016, 07:18:21
i didn't

nano best editor

nano? for real? what about mcedit?

(https://imgs.xkcd.com/comics/real_programmers.png) (https://imgs.xkcd.com/comics/real_programmers.png)

I actually laughed.  :thumb:
Title: Re: How did you learn to use Vim?
Post by: CSCoder4ever on Fri, 01 April 2016, 14:48:26
how did I learn? Oh, a little bird taught me how  :))
Title: Re: How did you learn to use Vim?
Post by: mr67volks on Fri, 08 April 2016, 01:26:20
I tried my hand at webhosting and needed to figure out how to edit configs fast in a  command line interface
Title: Re: How did you learn to use Vim?
Post by: iLLucionist on Fri, 08 April 2016, 04:19:12
vim is heaven. vim rules! (and emacs rules)

Are there any other editors around that have the power of either vim or emacs?
Title: Re: How did you learn to use Vim?
Post by: iri on Fri, 08 April 2016, 05:43:28
vim is heaven. vim rules! (and emacs rules)

Are there any other editors around that have the power of either vim or emacs?
Are there any other editors around that have the power of spacemacs?
Title: Re: How did you learn to use Vim?
Post by: iLLucionist on Fri, 08 April 2016, 05:44:17
vim is heaven. vim rules! (and emacs rules)

Are there any other editors around that have the power of either vim or emacs?
Are there any other editors around that have the power of spacemacs?

Spacemacs is nice. Makes me want to learn elisp.
Title: Re: How did you learn to use Vim?
Post by: iri on Fri, 08 April 2016, 05:54:26
Vimtutor, like everyone else.

Now the real question is, how did I re-learn Vim when I switched to Dvorak?

Everyone else?

I didn't :p
I did :p

Also, I printed the cheat sheet and hanged it on the wall near my monitors.

Also, a series of brilliant articles in Russia.
Title: Re: How did you learn to use Vim?
Post by: iLLucionist on Fri, 08 April 2016, 05:56:20
I must say that now I grok vim and now spacemacs exist, I think vim is a springboard to dive into emacs.

First you learn vim, then you move onto spacemacs and discover what a nice OS emacs is and then you switch to emacs with personal config and personal elisp so that you can have your favorite editor with vim bindings in every app in your OS.

Though spacemacs really IS slower than vim in my experience..
Title: Re: How did you learn to use Vim?
Post by: iri on Fri, 08 April 2016, 06:01:30
vim is heaven. vim rules! (and emacs rules)

Are there any other editors around that have the power of either vim or emacs?
Are there any other editors around that have the power of spacemacs?

Spacemacs is nice. Makes me want to learn elisp.
Soon Neovim shall rise and you'll be able to use your favourite programming language with it.

[attachimg=1]
Title: Re: How did you learn to use Vim?
Post by: iLLucionist on Fri, 08 April 2016, 06:18:33
vim is heaven. vim rules! (and emacs rules)

Are there any other editors around that have the power of either vim or emacs?
Are there any other editors around that have the power of spacemacs?

Spacemacs is nice. Makes me want to learn elisp.
Soon Neovim shall rise and you'll be able to use your favourite programming language with it.

(Attachment Link)

Neovim is quite awesome. Now only if there would be native support for something better then vimscript.
Title: Re: How did you learn to use Vim?
Post by: iri on Fri, 08 April 2016, 07:47:03
vim is heaven. vim rules! (and emacs rules)

Are there any other editors around that have the power of either vim or emacs?
Are there any other editors around that have the power of spacemacs?

Spacemacs is nice. Makes me want to learn elisp.
Soon Neovim shall rise and you'll be able to use your favourite programming language with it.

(Attachment Link)

Neovim is quite awesome. Now only if there would be native support for something better then vimscript.
Oh, but there is native support for Lua. And why would you need native support when you can use any language which has an implementation of msgpack-rpc?
Title: Re: How did you learn to use Vim?
Post by: iLLucionist on Fri, 08 April 2016, 07:56:23
vim is heaven. vim rules! (and emacs rules)

Are there any other editors around that have the power of either vim or emacs?
Are there any other editors around that have the power of spacemacs?

Spacemacs is nice. Makes me want to learn elisp.
Soon Neovim shall rise and you'll be able to use your favourite programming language with it.

(Attachment Link)

Neovim is quite awesome. Now only if there would be native support for something better then vimscript.
Oh, but there is native support for Lua. And why would you need native support when you can use any language which has an implementation of msgpack-rpc?

msgpack-rpc? But that would require to have, for instance, a python instance running alongside and python communication with neovim via msgpack-rpc amirite?
Title: Re: How did you learn to use Vim?
Post by: iri on Fri, 08 April 2016, 07:59:23
vim is heaven. vim rules! (and emacs rules)

Are there any other editors around that have the power of either vim or emacs?
Are there any other editors around that have the power of spacemacs?

Spacemacs is nice. Makes me want to learn elisp.
Soon Neovim shall rise and you'll be able to use your favourite programming language with it.

(Attachment Link)

Neovim is quite awesome. Now only if there would be native support for something better then vimscript.
Oh, but there is native support for Lua. And why would you need native support when you can use any language which has an implementation of msgpack-rpc?

msgpack-rpc? But that would require to have, for instance, a python instance running alongside and python communication with neovim via msgpack-rpc amirite?
Yes.
Title: Re: How did you learn to use Vim?
Post by: iLLucionist on Fri, 08 April 2016, 08:11:36
vim is heaven. vim rules! (and emacs rules)

Are there any other editors around that have the power of either vim or emacs?
Are there any other editors around that have the power of spacemacs?

Spacemacs is nice. Makes me want to learn elisp.
Soon Neovim shall rise and you'll be able to use your favourite programming language with it.

(Attachment Link)

Neovim is quite awesome. Now only if there would be native support for something better then vimscript.
Oh, but there is native support for Lua. And why would you need native support when you can use any language which has an implementation of msgpack-rpc?

msgpack-rpc? But that would require to have, for instance, a python instance running alongside and python communication with neovim via msgpack-rpc amirite?
Yes.

That's pretty cool. I should look into that. Though I always had the feeling that native vimscript is faster then relying on such communication. But I could be entirely wrong of course.
Title: Re: How did you learn to use Vim?
Post by: iri on Fri, 08 April 2016, 08:32:55
For trivial tasks like moving cursor inside the buffer you won't notice the difference on a modern machine. For computation intensive tasks you'd better go with languages other than VimL :p
Title: Re: How did you learn to use Vim?
Post by: iLLucionist on Fri, 08 April 2016, 09:14:13
For trivial tasks like moving cursor inside the buffer you won't notice the difference on a modern machine. For computation intensive tasks you'd better go with languages other than VimL :p

I tried to go hardcore with viml and learn it. I program in many languages and I can quickly learn a language when necessary (and API's). But viml? viml is a b*tch. The legacy, the abbreviations. It makes Perl look nice in comparison. I HATE viml. But yeah... if you're in love with vim there is no way out. Except for there is now with neovim..
Title: Re: How did you learn to use Vim?
Post by: rowdy on Wed, 13 April 2016, 17:44:50
This seems to be the most recent Vim thread.

Version 8 is coming ...

https://github.com/vim/vim/blob/master/runtime/doc/version8.txt

Who's excited?
Title: Re: How did you learn to use Vim?
Post by: iri on Thu, 14 April 2016, 04:13:24
This seems to be the most recent Vim thread.

Version 8 is coming ...

https://github.com/vim/vim/blob/master/runtime/doc/version8.txt

Who's excited?
Nope =)
Title: Re: How did you learn to use Vim?
Post by: iLLucionist on Thu, 14 April 2016, 16:48:58
This seems to be the most recent Vim thread.

Version 8 is coming ...

https://github.com/vim/vim/blob/master/runtime/doc/version8.txt

Who's excited?

I'm f**king excited. Cannot wait for it to come out. (Seriously)
Title: Re: How did you learn to use Vim?
Post by: rowdy on Thu, 21 April 2016, 17:31:06
Here's quite a good basic command cheat sheet:

https://spin.atomicobject.com/2016/04/19/vim-commands-cheat-sheet/
Title: Re: How did you learn to use Vim?
Post by: iLLucionist on Sat, 23 April 2016, 13:35:51
Here's quite a good basic command cheat sheet:

https://spin.atomicobject.com/2016/04/19/vim-commands-cheat-sheet/

Cool, didn't knew that one.

But I think that people need to understand the concept of "motions" and "text objects" and "quantifiers" like "3dw" (3 times delete word) first, to put cheat sheets more in context. I know that I confused all of them initially.
Title: Re: How did you learn to use Vim?
Post by: rowdy on Sun, 24 April 2016, 01:00:37
Here's quite a good basic command cheat sheet:

https://spin.atomicobject.com/2016/04/19/vim-commands-cheat-sheet/

Cool, didn't knew that one.

But I think that people need to understand the concept of "motions" and "text objects" and "quantifiers" like "3dw" (3 times delete word) first, to put cheat sheets more in context. I know that I confused all of them initially.

I kind of worked that out intuitively and use that sort of functionality all the times.  Sometimes, depending on the size of the file, it is quicker for me to do that than work out the search/replace syntax.
Title: Re: How did you learn to use Vim?
Post by: rowdy on Thu, 12 October 2017, 18:19:14
Found this recently: http://www.openvim.com/