The best thing I feel when using Vim is that I can /program/ it to my likings, adding shortcuts like the ones I was used to in Eclipse.
You can make it behave like you want and feel great!
Janus helped me in the switch as it gets you a decent MacVim without getting crazy in hunting for plugins
Thanks for sharing,
Francesco
[1] https://github.com/carlhuda/janus
[2] http://www.delicious.com/flevour/vim

Scott said on February 14, 2011

It's funny, I've used Vim a lot and seen a lot written about it, but I've never seen *anything* that is actually easier or quicker to do in Vim.

For example, deleting a line is "dd" in Vim. In other editors it's simply Shift+End, Delete (or Ctrl+X). Technically Vim is fewer keystrokes (assuming you're already in command mode - and can remember the command!) but a regular editor is always more intuitive and quicker.

The one I see a lot of is, "oh but you can delete 20 lines instantly with :d20". But how do you know you need to delete exactly 20 lines unless you sit and count them? With the mouse you can quickly select the section you wish to delete. Or hold Shift + Arrow key.

Even movement is quicker using a combination of dragging the scrollbar, Ctrl+Home, Ctrl+End, PgUp, PgDown, Ctrl+G, Ctrl+F, etc...

I don't mean to sound like a troll, but I am genuinely interested in how and where Vim is quicker because I don't see it!

Tim McCormack said on February 14, 2011

Unclosed parenthetical in "First introduction" is really bugging me!

Nate Klaiber said on February 14, 2011

I made the decision to switch a few months ago. I had to force myself to just do it. Up to that point, I knew the basics. My main reason was that I found myself doing a lot more server related tasks, and I wanted to be efficient while editing in the server and moving around. It's why I wanted a barebones setup of VIM - I didn't want to switch and have so many dependencies.

The only problem I have now is that I want to navigate in all text editors with H,J,K,L.

Scott - I can honestly say VIM is much quicker than working with something like TextMate. I used to think the same thing - my colleagues all used VIM, and I was the only one on TextMate. Over time I started to see how efficiently they used their screen, buffers, and a few custom mappings - and I was blown away. All of that without ever touching a mouse.

Karl G said on February 14, 2011

> I don't mean to sound like a troll, but I am genuinely interested in how and where Vim is quicker because I don't see it!

ci"
d%
=aB
.

If you're just using basic commands, vim isn't that much faster. You get the big gains with the compound motion commands (f/t), text objects (i/a), and repeat (.).

Jonathan Snook said on February 14, 2011

@Tim: fixed it! :)

@Scott: I definitely recommend you watch the first couple screencasts that I linked up. They're all about movement, which is where you'll see some of the moves. <kbd>:d20</kbd> isn't a move that I use very often, and demonstrating such isn't a huge selling point, I'll give you that. :) Getting to know some of the other movement commands like ^, $, } will help you start to see the power.

For example, if I'm in a function and I want to select the function, I could start at the beginning, switch to Visual Line mode with Shift-V and then } to select to the close bracket. x to cut it. or c to cut it and go into insert mode. I could cut it to a specific clipboard using "ax, grab something else with "bx, and then paste from either of those clipboards using "ap, "ab.

As certain movements become second nature, it just becomes much quicker to do things without having to shift your hand to the mouse and back. With that said, using MacVim means I don't have to give up the mouse altogether. There are times where I still feel more comfortable using the mouse. But the more I practice, the less work my mouse gets (and the longer the batteries last! :)).

Jonathan Snook said on February 14, 2011

And thank you, Karl. Now I know about % and will use that frequently!

Karl G said on February 14, 2011

There is one trick to %: it searches forward for a match. If you have |foobar(xyz) (| is cursor) d% will delete the entire function call.

Matt Alexander said on February 14, 2011

Thanks for letting me know about Derek Wyatt. I can tell I'll learn a lot from him.

ralcus said on February 14, 2011

i've been learning Vim the last few weeks too. I'm a dreamweaver user :-\ on windows. I felt like there had to be a better alternative and i was searching around for a textmate like program for windows. A couple of weeks a go i happened to nose in your delicious bookmarks and clicked on one of Derek Wyatt's screen casts. It convinced me enough to give Vim a good try. So far i'm enjoying it although i have to admit its a tough transition for me. But i'm persevering.

Yannick said on February 14, 2011

I have started with Vim a few month ago, after using a mix of texMate, BBedit and Espresso depending on how I felt on the day. I fot started with Dan benjamin screen cast which i really recommend. But now i can't live without from O'reilly . Best geeky book that I have ever bought and full of crispy Vim knowledge nuggets.

It's an editor quite challenging to learn but the reward is really worth it :) I really love the surgical precision that one can reach while editing code.

Some of the most useful plugins for me are the Tim Pope collection (surround, ragtag, fugitive),unimpaired, bufferexplorer, zen coding that I now use more than the snipmate bundle equivalent.

My best vim tip of the day is ctrl+o while in insert mode. it take you back to normal mode to issue command and switch back to insert straight after. Pure little gold gem.

Good learning!!!

redwall_hp said on February 14, 2011

I use TextWrangler for 90% of my text editing, and nano when I have to edit something over SSH. I pretty much despise command line text editors, no matter how much people rave about them. (I still can't believe there are weirdos who do *all* of their editing in vim or emacs...) I purposefully use nano because it's the least needlessly arcane.

Enrico Teotti said on February 14, 2011

@scott, I have :set relativenumber as a shortcut so I can switch the regular line count to be relative to the current line. That way you can do the :d20 or even 20j (to move down 20l)

I don't think that's the reason I am on vim tough :)

