vim error reading input - Editors
This is a discussion on vim error reading input - Editors ; Hi,
i've got this filetype.vim in my ~/.vim directory:
augroup filetypedetect
au! BufRead,BufNewFile *.plt setfiletype gnuplot
au! BufRead,BufNewFile *.txt setfiletype text
au! BufRead,BufNewFile *.VHD setfiletype vhdl
au! BufRead,BufNewFile */mail/* setfiletype mail
au! BufRead,BufNewFile /tmp/$USER/man* setfiletype man
augroup END
Now, when ...
-
vim error reading input
Hi,
i've got this filetype.vim in my ~/.vim directory:
augroup filetypedetect
au! BufRead,BufNewFile *.plt setfiletype gnuplot
au! BufRead,BufNewFile *.txt setfiletype text
au! BufRead,BufNewFile *.VHD setfiletype vhdl
au! BufRead,BufNewFile */mail/* setfiletype mail
au! BufRead,BufNewFile /tmp/$USER/man* setfiletype man
augroup END
Now, when i run 'gvim -V file.plt', i get this error:
line 1: " myfiletypefile
line 2: augroup filetypedetect
line 3: ^Iau BufRead,BufNewFile *.plt^I^I^I^Isetfiletype gnuplot
Vim: Error reading input, exiting...
Vim: Finished.
Does anyone have an idea, why i get this error?
Platform: vim 6.4 under Mac os X 10.4.9
(Funny enough, i don't get this error message when i run 'gvim file.plt' ...
But then, it also does not seem to execute my gnuplot.vim)
Any hints , suggestions, etc., will be appreciated.
Best regards,
Gabriel.
-
Re: vim error reading input
Gabriel Zachmann wrote:
>
> augroup filetypedetect
> au! BufRead,BufNewFile *.plt setfiletype gnuplot
> au! BufRead,BufNewFile *.txt setfiletype text
> au! BufRead,BufNewFile *.VHD setfiletype vhdl
> au! BufRead,BufNewFile */mail/* setfiletype mail
> au! BufRead,BufNewFile /tmp/$USER/man* setfiletype man
> augroup END
>
In contrast to func! and command! ,au! removes all autocommands
in the current group.
What you want is this :
augroup filetypedetect
au!
au BufRead,BufNewFile *.plt setfiletype gnuplot
au BufRead,BufNewFile *.txt setfiletype text
au BufRead,BufNewFile *.VHD setfiletype vhdl
au BufRead,BufNewFile */mail/* setfiletype mail
au BufRead,BufNewFile /tmp/$USER/man* setfiletype man
augroup END
autocommands are not unique like functions, if you define them more then
once, they'll be executed multiple times. Thats the whole reason for
defining a augroup and doing a au! in it, in case the files get sourced
more then one time.
-ap
-
Re: vim error reading input
Gabriel Zachmann wrote:
>
> (Funny enough, i don't get this error message when i run 'gvim file.plt' ...
> But then, it also does not seem to execute my gnuplot.vim)
>
Do you know what the -V option does ?
-ap
Similar Threads
-
By Application Development in forum c++
Replies: 2
Last Post: 10-17-2007, 11:58 PM
-
By Application Development in forum basic.visual
Replies: 0
Last Post: 02-20-2007, 08:35 PM
-
By Application Development in forum REXX
Replies: 15
Last Post: 03-18-2005, 09:53 AM
-
By Application Development in forum REXX
Replies: 9
Last Post: 03-17-2005, 05:39 AM
-
By Application Development in forum Perl
Replies: 1
Last Post: 02-16-2004, 12:13 PM