0

I have vim version 7.4.1689. It was running quite smoothly. But recently I noticed a problem that I didn't have before. Whenever I run :help <something> in command mode the following error shows up (say I ran the command help normal):

"various.txt" [readonly] 674L, 26915C
Error detected while processing BufRead Auto commnads for "*.*":
E45: 'readonly option is set (add ! to override)

See attached picture.

I am mentioning all my BufRead autocmds here:

augroup SomeAutocmds
    autocmd!
    autocmd BufNewFile,BufRead *.* write
    autocmd BufNewFile,BufRead *.* source $MYVIMRC
    autocmd BufNewFile,BufRead *.* setlocal foldmethod=marker
    autocmd BufNewFile,BufRead *.* silent loadview
augroup end

I have recently updated my plugins, and I started noticing this problem right after updating my plugins. My plugins are listed below (I am sorry, I have lot of plugins):

Plugin 'LaTeX-Box-Team/LaTeX-Box'
Plugin 'MahbubAlam231/dragvisuals'
Plugin 'MahbubAlam231/hybrid-line-numbers'
Plugin 'MahbubAlam231/searching-with-blinking'
Plugin 'MahbubAlam231/vim-system-copy'
Plugin 'SirVer/ultisnips'
Plugin 'VundleVim/Vundle.vim'
Plugin 'bronson/vim-trailing-whitespace'
Plugin 'christoomey/vim-quicklink'
Plugin 'christoomey/vim-sort-motion'
Plugin 'christoomey/vim-titlecase'
Plugin 'danro/rename.vim'
Plugin 'easymotion/vim-easymotion'
Plugin 'ervandew/supertab'
Plugin 'flazz/vim-colorschemes'
Plugin 'junegunn/fzf.vim'
Plugin 'justinmk/vim-sneak'
Plugin 'kana/vim-textobj-datetime'
Plugin 'kana/vim-textobj-entire'
Plugin 'kana/vim-textobj-indent'
Plugin 'kana/vim-textobj-line'
Plugin 'kana/vim-textobj-user'
Plugin 'mattn/webapi-vim'
Plugin 'scrooloose/nerdtree'
Plugin 'tibabit/vim-templates'
Plugin 'tpope/vim-abolish'
Plugin 'tpope/vim-commentary'
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-repeat'
Plugin 'tpope/vim-surround'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'vim-scripts/ReplaceWithRegister'
Plugin 'vim-scripts/ZoomWin'
Plugin 'vim-scripts/indentpython.vim'
Plugin 'vim-scripts/matchit.zip'
Plugin 'vim-syntastic/syntastic'

BufRead autocmd problem and E45 I had changed *.* to * in BufRead autocmds, but the problem didn't go away. I have tried to find solution to this online, but couldn't find any that helped.

Would be glad if someone points out what's going on and gives a solution.

  • 2
    You're trying to write back the help files as soon as you're opening them: autocmd BufNewFile,BufRead *.* write – lcd047 Feb 18 at 21:02
  • I see! I missed it. Anyway I only need autocmd BufNewFile *.* write. I deleted the BufRead part, and it worked. Here I was thinking that updating the plugins changed something! Thanks :-) – Mahbub Alam Feb 18 at 21:08
  • 1
    @lcd047 you should write a full answer explaining the problem and solution. – D. Ben Knoble Feb 19 at 5:25
  • 1
    Why are you constantly reloading your vimrc via autocmd? And why do you set foldmarker via autocmd for every file? You could also add set foldmethod=marker in your vimrc, so you don't need to set it locally for every file. – Ralf Feb 19 at 5:31
  • @Ralf The autocmd would load my vimrc only once when I create a new file or read a file, isn't it? And you're right about the foldmethod thing, I'll change that. – Mahbub Alam Feb 19 at 10:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.