Setting Up Your .vimrc File for PHP Editing
Vim’s .vimrc is a config file, the beating heart of the program, and an essential step in getting Vim up and running. Using the .vimrc file, you can set up default settings for just about anything at all.
Vim usually comes with an example which you can copy to your home directory and edit with vim by issuing the following at the command line:
$ cp /usr/share/vim/vim70/vimrc_example.vim ~/.vimrc
$ cd ~
$ vim .vimrc
The .vimrc can not only contain basic config instructions, but also scripts. Here are a few useful settings I have found for editing PHP files:
Turns on the highlighted search function. You simply type ‘/’ followed by your search text and hit enter.
set hlsearch -
set nohls -Stops the word highlighting from sticking on longer than you need it to
set incsearch - Enables incremental searching - starts to search from first input character
set tabstop=4, set shiftwidth=4 - These are for getting Vim to set tabs and shift widths to PEAR standards
noremap - This maps -C to run the PHP parser and check the code you are editing
set showmatch - This setting highlights matching brackets while you are typing
syntax on - Finally, this turns on syntax highlighting - pretty colours if you like that sort of thing!
About this entry
You’re currently reading “ Setting Up Your .vimrc File for PHP Editing ,” an entry on chris ramsay
- Published:
- 10.11.06 / 12pm
- Category:
- Programming, Uncategorized, Vim










No comments
Jump to comment form | comments rss [?] | trackback uri [?]