Re: What am I doing wrong with auto commands.
- Timothy Grant wrote:
> Hi again,
> I'm working with autocommands to set up differing editing
> environments depending on what files/buffers I'm editing. I use
> different config-on and config-off files for differing events.
> In general things work quite well. However, I am puzzled by a
> few things. The first is that whenever I try and save a python
> file that has been modified. It appears to be saving things
> The second is that when I :wq I regularly see a message
> something like "Document has changed on disk since last save"
> answering "Y" to the prompt is not a huge deal, but it is a
> frustration. I'm including my "not too big" .vimrc and
> vimrc.python-on and vimrc.python-off scripts for any expert
> eyes who care to tell me where I'm not doing things quite
> Thanks for your input.
> " Python autocmds[snip]
> autocmd BufRead *.py source ~/.vim-files/vimrc.python-on
> autocmd BufEnter *.py source ~/.vim-files/vimrc.python-on
> autocmd BufLeave *.py source ~/.vim-files/vimrc.python-off
> autocmd BufNewFile *.py 0r ~/.vim-files/skeletons/skel.py
> autocmd BufNewFile *.py source ~/.vim-files/vimrc.python-on
> autocmd BufWrite *.py !chmod +x %
Try starting vim with the -V flag, so that you can see which
autocommands are executed. Alternatively, :set verbose=10. (If you are
using an old version of vim, check the docs first for -V and 'verbose'.)
Off hand, I would guess that the !chmod has something to do with the
HTH --Benji Fisher