Mark

to create a new file :
:w /path/to/file.ext

franck on 5/14/11

For instantly editing a new blank file I like:
:e path/to/file

Jamie Mill on 5/14/11

FuzzyFinder is a very nice plugin that has directory switch, files finder very nice, and buffer and tag finder that works with TagList it’s quite nice

Bogdan on 5/14/11

You can use NerdTree to create files. Just navigate into the directory and press “m” for menu and “a” for add. Then enter a filename.

Reen on 5/15/11

Have you ever used Coda? I use Coda all day, every day and was curious if you ever looked at
it.

Thanks

Lance on 5/15/11

Congrats for using Vim!
Hope your next post will be “Switching to Linux — the first month” ;-)

LJD on 5/15/11

Thanks for another great article. I didn’t know about Janus & will definitely check out your fork.

For syncing configs (git, vim, etc) I use dropbox:
http://kevin.vanzonneveld.net/techblog/article/sync_vim_accross_workplaces/
works instantly :)

Kevin van Zonneveld on 5/16/11

franck, Jamie, Bogdan: I knew there had to be a better way to do that.

Reen: Awesome, I’ll be using that quite often. :)

Lance: I did briefly, but it has the same problems as TextMate for me. It doesn’t work on the various computers I have to work with. But coda is a great editor.

Kevin: I started off using Dropbox for my vimrc, but I found installing all the plugins to be a pain. Using Janus solved that for me.

mark story on 5/16/11

Hi Mark,

I am almost in the same situation as you. I usually have to work on remote servers, all running Debian.
So, does this Janus also works in Linux?

Nice article, by the way!

Renan Gonçalves on 5/17/11

Hi Mark,
I am a vim user for 2 years i guess. Still cant memorise the basic commands. To make your life easy goto

http://github.com/akitaonrails/vimfiles

this all the textmate like features u want to use.

t will help u alot … try this surely u wont be disappointed :)

Rajib on 5/20/11

:!mv in fact seems to be the canonical way to rename a file (in plain command-line mode. The built-in netrw browser (:Explore) has R for this, NERDTree probably some similar)

Just in case – do you know this wonderful compilation:
http://www.rayninfo.co.uk/vimtips.html

And many, many thanks for all your CakePHP work! Wish you a lot of fun with the Vim – you certainly deserve it ;-)

Stefan on 5/27/11

P.S. / Remembering commands:

while aforementioned Best of Vim Tips is full of fun, but rather LARGE, imho this VIM QUICK REFERENCE CARD is a nice compilation of basic commands:

http://tnerual.eriogerg.free.fr/vimqrc.html

Stefan on 5/27/11

I don’t know if it’s cheating or not, but I guess I lean on profile settings in .bashrc, .vimrc, and so forth pretty heavily. Well, just today I discovered that Eclipse’s Remote System Monitor group of views are actually amazingly easy to deal with – at least, for me. I was able to shell into both my dev and my production boxes with absolutely 0 muss / fuss / bother, and open terminals on both. Silly as it may sound to pop open something like Vi in an IDE like Eclipse, the ability to tinker with config settings, scripts and the metric ton of stuff that’s not checked out into my workspace? Made of win.

PS. CakePHP 2.0 Stable – codename: Made of Win. And, I follow this blog like a puppy. That is all.

satyrwilder on 6/3/11

Hey Mark,

Are you using Fugitive for working with Git? It’s a little hard to get used to buts it’s fantastic!

Inside of a file that is under git source control, type :Gstatus and it will bring up a split window with the output of the git status command. The magic starts when you move down to a file in the git status. You can type – (hyphen) and it will interactively add that file to the staging area (or unstage if it’s already staged).

Then you can do :Gcommit to write a commit message in a split window.

You can also do :Gdiff and it will create a vertical split window of the file showing you the diff. Which you can then edit in real time and have both panes change so as you add to the file the diff is showing you the additions.

I highly recommend it (it comes with Janus I believe). I highly recommend any plugin written by Tim Pope.

Brandon Cordell on 6/15/11

One more thing.

When you want to search in the file for a string you can do a
:/string_to_search

It annoyingly highlights all instances of that string, but you can just hit Esc to get rid of the highlights. You have to type
:nohl.

Brandon Cordell on 6/15/11

Brandon Cordell: I am using fugitive, its pretty fantastic as are most of Tim Pope’s plugins.

mark story on 6/21/11

Hey Mark,
I do allot of terminal work myself, have only tried vim in passing but seems like a few enthusiast’s based on all the comments.

Generally use emacs or jed as its called on some Linux platforms, most platforms have a version of it, even mac not that I’ve tried it yet.

I have just moved over to the mac world but use VM’s extensively like yourself. Would love to hear some other useful tools you use in both the mac and linux world. I use putty many times a day still, have you found a good replacement for the mac side i.e. login profile storing ?

Regards,Brett

Brett Wilton on 9/6/11

Hey. I have a lot of advice!

Firstly, use pathogen for plugins. It makes them simple, compact, and easy. A lot of vim plugins are on github in pathogen-compatible form (clone, and you’re done. It’s really that simple).

https://github.com/tpope/vim-pathogen
video on installing pathogen and another plugin:
http://www.youtube.com/watch?v=ptsjhRTb19s

tpope, as other people have mentioned, also makes a shitload of awesome vim plugins on github, check them out as well.

Secondly, these tutorial videos are AWESOME. Simply second to none.

http://www.derekwyatt.org/vim/vim-tutorial-videos/

Thirdly, (a bit subjective) ALWAYS make sure you know what all the instructions in your .vimrc do. It makes you much more knowledgeable of vim. I have constructed mine myself and thoroughly commented everything. I don’t think using another person’s distribution is a good idea, unless you know you understand everything it’s doing.

Fourthly, syncing with dropbox IS easy: make a folder in it called ‘vim’ or whatever, and place your .vimrc and .vim folders in it. Then just symlink those two things to ~. Done.

Fifthly, this is much more my personal opinion, I don’t think it’s useful to use plugins which try to get vim to ‘emulate’ other things. It’s modus operandi is really quite alien to almost everything else (any other editor, or OS), and this modus operandi is the reason it is fast. Converting it to other methods of operation just makes you not as fast as you could be doing it natively in vim.

By example, I don’t agree with MacVim helping out with shortcuts for the mac (apart from mayyybe global copy and paste…) [but also MacVim is vim’s main distribution on the mac, so can’t be helped to an extent], I don’t agree with a plugin trying to emulate Textmate (although there are a few, including in the video I linked, that do snippets), and also I much prefer to extend vim’s functionality, rather than modify it.

Last tip: always work with one vim instance. you can do this by having an alias to ‘ —remote-silent’ to start editing. You can pass that as many files as you want.

Ivo on 9/14/11

Thanks for all the tips Ivo. I’m thinking of giving Pathogen a try. I agree with knowing what all the various parts of of your vim config files do. I found Janus to be great for a beginner as you can get started easily, and dig into the details as you learn more.

mark story on 9/17/11

Hey Mark, have you tried SublimeText?

http://www.sublimetext.com/

danfreak on 11/4/11