How can I edit the default vimrc file on osx? (sudo chown ... gives Operation not permitted )
In osx vim /usr/share/vim/vimrc
is the default vimrc file
My username is 'apple'
If I try to do vim /usr/share/vim/vimrc
then it says 'read only'
~/.vim$ ls -l /usr/share/vim/vimrc -rw-r--r-- 1 root wheel 532 5 Apr 2017 /usr/share/vim/vimrc ~/.vim$
If I try to change ownership of the file
~/.vim$ sudo chown apple /usr/share/vim/vimrc
chown: /usr/share/vim/vimrc: Operation not permitted
~/.vim$
similarly with permissions (giving write access to non-root users temporarily for the purposes of me editing the file)
~/.vim$ sudo chmod 666 /usr/share/vim/vimrc
chmod: Unable to change file mode on /usr/share/vim/vimrc: Operation not permitted
~/.vim$
sudo chown does work on another file though, so it's not a password issue.
~/.vim$ cp /usr/share/vim/vimrc zzz
~/.vim$ ls -l zzz
-rw-r--r-- 1 apple staff 532 3 May 23:10 zzz
~/.vim$ sudo chown root zzz
~/.vim$ sudo chown apple zzz
~/.vim$
.vimrc
file in your home directory, rather than making a change to a system file.~/.vim/vimrc
, but I want to change the file that runs first. As to why, it's a personal preference that if one particular feature of vim is so utterly ridiculous, I want to turn it off in the main file. Then put my customizations in the home dir vimrc. Then if I have different vimrcs can do vim -S a.a or vim -S b.b (where a.a or b.b are vimrc files), and they'll all run shortmess=I from the main file