Facebook Twitter

How to change color scheme in Vim. Comfortable PHP editing with VIM -3- - Blog - Open Source - It's time to continue my series, since I again updated my .vimrc in the past weeks for much more comfortable editing of PHP sources using VIM.

Comfortable PHP editing with VIM -3- - Blog - Open Source -

There are several new features I added: Auto completion of functions using <TAB>Auto reloading of .vimrc when changedEnclose visually selected text by braces/quotesMuch more convenient scrolling through autoclosing foldsSearch the PHP manual directly in VIM using phpmAdded settings for misconfigured machinesMore convenient creation of phpdoc blocks with correct indenting and automatic * chars To use some of this (and the older) features, you will have to download Rasmus' function list and install phpm (which is very easy). Thanks a lot to everyone on the web providing me with support/tips! For detailed information on what has changed, please read the extended entry.

A short hint for those of you who fight with auto completing enclosing chars (braces/qutotes) when you only want 1 exemplar: Use <CTRL>-v + the char to get only 1 of it! Vim tips: Using viewports. A lot of folks use Vim, but many exploit only a small percentage of the editor's features. Sure, you might know how to do the basics in Vim, but what about using more advanced features such as folding, split windows, and marks? With a little practice, you can really boost your productivity with Vim. In this and future articles, I'm going to cover Vim features that you may not be familiar with if you're a casual Vim user.

If you're confident using Vim to edit configuration files or make short edits in text files, but maybe not too comfortable with undertaking major writing or coding in Vim, then these articles should be for you. Splitting Vim's viewport A really useful feature in Vim is the ability to split the viewable area between one or more files, or just to split the window to view two bits of the same file more easily. Search all files in project quickly. Searching for a word across the project wastes most of the developres time, which can be avoided by the use of GNU Id_utils with VIM.

Search all files in project quickly

The procedure needs to be followed is as follows: download GNU idutils 3.2d (mkid,lid,fid,fnid,xtokid) from uncompress and store these files in the directory from where Vim is running. goto the top level directory of the project, and run mkid, it will create ID file in that directory (As it is time consuming process, so be patient). copy this file ID to the directory from where Vim is running. Put these lines in your vimrc: map _u :call ID_search()<Bar>execute "/\\<" . g:word . To use it, place the cursor on a word, type "_u" and Vim will load the file that contains the word. VIM for a PHP developer at Thijs Lensselink's Blog. For my coding work i mostly use Zend Studio.

VIM for a PHP developer at Thijs Lensselink's Blog

And i am a big fan of this IDE. OSGalaxy. VIM an a PHP IDE - Thomas Koch. UPDATE: I'm using Emacs since some months and consider it superior to VIM for most use cases after using VIM for 4 years.

VIM an a PHP IDE - Thomas Koch

(And I also came to hate PHP by the way.) Projects with Vim using projects.vim. I've been using NERD tree in Vim for a while now, liking the way it easily presents the files I'm working on in a tree format.

Projects with Vim using projects.vim

Unfortunately, many times, I don't need all the files that it lists. And other times, the files I do need are scattered across disparate locations. So I went looking for another solution, and think I've found it. Project.vim. At its root, the plugin takes advantage of Vim foldings to show and hide groups of directories and files. The file listing on the left may look a little arcane, but is actually very easy to create. Given these files: I go into a Vim window, and type :Project. Type \C in the Project window, and a prompt will display. Above, I've titled the project "Django Trunk". Eventually, it will ask you for a file filter. Let it parse through the directories and eventually you'll end up with: Configuring Vim right – I have spent a lot of time peering into a Vim window, and relatedly, a lot of time testing different configurations.

Configuring Vim right –

These are the best non-standard options I’ve found or stolen from others over the years; listed below in order of descending usefulness — though I think everything in this article is worth skimming — is an omnium-gatherum of tips that should have value to anyone, no matter how they like to run Vim. That is, there is minimal editorializing. Note: no plugins are covered here, just vanilla Vim. Essential .vimrc configuration items For whatever reason, the following options aren’t set by default, but they should be.

Turn on hidden Don’t worry about the name. Recommended .vimrc configuration items Most people like these. Use case-smart searching These two options, when set together, will make /-style searches case-sensitive only if there is a capital letter in the search expression. Thanks to Adam Katz and Chris Gaal for their comments and suggestions.