vim-php-snippets


Ⅰ. 插件描述

generate vim snippets for php

Ⅱ. 基本信息

创建日期:  2015-06-13
使用用户:  2
Github星:  0
插件作者:  hanson

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'liangguohuan/vim-php-snippets'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'liangguohuan/vim-php-snippets'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'liangguohuan/vim-php-snippets'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/liangguohuan/vim-php-snippets

Ⅳ. 文档说明

# vim php snippets

Generate vim snippets for php via 'https://github.com/alvan/vim-php-manual.git'

The generating files can be found in folder named 'tools'

If you use 'noesnippet' plugin, you can do the config like it below:

" Enable snipMate compatibility feature.
let g:neosnippet#enable_snipmate_compatibility = 1

" Tell Neosnippet about the other snippets
let g:neosnippet#snippets_directory='~/.vim/bundle/vim-snippets/snippets,~/.vim/bundle/vim-php-snippets'

We can do something better, it is convenient to delete the arg's type tip and others

" Map to nice work in PHP
autocmd FileType php inoremap <buffer> ;; <End>;
autocmd FileType php nnoremap <buffer> ;; <End>A;<esc>
autocmd FileType php inoremap <buffer> $$ <C-Left>$<esc>ea
autocmd FileType php inoremap <buffer> $g <C-Left>$<esc>ea->
autocmd FileType php inoremap <buffer> -g <End>->
autocmd FileType php inoremap <buffer> <C-Space> <C-Left>$<esc>ea = 
autocmd FileType php smap <buffer> kk <Esc><C-Left><S-Left>viwdea

添加新评论