Christian, thanks for your reply!

What would you say about such a scheme:

First, I have this defined in my .vimrc:

```VIMRC```
augroup MyAutoCmd
    autocmd!
    autocmd MyORIGINALFancyAutoCmdHere
augroup END
```VIMRC END```

Second, these triggers are present in the filetype-specific settings

```after/ftplugin/somefiletype.vim```
function! NewCmdOn()
    augroup MyAutoCmd
        autocmd!
        autocmd MyNEWFancyAutoCmdHere
    augroup END
endfunction
autocmd! BufEnter,WinEnter,TabEnter <buffer> call NewCmdOn()

function! NewCmdOff()
    augroup MyAutoComp
        autocmd!
        autocmd MyORIGINALFancyAutoCmdHere
    augroup END
endfunction
autocmd! BufLeave,BufDelete <buffer> call NewCmdOff()
```after/ftplugin/somefiletype.vim END```

Now, upon entering the filetype-specific buffer, the original autocmd defined 
in .vimrc will be reset and overwritten with the new one. And if leaving this 
filetype-specific buffer, it will be reset again, and then overwritten with the 
original one. Am I right? BufLeave and BufDelete should cover all the cases, or 
should I consider adding WinLeave, TabLeave, etc, too?


Thanks!


-- 
ds

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to