On Tue, Jan 10, 2012 at 01:44:44PM +0100, Bram Moolenaar wrote:
> Ricardo Catalinas wrote:
> > On Wed, Jan 04, 2012 at 02:35:54PM +0100, Bram Moolenaar wrote:
> > > Per Andersson wrote:
> > > > I intend to package vimerl for Debian (current WIP).
> > > >
> > > > I suggest that ftplugin, indent, and syntax parts of vimerl should
> > > > be included in Vim, and then I will package the rest of vimerl
> > > > (autoload, compiler, and plugin) for Debian.  (The parts autoload
> > > > and compiler has Erlang code in them and I assume that is out of
> > > > scope for Vim.)
> > >
> > > To include files with the Vim distribution the maintainer has to send
> > > the file to me.  All the files you appear to fall under the normal
> > > runtime files, except perhaps the plugin.
> > 
> > Hi,
> > 
> > I am the Vimerl[1] maintainer, I attached ftplugin, indent and syntax.
> > As Per explained, the other parts of the plugin depend on Erlang or
> > don't fit the Vim runtime.
> > 
> > [1] http://github.com/jimenezrick/vimerl
> 
> Thanks!
> 
> There already is an Erlang syntax and indent file.  Maintainer is Csaba
> Hoch.  Can you please get in touch and merg the files?
> 
> The license mentioned in the files is GNU GPL version 3.  Can you please
> change that to the Vim license?  Otherwise I cannot include the files in
> the distribution.

  Finally Csaba and me decided to send you for inclusion in the official
Vim distribution just the ftplugin for Erlang with the modifications
that Csaba proposed.

  We prefer to keep the current Csaba's syntax and indent scripts
already present in the Vim runtime. If Csaba decides to update any of
those, I support his decision.


Regards
-- 
Ricardo (http://r.untroubled.be/)

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
" Vim ftplugin file
" Language:     Erlang
" Author:       Oscar Hellström <[email protected]>
" Contributors: Ricardo Catalinas Jiménez <[email protected]>
"               Eduardo Lopez (http://github.com/tapichu)
" License:      Vim license
" Version:      2012/01/25

if exists('b:did_ftplugin')
        finish
else
        let b:did_ftplugin = 1
endif

if exists('s:did_function_definitions')
        call s:SetErlangOptions()
        finish
else
        let s:did_function_definitions = 1
endif

if !exists('g:erlang_keywordprg')
        let g:erlang_keywordprg = 'erl -man'
endif

if !exists('g:erlang_folding')
        let g:erlang_folding = 0
endif

let s:erlang_fun_begin = '^\a\w*(.*$'
let s:erlang_fun_end   = '^[^%]*\.\s*\(%.*\)\?$'

function s:SetErlangOptions()
        if g:erlang_folding
                setlocal foldmethod=expr
                setlocal foldexpr=GetErlangFold(v:lnum)
                setlocal foldtext=ErlangFoldText()
        endif

        setlocal comments=:%%%,:%%,:%
        setlocal commentstring=%%s

        setlocal formatoptions+=ro
        let &l:keywordprg = g:erlang_keywordprg
endfunction

function GetErlangFold(lnum)
        let lnum = a:lnum
        let line = getline(lnum)

        if line =~ s:erlang_fun_end
                return '<1'
        endif

        if line =~ s:erlang_fun_begin && foldlevel(lnum - 1) == 1
                return '1'
        endif

        if line =~ s:erlang_fun_begin
                return '>1'
        endif

        return '='
endfunction

function ErlangFoldText()
        let line    = getline(v:foldstart)
        let foldlen = v:foldend - v:foldstart + 1
        let lines   = ' ' . foldlen . ' lines: ' . substitute(line, "[\ \t]*", 
'', '')
        if foldlen < 10
                let lines = ' ' . lines
        endif
        let retval = '+' . v:folddashes . lines

        return retval
endfunction

call s:SetErlangOptions()

Raspunde prin e-mail lui