Search code examples
vimpermissionsadminsudocolor-scheme

Adding custom vim colorscheme in MacOS Sierra


I know this seems simple, but I've never experienced this before and am not sure what to do. I made a custom colorscheme for vim: "mycustom.vim" The colorschemes are located at /usr/share/vim/vim74/colors

When I do sudo cp from the location of mycustom.vim to the /colors folder it returns the error: cp: /usr/share/vim/vim74/colors/mycustom.vim: Operation not permitted Even with sudo I'm not allowed to add my colorscheme to the folder! Any ideas on how to add my colorscheme or set it as the default in vim?


Solution

  • On Unix there is ~/.vim directory where you should keep user specific settings. You may place your colorscheme to ~/.vim/colors or create ~/.vim/plugins/mycustom/colors directory and add it to your runtimepath doing this set runtimepath+=~/.vim/plugins/mycustom. In order to make your theme as the default one you must add colorscheme mycustom to your ~/.vimrc file.