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

Re: Reload Buffer

Expand Messages
  • stillLearningVim
    Using $MYVIMRC is definitely a smart move. I m not sure why the function has to be silent though. I m also not sure why the autocmd is nested. Don t we only
    Message 1 of 12 , Dec 30, 2012
    • 0 Attachment
      Using $MYVIMRC is definitely a smart move. I'm not sure why the function has to be silent though. I'm also not sure why the autocmd is nested. Don't we only want it to call the function once?

      The "!" after autocmd fixes the problem I was having though. Every time I :source vimrc, it re-added the autocmd, so when saved there were 2 autocmds doing the same thing, then 4, then 8, etc.

      I love the key map to edit the vimrc, beautiful! The key map to sourcing the vimrc however leads to problems mentioned above, like when you remove a map or an autocmd. I think calling a function from a keymap is much more useful.

      Also, I was wrong au! does not remove all autocommands, so using Gary's suggestion of putting them in groups I think is best (or using au! to define them). Also comclear is causing problems. Here's where I'm at within the function for the moment:
      set all&
      " comclear
      abclear
      mapclear
      xmapclear
      smapclear
      mapclear!
      lmapclear
      so $MYVIMRC
      set filetype=vim

      Thanks

      --
      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
    Your message has been successfully submitted and would be delivered to recipients shortly.