I have included the autocmd (listed below) in my .vimrc file.
au BufReadPost * if &readonly | set nomodifiable
The intention is to not let gvim even modify the read only files, which
works great with some downside.
It only works when I just start a new gvim window!!! If, in the same window,
I load a different buffer (by opening a new read only file) I have to go in
and manually do "set nomodifiable"... which is very annoying.
I tried to play around with the different au[tocmd] events
(http://www.at.vim.org/html/autocmd.html#BufReadCmd)
But, seems that I cannot get around the issue that I have.
Can any one give me some solution around it please.
I am just very annoyed when gvim asks you for a permission to modify a
readonly file. I would like for "nomodifable" to be set all the time for
readonly files.
please advise!?!
thanks in advance,
Rudy
--
View this message in context: http://old.nabble.com/au-BufReadPost-*-if--readonly-%7C-set-nomodifiable-tp28456618p28456618.html
Sent from the Vim - General mailing list archive at Nabble.com.
--
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
No comments:
Post a Comment