copy noedit.vim
to $VIMRUNTIME/plugin/noedit.vim
or just include in your ~/.vimrc
file
Created
May 13, 2014 18:25
-
-
Save glensc/edf3fb61109ac7383784 to your computer and use it in GitHub Desktop.
vim script to prevent edits to Chef generated files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" prevent edits of Chef generated files | |
au BufReadPost /etc/** if join(getline(1,10), "\n") =~? 'Generated by Chef' | setl nomodifiable readonly | endif | |
" vim:ft=vim |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment