Loading ...
Sorry, an error occurred while loading the content.

Re: What am I doing wrong with auto commands.

Expand Messages
  • Benji Fisher
    ... [snip] ... [snip] Try starting vim with the -V flag, so that you can see which autocommands are executed. Alternatively, :set verbose=10. (If you are
    Message 1 of 2 , Mar 1, 2001
    • 0 Attachment
      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
      > twice.
      >
      > 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
      > right.
      >
      > Thanks for your input.
      [snip]
      > " Python autocmds
      > 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 %
      [snip]

      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
      second problem.

      HTH --Benji Fisher
    Your message has been successfully submitted and would be delivered to recipients shortly.