qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] qapi: Add vim magic modelines for qapi definiti


From: Marc-André Lureau
Subject: Re: [Qemu-devel] [PATCH] qapi: Add vim magic modelines for qapi definitions
Date: Wed, 5 Dec 2018 18:09:52 +0400

Hi

On Wed, Dec 5, 2018 at 4:34 PM Peter Krempa <address@hidden> wrote:
>
> On Thu, Oct 04, 2018 at 13:34:12 +0200, Peter Krempa wrote:
> > On Tue, Sep 04, 2018 at 09:03:10 +0200, Peter Krempa wrote:
> > > The files have a json suffix but look terrible with json syntax
> > > hilighting enabled. Add a magic modeline for vim to switch to python
> > > file format for hilighting similarly to the emacs modeline already
> > > present.
> > >
> > > Signed-off-by: Peter Krempa <address@hidden>
> > > ---
> >
> > Ping?
>
> Ping 2. It looks like no new json files were added meanwhile.

I use both emacs and vim. We solved this for me with emacs .editorconf
file_type_emacs.

The vim plugin doesn't have an equivalent, however, the documentation
suggest vim_filetype, but you need to add
to .vimrc:

function! FiletypeHook(config)
    if has_key(a:config, 'vim_filetype')
        let &filetype = a:config['vim_filetype']
    endif

    return 0   " Return 0 to show no error happened
endfunction

call editorconfig#AddNewHook(function('FiletypeHook'))

I think this is a better solution than having to add modelines
everywhere, what do you think?

-- 
Marc-André Lureau



reply via email to

[Prev in Thread] Current Thread [Next in Thread]