Ⅰ. 插件描述
vim plugin for Freemarker (ftl) syntax and functionsⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'andreshazard/vim-freemarker'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'andreshazard/vim-freemarker'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'andreshazard/vim-freemarker'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/andreshazard/vim-freemarker
Ⅳ. 文档说明
VIM-Freemarker
When opening a .ftl file the filetype will be set to "freemarker"
this will activate the syntax highlighting.
The plugin also has some functions for quick editing.
Installation
You can use Pathogen
git clone https://github.com/andreshazard/vim-freemarker.git
~/.vim/bundle/vim-freemarker.vimFor Vundle
add to your vimrc
Plugin 'andreshazard/vim-freemarker'Highlighting
The color will depend on your colorscheme

Functions and Mapping
The plugin has the follwing functions that will only be load when opening a
.ftl file, you can map them in your vimrc :
:call FTLIf()
It will insert the basic if tags (#if-#else) and leave the cursor after the if tag
in insert mode
You can use this map in your vimrc
nnoremap <leader>fi :call FTLIf()<CR>
:call FTLList()
It will insert the basic list tags(#list-#else-/#list). Cursor after the list tag in
insert mode
You can use this map in your vimrc
nnoremap <leader>fl :call FTLList()<CR>
:call FTLBigList()
It will insert the new (since FreeMarker 2.3.23) list tags(#list-#items-/#items-#else-/#list).
Cursor after the list tag in insert mode
You can use this map in your vimrc
nnoremap <leader>fb :call FTLBigList()<CR>
:call FTLSwitch()
It will insert the switch tags(#switch, 3 #case and #break, #default, /#switch).
Cursor after the switch tag in insert mode
You can use this map in your vimrc
nnoremap <leader>fs :call FTLSwitch()<CR>
:call FTLAssign()
It will insert the assign tag and leave the cursor on insert mode
nnoremap <leader>fa :call FTLAssign()<CR>
