[m-rev.] for review: rewrite of vim syntax file

Sebastian Godelet sebastian.godelet at outlook.com
Wed May 6 15:32:46 AEST 2015


Hi Peter,

I've created a pull request https://github.com/Mercury-Language/mercury/pull/23
Sorry took me so long, having lots of trouble with getting a working permission here,
I'll try to respond faster in the future.

Cheers, Sebastian.

> -----Original Message-----
> From: Peter Wang [mailto:novalazy at gmail.com]
> Sent: Wednesday, April 22, 2015 1:08 PM
> To: Sebastian Godelet
> Cc: reviews
> Subject: Re: [m-rev.] for review: rewrite of vim syntax file
> 
> On Thu, 16 Apr 2015 16:57:49 +0800, Sebastian Godelet
> <sebastian.godelet at outlook.com> wrote:
> 
> > diff --git a/vim/ftplugin/mercury.vim b/vim/ftplugin/mercury.vim
> > index 1087274..c996e49 100644
> > --- a/vim/ftplugin/mercury.vim
> > +++ b/vim/ftplugin/mercury.vim
> > @@ -1,9 +1,11 @@
> >   " Vim syntax file
> >   " Language:     Mercury
> >   " Maintainer:   Sebastian Godelet <sebastian.godelet at outlook.com>
> > -" Last Change:  2015-04-15
> > +" Last Change:  2015-04-16
> >   " vim: ts=2 sw=2 et
> >
> > +" for documentation, please use :help mercury-ftplugin
> > +
> >   if exists("b:did_mercury_ftplugin")
> >     finish
> >   endif
> > @@ -18,7 +20,7 @@ setlocal
> > tags+=$HOME/mercury/tags.library,$HOME/mercury/tags.compiler
> >
> >     " Handy if you use `:make'.
> >     "
> > -setlocal makeprg="mmc -m"
> > +setlocal makeprg=mmc\ --make
> 
> Actually, the projects I work with use a makefile or a shell script to
> drive mmc --make, so this turns out to be counter-productive.  It might
> be the case for a lot of projects.  I have commented it out for myself.

For the make command problem, I was thinking of creating a little shell script which
in absence of any Makefiles in the directory it could use mmc -m and else invoke make.
> 
> > @@ -90,18 +92,29 @@ nnoremap ,P <ESC>O:- pragma
> > foreign_proc("C",<CR><TAB>(_IO0::di, _IO::uo),<CR>[w
> >   nnoremap ,M <ESC>O:- mutable(VAR, TYPE, VALUE, ground, [untrailed,
> > attach_to_io_state]).<ESC>2FVcw
> >   nnoremap ,T <ESC>Otrace [io(!IO)] (<CR>),<ESC>^O<TAB>
> >
> > -  " sg - this is now the default
> > -" nnoremap ,m :set makeprg=mmc\ --make\
> > -nnoremap gi m':1/^:- interface<CR>jj
> > -nnoremap gI m':1/^:- implementation<CR>jj
> > -nnoremap gE m':/^:- end_module<CR>
> > +nnoremap <C-X>i m':1/^:- interface<CR>jj
> > +nnoremap <C-X>I m':1/^:- implementation<CR>jj
> >
> >   inoremap <F3> ::in,
> >   inoremap <F4> ::out,
> >   inoremap <F5> io::di, io::uo)
> >   inoremap <F6> is det.
> 
> I found out that Vim supports buffer-local mappings.  ftplugin/mercury.vim
> can introduce mappings like this so they only apply to Mercury files.
I've added those. Cool thing.
> 
>     inoremap <buffer> ...
>     nnoremap <buffer> ...
> 
> A minor improvement is to add <silent> for these:
> 
>     nnoremap <buffer> <silent> <C-X>i m':1/^:- interface<CR>jj
>     nnoremap <buffer> <silent> <C-X>I m':1/^:- implementation<CR>jj
> 
> There haven't been any objections, so can you send a pull request or
> patch and I'll commit it for you.
> 
> Peter




More information about the reviews mailing list