yii vim eclimd how it works

You are viewing revision #2 of this wiki article.
This version may not be up to date with the latest version.
You may want to view the differences to the latest version.

next (#3) »

I want to create a wiki page, and therefore im opening this discussion on this forum, for answering all questions and see other opinions, how do you use vim with yii.

At first, i work with Gvim. I have a script file for opening saved session and custom bindings for every project.

#!/bin/bash
if [[ $# != 1 ]]
then
    zenity --title "Vim IDE usage error" --error --text "Usage: vim_ide /path/to/project/dir."
    exit 1
fi

if [[ ! -e "$1/.vim/ide.vim" ]]
then
    zenity --title "Vim IDE usage error" --error --text "'$1' is not a Vim IDE project directory."
    exit 1
fi

cd "$1" || { zenity --title "Vim IDE usage error" --error --text "Can't change current directory to Vim IDE project directory '$1'."; exit 1; }

My every project has .vim folder under the root folder. there is one file at start .vim/ide.vim

set sessionoptions-=options
au VimLeave * :mksession! .vim/ide.session
    if getfsize(".vim/ide.session") >= 0
        source .vim/ide.session
    endif

Above is a default code for every project. But sometimes i have several bindings in this file, for example binding deployng files to production server

nmap <f3> :execute "Nwrite ftp://username@*.*.60.252/httpdocs/".expand("%")<CR> //Now i can upload files via ftp to production server. 
nmap <f12> :! cd /home/alex/site.com/yii-version/protected/tests/ && phpunit  ./functional/AdminPanelTest.php<cr> // i run tests when i code

And i open project with next command $~/ide.sh /path/to/project . And it opens my project with all opened files, and tabs saved on last exit.

I use tabs for my code process. Next tabs i see on my every project:

Tests tab | Controllers Tab | Layouts tab | Views Tab | Model Tab | Temporary working tab

i use shortcuts for switching between them:

<leader>tt - tests tab
<leader>tc - controllers tab
<leader>tl - layouts tab
<leader>tv - views tab
<leader>tm - model tab
<leader>tw - working tab

For explorering i also have some bindings:

<leader>sv - slplit window and open Views folder
<leader>sc - slplit window and open Controllers folder
<leader>st - slplit window and open Tests folder
<leader>sm - slplit window and open Models folder
// also i use leader>v to explore folder without splitting.
// or if im editing model file and want to open another model, i just use <leader>e which makes :Explore command and open current folder for me
<leader>cm - open main config for yii project

What about my autocomplete ?

I use eclimd plugin and it has good eclipse autocomplete funcional. I see small window with preview variables which function needs. And preview window closes when i leave current insert mode. ss

Im open to discuss and share my experience. Forum Topic

8 0
8 followers
Viewed: 12 919 times
Version: Unknown (update)
Category: How-tos
Tags: eclimd, vim, vimrc
Written by: RusAlex
Last updated by: RusAlex
Created on: Feb 25, 2011
Last updated: 12 years ago
Update Article

Revisions

View all history