Skip to content

real-chocopanda/vim-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My VIM Config

This is my VIM config for PHP/Ruby development based on @vjousse's config.

  • Autocompletion
  • Syntax hightlighting
  • Snippets (comes from vim-symfony-snipmate)
  • Xdebug debugger integration
  • Git integration
  • reStructuredText syntax + preview in browser
  • Markdown syntax + preview in browser
  • Ready for symfony/Symfony2
  • JavaScript ready
  • etc

There is a shell script to symlink all files.

Plugins

This config comes with the following plugins:

  • Fugitive (Git)
  • Solarized
  • snipMate
  • Command-T
  • Gitv
  • Ack
  • surround
  • taglist-plus
  • ...

Commands

  • :W will save the current file with sudo.

Mapping

General

Important: The map leader is ,.

  • ,t will activate Command-T to fast search files.
  • ,2 will set a two-spaces indentation.
  • ,4 will set a four-spaces indentation.
  • ,<Right> is a shortcut for C-] (go to the declaration of a class, variable, ...).
  • ,<Left> is a shortcut for C-T (go back).
  • zz is a shortcut for zjzo.
  • ,te is a shortcut for tabedit.
  • ,tc will close the active tab.
  • ,to is a shortcut for tabonly.
  • ,tn will move to the next tab.
  • ,tp will move to the previous tab.
  • ,tf will move to the first tab.
  • ,tl will move to the last tab.
  • ,tm will move the active tab to the right.
  • ,tr will move the active tab to the left.

PHP

  • ,doc on a PHP function will open the php.net doc.
  • F7 will generate a tags file using ctags.
  • ,cns will insert the curent namespace based on the filename.
  • <ctrl>L will run the PHP linter to detect syntax errors.

See also the Xdebug section above.

Xdebug

  • F1 Resize the debugger window.
  • F2 Step into.
  • F3 Step over.
  • F4 Step out.
  • ,e Eval a variable.
  • F5 Run the debugger.
  • F6 Quit the debugger.
  • F11
  • F12

This mapping only works with the php filetype.

### Markdown

  • F5 will render the active Markdown file in your browser.

reStructuredText

  • F5 will render the active reStructuredText file in your browser.

symfony 1.x

  • C-F3 will switch from the action to the view and from the view to the action.

JavaScript

  • <ctrl>l will run gjslint (if available) to detect JS errors.

Snippets

snipMate adds a lot of snippets but I also wrote mine.

Symfony2

  1. sf2xml.snippets
  • services will add a complete XML structure to declare services in XML.
  • serv will add a single service declaration.
  • param will add a parameter declaration.
  • tag will add a tag declaration.
  • arg will add a scalar argument declaration.
  • args will add a service type argument.
  1. sf2class.snippets
  • action will add an action method.

### symfony 1.x

Too many snippets, please read these files:

  • symfony.snippets
  • sfform.snippets
  • sftemplate.snippets

Propel

  • table will add a new table block definition.
  • column will add a new column declaration.
  • fk, foreign-key will generate a new foreign-key declaration.
  • index will add a new index block definition.
  • i-col will add a new column index declaration.
  • unique will add a new unique block definition.
  • u-col will add a new unique column declaration.

Helpers

  • xdate will insert the current date.
  • xsigp will insert the configured personal signature.
  • xsigw will insert the configured work signature.

Troubleshooting

You may have to install python-markdown :

wget http://pypi.python.org/packages/source/M/Markdown/Markdown-2.0.tar.gz

tar xvzf Markdown-2.0.tar.gz

cd Markdown-2.0/

sudo python setup.py install

Will.

About

A simple light vim-config

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published