Like yannick I'd recommended http://stevelosh.com/blog/2010/09/coming-home-to-vim/ and the oreily book

dr. Hannibal Lecter said on February 20, 2011

Jonathan, welcome to the dark side!

You may also like ggVG as a shortcut :)

One thing I like a lot is getting an error from PHP/Ruby etc.. "There is an error in file ZZZZ on line XX" because you can simply do XXgg in Vim and you're on line XX in your file. Quite handy, wouldn't you say? :)

Also, see this for some kick ass tricks:

http://stackoverflow.com/questions/95072/what-are-your-favorite-vim-tricks

SteveM said on February 22, 2011

vi is a very rewarding editor to use and the reason some people don't like it is they're not prepared to put in the effort to learn it. Unlike editors that are "easy" to use from day 1, you can really get fast when you're proficient in vi - the "easy" editor will always be slower.

The first thing you need to do is to ":map g 1G" so a single lower case 'g' will take you to the top of your file (as a single upper case one takes you to the end). Then learn how to move the cursor along the line using 't' and 'f' (and their upper case reversals). And it's a word processor, too! Use brackets, '('and ')' to take you to the next and previous sentence! You have to end end sentence with a period followed by two spaces or a newline, of course. :-)

Dave Allen said on February 23, 2011

You'll love this then:

http://net.tutsplus.com/articles/general/quick-tip-even-quicker-markup-with-sparkup/

andy said on February 23, 2011

@scott

HAHAHAHAHAHHAHAHAHAHAHAHA. ha.

I guess I shouldn't laugh, I used to think I was efficient in Notepad++. Things are more "intuitive" for you in other editors because you don't know how to use VIM. I especially like your PgUp/Home examples. You need to embrace the Vim mentality of keeping your fingers on the home row. Reaching over (and probably having to look at your keyboard) to hit PgUp is a huge time waster. And god forbid use the mouse.

Things that are actually faster in Vim? Well, pretty much every command

- gg/G jump to start/end of file, reaching over to home/end is a productivity killer
- ci" / ca" change word inside quotes
- I / A - insert at beginning or end of line
- / simply the search command, instant find-as-you-type search without a disgusting dialog box appearing OVER what you are trying to search for
- dd delete line and copy it to yank buffer, definitely faster than other programs
- Ctrl+O jump backwards through lines that you edited
- cw/cW/cB etc delete the current word, copy it to yank buffer, and go into insert mode

Once you actually learn the power of VIM you won't switch to another editor. There are thousands of extremely useful commands, making mastering VIM a new learning experience every day. In fact check out vimgolf.com to really boost your efficiency.

@Stevem what? gg goes to top of file fine.

Reinier Sierag said on February 23, 2011

Hi, in my daily work as a programmer and webdesigner at an isp I'm working on different projects on different servers. I used losts of different editors the last 6 years, from dreamweaver, to eclipse, textmate and learned about VIM the hard way :). I discovered Coda a year ago. The problem with VIM is that you do not have code completion, project viewer (explorer style) a.d oplossing files for example. Also working on different projects on different servers Coda will let me switch mutch faster (sftp). Ps I think everyone must give VIM a change before sticking to a Textmate like editor.

Reinier Sierag said on February 23, 2011

(edit) oplossing = uploading

Amadeus said on February 24, 2011

I really liked vim's commands a lot, and with each new command I really grew faster (d motions!!!).

However, as a jr. front end developer and general newbie to vim, it was unsuccessful for me ti set up vim so that I could even install plugins on vim, ie zencoding, command-T. The directories and vimrc just weren't linking up in some way, and I have to say, there are a supreme shortage to tutorials for setting these take-for-granted root directories and linking them up. I just keep seeing install to your ~/.vim/plugins folder and it works, or just add to your .vimrc and it works. No dice for me so far.

RV David said on February 24, 2011

When I had first started using vim, a vim document/script with lessons/exercises formatted to get a new user familiar with with Vim's features called "vimtutor" was key.

Anthony Clark said on February 28, 2011

This post and site just got a glowing review in 'The Dev Show' #37 by 5by5.tv

James Childers said on March 01, 2011

vimtutor FTW!

judev said on March 03, 2011

Check out https://github.com/astrails/dotvim if you haven't seen it already, it's quite RoR focused but a great starting point for a custom .vim setup whatever your situation

Tommy Bollman said on March 05, 2011

I have been using Vim to and fro for several years dating back to about 1990.
Vim is great for a lot of stuff. I have however realized that no single editor is perferct and that no one ever will be.

I now depend on BBEdit, as an all round editor both it and TextWrangler (which is free) is reachable from the command line.
You don't have to learn some arcane version of lisp in order to customize it. -It is not perfect, but it takes care of most of the business in a pleasant way, like programming, editing websites and latex documents, It has a whole range of plugins.
During the usage of three years I bet I haven't customized it for more than 10 hours.
You get pre built plugins for version control, syntax highligthning and such.
BBEdit even has palettes where you just embed some selections, or drag them into your document. It also updates a whole website on request when you have changed your persisten includes.

I guess I have spent far more hours with vim rc.

Jesse said on March 05, 2011

Geez, just when I thought switching from Dreamweaver to Expression Web to Notepad ++ was gonna do the trick, I come across this. Stink!

Sorry, comments are closed for this post. If you have any further questions or comments, feel free to send them to me directly.
f2富二代官网入口