use BufReadPost for *.esp file type, and use setlocal instead of set.