> On Tuesday, February 14, 2012, Ben Fritz <fritzophre...@gmail.com> wrote:
>
> > On Feb 13, 3:11 pm, Chris Lott <ch...@chrislott.org> wrote:
> >> Is there a more efficient or better way to cluster together a set of
> >> autocommands in my .vimrc? For instance, I have the following:
>
> >> au BufNewFile,BufRead *.mtxt setlocal filetype=pandoc
> >> au BufNewFile,BufRead *.mtxt setlocal spell
> >> au BufNewFile,BufRead *.mtxt setlocal equalprg=pandoc\ -t\ markdown\
>
> > Are you looking to create a filetype plugin?
>
> Maybe...I'll look into that. I was hoping that I could keep it simple and
> use augroup, but that seems to depend on the filetype already being set,
> which is happening with the vim-pandoc extension. I think. It's rather
> confusing to me still.
>
> At least I know now I can put multiple items on the same line, which helps
> a bit!
>
You could also use a function such as:
function! s:ConfigurePandoc()
setlocal spell
setlocal ...
endfunction
autocmd BufNewFile,BufRead *.mtxt call s:ConfigurePandoc()
Jeroen
--
You received this message from the "vim_use" 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
No comments:
Post a Comment