Development

HowtoVim (diff)

You must first sign up to be able to contribute.

Changes between Version 1 and Version 2 of HowtoVim

Show
Ignore:
Author:
Ian P. Christian <pookey@pookey.co.uk> (IP: 81.6.197.72)
Timestamp:
05/11/06 19:24:24 (11 years ago)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • HowtoVim

    v1 v2  
    1 = Howto Setup Vim with Symfony = 
     1= Howto Setup Vim with Symfony - Project Symvimny = 
     2 
     3 
     4 
     5== install == 
     6 
     7download: http://pookey.co.uk/files/symvimny.tar 
     8 
     9untar to your home directory. 
     10 
     11copy ~/symvimny/vimrc.sample to your ~/.vimrc or use the sameple configs contents to modify your existing .vimrc 
     12 
     13== details == 
    214 
    315This is tried and tested with Vim7. Vim7 includes far better PHP auto indenting (http://www.2072productions.com/?to=phpindent.txt) 
    517Any questions, email pookey at pookey co uk or message me on IRC. 
    618 
    7 typing '=symv' will automatically insert... 
     19there are curently code templates for validate/something.yml and config/schema.xml.  If you have any other suggestions, please let me know. 
     20 
     21typing '=symv' (short for symfony validator) will automatically insert... 
    822 
    923{{{ 
    2943} 
    3044}}} 
    31  
    32 = The .vimrc = 
    33  
    34 {{{ 
    35  
    36 " Automatically reload .vimrc when changing 
    37 autocmd! bufwritepost .vimrc source % 
    38  
    39 " colorscheme desert 
    40 set background=dark 
    41  
    42  
    43 " use spaces rather then tabs, with a width of 2 
    44 set tabstop=2 
    45 set shiftwidth=2 
    46 set expandtab 
    47  
    48  
    49 " this will show tabs and trailing spaces 
    50 set list 
    51 set listchars=tab:>-,trail:- 
    52  
    53  
    54 " Auto indent after a { 
    55 set autoindent 
    56 set smartindent 
    57  
    58 " Linewidth to endless 
    59 set textwidth=0 
    60  
    61 " Do not wrap lines automatically 
    62 set nowrap 
    63  
    64 " Show line numbers by default 
    65 set number 
    66  
    67 function! InsertTabWrapper() 
    68     let col = col('.') - 1 
    69     if !col || getline('.')[col - 1] !~ '\k' 
    70         return "\<tab>" 
    71     else 
    72         return "\<c-p>" 
    73     endif 
    74 endfunction 
    75  
    76 " Remap the tab key to select action with InsertTabWrapper 
    77 inoremap <tab> <c-r>=InsertTabWrapper()<cr> 
    78  
    79 set ignorecase                  " caseinsensitive searches- 
    80 set showmode                    " always show command or insert mode- 
    81 set ruler                       " show line and column information- 
    82 set showmatch                   " show matching brackets 
    83 set formatoptions=tcqor 
    84 set whichwrap=b,s,<,>,[,]       " cursors will now wrap 
    85  
    86 " {{{ Symfony Code Templates 
    87  
    88 " validation class... 
    89 map! =symv   class myUnnamedValidator extends sfValidator<CR>{<CR>public function execute (&$value, &$error)<CR>{<CR>if ($value)<CR>{<CR>$error = $this->getParameter('my_error');<CR>return false;<CR>}<CR>return true;<CR>}<CR><CR>public function initialize ($context, $parameters = null)<CR>{<CR>parent::initialize($context, $parameters);<CR>$this->getParameterHolder()->add($parameters);<CR>$this->getParameterHolder()->set('my_error', 'Invalid');<CR>return true;<CR>}<CR>} 
    90 " }}} Symfony Code Templates 
    91  
    92 }}}