Monday, September 24, 2012

autocmd error in vim

my .vimrc has the structure:
" Fortran stuff
:let fortran_do_enddo=1
:let fortran_more_precise=1
:let fortran_free_source=1
:let fortran_have_tabs=1
autocmd BufNewFile *.f90 call New_Fortran_File()
fun! New_Fortran_File()
:0put='!This is file : ' . expand('%')
:put='Implicit None'
exe ":3"
endf

which is working fine with gvim, but if I use vim, its giving error.
The error prompt is coming in non f90 file also. as:
$ vi i
Error detected while processing /home/rudra/.vimrc:
line 31:
E488: Trailing characters: :0put='!This is file : ' . expand('%')
line 32:
E488: Trailing characters: :put='Implicit None'
Press ENTER or type command to continue

My vim is up-to-date
$ vi --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Aug 28 2012 13:51:59)
Included patches: 1-415, 417-638

Does it mean vi(m) do not support autocmd? Or I am doing something
wrong?
Please help.
If needed, I am posting my full vimrc:

set autoindent
set smartindent
"set hlsearch
set incsearch
set ignorecase
set smartcase
set novisualbell
set paste
set ruler
set expandtab
set smarttab
set shiftwidth=3
set softtabstop=3
"set mouse=a "enable mouse
set nu "show line number
"set cul "highlight current line

if version >= 700
set spell spl=en_us
set nospell
nmap <F12> :set spell!
endif

" Fortran stuff
:let fortran_do_enddo=1
:let fortran_more_precise=1
:let fortran_free_source=1
:let fortran_have_tabs=1
autocmd BufNewFile *.f90 call New_Fortran_File()
fun! New_Fortran_File()
:0put='!This is file : ' . expand('%')
:put='Implicit None'
exe ":3"
endf
filetype on
filetype plugin on
filetype indent on

syntax enable


"latex only
let g:tex_flavor='latex'

" Always jump to last edited line
if has("autocmd")
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
\| exe "normal! g'\"" | endif
endif

"let g:Imap_UsePlaceHolders = 0
set sw=2
set iskeyword+=:


--
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: