Eric Leenman wrote:
Hi,
How do you making inoremap filetype depend?
What I want is
if (filetype == vim) then
inoremap @a AAAAA
else if (filetype == c)
inoremap @a aaaaaa
else if (filetype == vhdl)
inoremap @a AAAaaa
else
inoremap @a aaaAAA
end if
Best regards,
Eric
autocmd FileType *
\ if "<amatch>" == "vim"
\ | inoremap <buffer> @a AAAAA
\ | elseif "<amatch>" == "c"
\ | inoremap <buffer> @a aaaaaa
\ | elseif "<amatch>" == "vhdl"
\ | inoremap <buffer> @a AAAaaa
\ | else
\ | inoremap <buffer> @a aaaAAA
\ | endif
Notice that there is no "then" and that "elseif" and "endif" are single words.
The initial backslashes are line-continuation marks; they require 'nocompatible'.
See
:help :autocmd
:help FileType
:help <amatch>
:help :if
:help :else
:help :elseif
:help line-continuation
Best regards,
Tony.
--
Liar, n.:
A lawyer with a roving commission.
-- Ambrose Bierce, "The Devil's Dictionary"