Author |
Message |
mikazo
|
Posted: Wed May 25, 2011 11:43 pm Post subject: For Vi/Vim Wizards |
|
|
For anyone who uses Vi or Vim on a regular basis, could you post how you went about learning to use it efficiently?
I've been meaning to become proficient for a long time now, but never got into it. Then whenever I see someone using Vim, they seem so efficient and my motivation picks up again. Someone I talked to today said that you pretty much just have to force yourself, because of the steep learning curve.
So how did you learn Vim? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
DemonWasp
|
Posted: Thu May 26, 2011 12:12 am Post subject: RE:For Vi/Vim Wizards |
|
|
Use Vim, and only Vim, for a week. If you really want to learn, make sure you use it from the command-line, rather than the GVIM version (graphical VIM, in its own window, with buttons). To start, you only need to know:
i - enter "insert" mode
Escape - leave insert mode
:q - quit; use :q! to quit without saving changes
:w - write; use :w! to override objections Vim might have, such as the file being read-only, where possible
:(number) - navigate to that line number
:$ - go to the end of the file
/text - search for "text" in the file; hit enter to complete the search term, and use 'n' to go to the next instance of "text" |
|
|
|
|
|
rdrake
|
Posted: Thu May 26, 2011 12:16 am Post subject: RE:For Vi/Vim Wizards |
|
|
I'm still far from being a "wizard," but...
I learn a lot from coding with other people in it. They tend to have used it a lot longer than I and teach me new things. You can also check out the plethora of cheat sheets out there but really the best way to learn is to practice. |
|
|
|
|
|
apython1992
|
Posted: Thu May 26, 2011 7:17 am Post subject: RE:For Vi/Vim Wizards |
|
|
One thing that has helped me start to get good (or at least more efficient than a WYSIWYG editor) is by using a linux distro while forcing myself not to use the mouse. This means everything is done in a terminal window, so that when you need to write code or edit something, vim would be the only way to go (well, not the only, but still). One of the quickest things you could learn that will already make you more efficient than using a WYSIWIG editor is the searching and replacing. Seriously. In command mode, just type /(something to search) and it will take you there right away. Press n. You find the next occurrence. Even with just this, and knowing how to switch between command and insert mode, you'll feel more efficient. |
|
|
|
|
|
Sur_real
|
|
|
|
|
mikazo
|
Posted: Thu May 26, 2011 4:47 pm Post subject: RE:For Vi/Vim Wizards |
|
|
Also, has anyone ever used ctags with Vim? |
|
|
|
|
|
apython1992
|
Posted: Wed Jun 01, 2011 12:13 pm Post subject: RE:For Vi/Vim Wizards |
|
|
Uh oh. |
|
|
|
|
|
mikazo
|
Posted: Wed Jun 01, 2011 5:12 pm Post subject: RE:For Vi/Vim Wizards |
|
|
I printed out some cheat sheets and put them on my wall next to my computer at home and at work. Now I just gotta force myself to switch. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
apython1992
|
Posted: Wed Jun 01, 2011 6:25 pm Post subject: RE:For Vi/Vim Wizards |
|
|
Forcing yourself is the way to go. :wq |
|
|
|
|
|
[Gandalf]
|
Posted: Wed Jun 01, 2011 7:18 pm Post subject: Re: RE:For Vi/Vim Wizards |
|
|
apython1992 @ 2011-06-01, 6:25 pm wrote: Forcing yourself is the way to go. :wq
I think you mean :wq!
Also this thread is severely lacking an "Emacs ftw!" |
|
|
|
|
|
mikazo
|
Posted: Wed Jun 01, 2011 9:17 pm Post subject: Re: RE:For Vi/Vim Wizards |
|
|
[quote="[Gandalf] @ Wed Jun 01, 2011 7:18 pm"] apython1992 @ 2011-06-01, 6:25 pm wrote: Forcing yourself is the way to go. :wq
I think you mean :wq!
Also this thread is severely lacking an "Emacs ftw!"[/quote]
I was waiting for that! |
|
|
|
|
|
apython1992
|
Posted: Wed Jun 01, 2011 10:30 pm Post subject: RE:For Vi/Vim Wizards |
|
|
This thread is now severely lacking an "Emacs is an outstanding operating system, lacking only a decent text editor." |
|
|
|
|
|
|