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'
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.
autocmd BufNewFile,BufRead *.* write
– lcd047 Feb 18 '19 at 21:02autocmd BufNewFile *.* write
. I deleted theBufRead
part, and it worked. Here I was thinking that updating the plugins changed something! Thanks :-) – Mahbub Alam Feb 18 '19 at 21:08vimrc
via autocmd? And why do you set foldmarker via autocmd for every file? You could also addset foldmethod=marker
in your vimrc, so you don't need to set it locally for every file. – Ralf Feb 19 '19 at 5:31vimrc
only once when I create a new file or read a file, isn't it? And you're right about thefoldmethod
thing, I'll change that. – Mahbub Alam Feb 19 '19 at 10:37