User login

code editor

Indent lines in Vim

To indent a set of eight lines in vim, from the first one, in normal (esc) mode:

8>>

To indent a curly braces block, go to a curly brace and:

>%

To mark and indent (using 'm' as the marking letter, the first m is the marking command):

Enter mm at the top of block to indent, go down to the end of what needs to be indented, and type >'m

Find the function definition of the current function or find uses of a given function

'gd' doesn't do anything for me (recommended here: http://jmcpherson.org/editing.html )

The asterisk works great though!

  • Read the string under the cursor and go to the next place it appears. (For instance, if your cursor was somewhere on the word "bob," the cursor would move to the next occurance of "bob" in your file.)

Same as above, except it moves the cursor to the previous occurrence.

Vim as a PHP IDE

See
(domain not renewed as of 2010 Nov. 4 - phpslacker.com/2009/02/05/vim-tips-for-php-programmers/ )

Once it's set up right, you can use :make % to check your PHP syntax before loading the code in a browser.

See also: http://2bits.com/articles/using-vim-and-xdebug-dbgp-for-debugging-drupal-or-any-php-application.html

Syndicate content