I am not exactly sure, I completely understand what you want. The NrrwRgn plugin should automatically set the filetype of the narrowed window to that of the original buffer. If this is not what you want, you can however hook into NrrwRgn command on creation and closing of the windows. So here is what you could do:
Create a file
~/.vim/after/ftplugin/php.vim (create non-existing directories, on Windows, this would be
$VIM/vimfiles/after/ftplugin/php.vim, where $VIM is whatever directory vim tells you, when issuing
:echo $VIM) and put into it:
And in your
.vimrc you put this:
let b:nrrw_aucmd_close= "unlet! g:nrrw_custom_options"
That should be all that needs to be setup and then whenever you narrow something from a php file, it will be automatically be set to filetype php.
Make sure filetype plugins are enabled so (you do this, by putting something like
filetype plugin on into your