Hi Keyan!

On Di, 13 Okt 2009, Keyan wrote:

> i have the following problem. for cpp, perl, and others, i have set
> 
> inoremap { { }<ESC>O
> 
> when is switch to .tex, where i dont want this setting, i have to use

Well, the obvious solution would be to use inoremap <buffer> { … only 
for cpp, perl and all your other filetypes. This way, it wouldn't 
interfere with other filetypes. See :h :map-local for buffer local 
mappings and :h ftplugin for help on filetype plugins.

> 
> iunmap {
> 
> but i cant put the last line in my tex.vim, because in case i havent  
> worked on a .cpp buffer before switching to a vim buffer, i cant an  
> error, that there was no inoremap set.

Well, if you don't care, simply use
:silent! iunmap {
which won't complain in case of errors.

But the right(™) solution would be to wrap the iunmap command into 
something like:

if mapcheck('{', 'i') == '{ }<ESC>O'
   iunmap {
endif


regards,
Christian
-- 
:wq

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to