andreshazard / vim-freemarker

vim plugin for Freemarker (ftl) syntax and functions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.vim

For Vundle add to your vimrc

Plugin 'andreshazard/vim-freemarker'

Highlighting

The color will depend on your colorscheme

example

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>

asciicast

About

vim plugin for Freemarker (ftl) syntax and functions

License:GNU General Public License v3.0


Languages

Language:Vim Script 100.0%