sponsor Vim development Vim logo Vim Book Ad

cakephp.vim : Tools for working with CakePHP from vim

 script karma  Rating 4/3, Downloaded by 797  Comments, bugs, improvements  Vim wiki

created by
Nick Reynolds
 
script type
utility
 
description
Check out the plugin's git repository at http://github.com/ndreynolds/vim-cakephp for the most recent updates.  You can also find instructions on installing with Git there.  The README, which you'll find at the link as well as in the zipfile here, contains a quick getting started guide.
          
cakephp.vim offers a lot of features that make building CakePHP apps with vim a lot easier.  It tries to be for CakePHP what rails.vim is for Ruby on Rails.  I wouldn't say it's there yet, but I'm slowly adding features as I identify the need for each one.


          
What cakephp.vim offers:
          
-- Nothing to set.  The plugin will add an indicator to your statusline when you edit CakePHP files.  If you see the indicator, all the cakephp.vim commands are available, and the plugin already knows where your application's root is.
          
-- Knows the MVC structure.  When you call :Ccontroller without arguments from a model, the plugin knows to open that model's associated controller.  You're also free to specify any controller you like.  Call :Cview from within a controller function and you'll jump to the corresponding view.
          
-- Tab completion everywhere.  If your .vimrc is set up for it, all the navigation commands have tab completion, so you can quickly see which views are available and switch to any given one in just a few key strokes.
          
-- No worrying about file extensions.  I figure CakePHP is standardized enough that you should never need to tell this plugin the file extension.  You'll also never need to type out '_controller'--both this and the extension are automatically taken care of when cakephp.vim opens files.
          
-- Commands for opening everything from logs (:Clog) to stylesheets ( :Ccss) to components (:Ccomponent).
          
-- You can query the API docs (which unfortunately aren't stored locally by Cake) with :Cdoc [query], opening search results in the default web browser, or if you use the variant command, :CLdoc, it will open the results in Lynx.

-- If you use the plugin a lot, you could play with the mappings.  I've mapped :Ccontroller to <leader>c and :Cmodel to <leader>m.  Jumping between model and controller doesn't get much faster.


          
It's been developed on Ubuntu and OSX with Vim 7.2.  It should work fine on most *nixes with 7.0 and up.  I've also tested it briefly on Windows 7 using gvim and didn't have any problems.  Submit an issue on the Github repo (or email me) if you find any bugs.
 
install details
It's just your average plugin.  doc/cakephp.txt goes in ~/.vim/doc, plugin/cakephp.vim goes in ~/.vim/plugin.  If you use a plugin manager, follow its instructions instead.

The help file can be loaded with :helptags ~/.vim/doc, or something to that effect.  A lot of plugin managers will do this for you.  Once it's loaded, you can call :help cakephp from vim.  The documentation on most of the commands can be accessed similarly-- :help :Cview -- for example.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
cakephp.zip 1.2.5 2011-07-09 7.0 Nick Reynolds --Adds a bunch of new commands like :Cgrep, :Chelper, :Ccomponent, and so on...
--Fixes some bugs with model/controller names that have multiple underscores.
--Adds an indicator to the statusline when editing a CakePHP file, commands are only available when this is present.
--Better app detection to go along with the above.
--A lot of internal improvements.
cakephp.zip 1.1 2011-06-30 7.0 Nick Reynolds Initial upload
ip used for rating: 3.16.66.206

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github