May. 8., 2008

vi(m) rulez!

By Steffen Müller. Licensed under the Creative Commons License

I don't like those bloatware IDEs like Eclipse etc. It's just too oversized for most of my projects. My favorite tool for writing code is vim (Vi iMproved). And it comes with so many neat features, like code completion, for example.

I just stumbled upon some ways to use code completion for writing PHP code:

When in Insert mode, type the beginning of a PHP function, for example

array_s

Then hit <Control-X> <Control-O> and vim will show you all possible functions in a drop down menu. Just choose the one you were looking for and hit enter

array_search( 
array_search( f
array_shift( f
array_slice( f
array_splice( f
array_sum( f

Find out more about vim secrets: www.vim.org/tips/tip.php

--> Back to the list of articles

Tags: vi, Programming

License

Licensed under creative commonsThis article is licensed under the Creative Commons License CC BY-SA 3.0. You are free to share (copy, distribute and transmit) and to remix (to adapt) the work under the following conditions:

  • You must attribute the work by mentioning the name of the author (Steffen Müller) and setting a link back to the original article using its URL.
  • If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.

Comments

  1. Steffen wrote on May 9, 2008 at 19:17

    Obviously, this only works in vim >=7.x

  2. SW wrote on May 30, 2008 at 23:53

    Wow, this is great. I've been using Vim for over 8 years now, and Vim7 since it was released - how did I miss this incredibly useful feature? Thanks a lot!


Leave a comment:

This page uses static caches. Make sure you reload the page in your browser after posting a comment.

(will not be published)

CAPTCHA image for SPAM prevention Click here for audio version of the word to enter.

If you can't read the captcha word, please click to load a new image.
(You need Javascript turned on. Otherwise press the submit button and wait until the page has reloaded.)