All Projects → violetyk → cake.vim

violetyk / cake.vim

Licence: other
Utility for CakePHP developers.

Programming Languages

Vim Script
2826 projects

Projects that are alternatives of or similar to cake.vim

Dot-It-Up
A collection of dotfile scripts, plugins, and clever hacks so that you can become the master of your own OS! 🚀
Stars: ✭ 254 (+625.71%)
Mutual labels:  vim-plugin
fzf-checkout.vim
Manage branches and tags with fzf
Stars: ✭ 187 (+434.29%)
Mutual labels:  vim-plugin
vim-smt2
A VIM plugin that adds support for the SMT-LIB2 format (including Z3's extensions)
Stars: ✭ 35 (+0%)
Mutual labels:  vim-plugin
fzf-preview.vim
fzf ❤️ preview
Stars: ✭ 49 (+40%)
Mutual labels:  vim-plugin
clojure.vim
Clojure syntax highlighting for Vim and Neovim.
Stars: ✭ 23 (-34.29%)
Mutual labels:  vim-plugin
nan vimrc
A Vim configuration for SSH client to edit on a remote Linux host.
Stars: ✭ 15 (-57.14%)
Mutual labels:  vim-plugin
vim-lamp
💡Language Server Protocol client for Vim.
Stars: ✭ 34 (-2.86%)
Mutual labels:  vim-plugin
cmp-rg
ripgrep source for nvim-cmp
Stars: ✭ 165 (+371.43%)
Mutual labels:  vim-plugin
dps-dial.vim
Increment/decrement plugin using denops.vim
Stars: ✭ 21 (-40%)
Mutual labels:  vim-plugin
markdown-preview-sync
A quasi real-time vim markdown preview plugin | 第一款基于Java的Vim Markdown预览插件
Stars: ✭ 56 (+60%)
Mutual labels:  vim-plugin
SimpleSnippets.vim
Simple snippet support for your Vim and Neovim
Stars: ✭ 86 (+145.71%)
Mutual labels:  vim-plugin
ip2location-cakephp
IP2Location CakePHP plugin enables the user to find the country, region, city, coordinates, zip code, time zone, ISP, domain name, connection type, area code, weather, MCC, MNC, mobile brand name, elevation, usage type, IP address type and IAB advertising category from IP address using IP2Location database.
Stars: ✭ 17 (-51.43%)
Mutual labels:  cakephp
LeaderF-snippet
Intuitive Way to Use Snippet
Stars: ✭ 38 (+8.57%)
Mutual labels:  vim-plugin
bolt.nvim
⚡ Ultrafast multi-pane file manager for Neovim with fuzzy matching
Stars: ✭ 100 (+185.71%)
Mutual labels:  vim-plugin
completor-swift
Swift code completion for completor.vim
Stars: ✭ 15 (-57.14%)
Mutual labels:  vim-plugin
vim-rec
GNU Recutils syntax highlighting support for Vim
Stars: ✭ 30 (-14.29%)
Mutual labels:  vim-plugin
vim-colors-pencil
Light (& dark) color scheme inspired by iA Writer
Stars: ✭ 564 (+1511.43%)
Mutual labels:  vim-plugin
vim-jukit
Jupyter-Notebook inspired Neovim/Vim Plugin
Stars: ✭ 55 (+57.14%)
Mutual labels:  vim-plugin
vim-dap
Vim/Neovim debugger plugin providing a terminal interface to the Debug Adapter Protocol
Stars: ✭ 43 (+22.86%)
Mutual labels:  vim-plugin
CakePHP-Shell-Scripts
Reusable CakePHP project shell scripts.
Stars: ✭ 16 (-54.29%)
Mutual labels:  cakephp

cake.vim

Utility for CakePHP developers. Provides the ability to easily jump between files.

Requirements

  • Vim ver.7.3 or heigher
  • CakePHP ver.1.3.x or ver.2.x

Quick Start

  1. Installation Download, unzip, put under the ~/.vim directory.
    If you are using Vundle,as follows:

    :BundleInstall violetyk/cake.vim
  2. Launch vim, specify the application directory of CakePHP.

    :CakePHP /path/to/cakephp_app_directory
  3. Open the file as follows:

    :Ccontroller {controller-name}
  • Argument that you specify in the command {controller-name}, you can tab-completion.

  • You can horizontal split, vertical split, also be open in the tab. Add sp, vsp, and tab to the each command.

  • Multiple arguments can be specified.

    :Ccontrollersp {controller-name} {controller-name} ...
    :Ccontrollervsp {controller-name} {controller-name} ...
    :Ccontrollertab {controller-name} {controller-name} ...

Jump Command List

No arguments : If you do not specify arguments, guess depending on the type of the current buffer.

Target Command Multiple arguments No arguments
Controller :Ccontroller {controller-name} ok View / Model / ControllerTestCase
Model :Cmodel {model-name} ok Controller / Fixture / ModelTestCase
View of the current controller :Cview {view-name} ({theme-name}) ({theme-name} is optional)
View of action the current controller :Cview
View of the specified controller :Ccontrollerview {controller-name} {view-name} ({theme-name}) ({theme-name} is optional)
Config (core.php, database.php etc) :Cconfig {config-name} ok
Component :Ccomponent {component-name} ok ComponentTestCase
Behavior :Cbehavior {behavior-name} ok BehaviorTestCase
Helper :Chelper {helper-name} ok HelperTestCase
Shell :Cshell {shell-name} ok
Task :Ctask {task-name} ok
Cake Core library :Ccore {core-name} ok
1st party library :Clib {lib-name} ok
Log File (like tail -f) :Clog {log-name} (See g:cakephp_log)
Fixture :Cfixture {fixture-name} ok Model
TestController :Ctestcontroller {controller-name} ok Controller
TestModel :Ctestmodel {model-name} ok Model
TestComponent :Ctestcomponent {component-name} ok Component
TestBehavior :Ctestbehavior {behavior-name} ok Behavior
TestHelper :Ctesthelper {helper-name} ok Helper
Test (Any) :Ctest Controller / Model / Component / Behavior / Helper / Fixture

gf

  • In Vim, you press the gf in normal mode, open the path it is written under the cursor, but, gf in a project in CakePHP to open the file of the object.
  • <C-w>f is horizontal split, <C-w>gf is open in a tab, and gs is vertical split. See g:cakephp_keybind_vsplit_gf.

Example

// gf on AppController -> AppController
class MyController extends AppController {
  // gf with the following line -> layouts/2column.ctp
  var $layout = '2column';
  
  // gf on Post -> PostHelper
  var $helpers = array('Post');

  // gf on Session -> SessionComponent (CakePHP Core)
  var $components = array('Session');

  // gf with the following line -> index.ctp
  function index() {

    // gf with the following line -> layouts/default.ctp
    $this->layout = 'default';
    
    // gf on Post -> PostModel
    $this->Post->find('all')
    
    // gf on Set -> cake/libs/set.php
    Set::extract('/Post', $posts);
    
    // gf with the following line -> views/{controller-name}/pc/index.ctp
    $this->render('pc/index.ctp');
  }
}

// gf with the following line -> config
Configure::load('list');

// gf with the following line -> views/elements/pager.ctp
$this->element('pager');

// gf with the following line -> views/elements/sidebar/menu.ctp
$this->element('sidebar/menu');

// gf with the following line -> css/style.css
$html->css('style');

// gf with the following line -> js/jquery.js
$html->script('jquery');

// gf with the following line -> HogeController::fuga()
array('controller' => 'Hoge', 'action' => 'fuga')

// gf with the following line -> HogeController::admin_fuga()
array('controller' => 'Hoge', 'action' => 'fuga', 'admin' => true)

Utility Command

  • If dbext.vim is installed, you can see the table definition of the model, :Cdesc {model-name}. If you do not specify an argument, the word under the cursor can be specified.
  • :Celement {element-name} Cut out as an element the selected range. :help :Celement
  • :Cbake [{target}] Run bake command interactively. :help :Cbake
  • :Ctestrun [{testmethod}] Run test case command, guess depending on the type of the current buffer.
  • :Ctestrunmethod Run the test method of the current line.

unite-sources

Target Source
Controller cake_controller
Model cake_model
View of the current controller cake_view
View of the specified controller cake_view:{controller-name}
Config cake_config
Component cake_component
Behavior cake_behavior
Helper cake_helper
Shell cake_shell
Task cake_task
Fixture cake_fixture
Cake Core library cake_core
1st party library cake_lib
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].