It should work to put the following autocommand in an after filetype
plugin file, i.e., in ~/.vim/after/ftplugin/nroff.vim:
autocmd BufWritePre <buffer> %s/\s\+$//
Alternatively, you could put this in your vimrc:
autocmd FileType nroff autocmd BufWritePre <buffer> %s/\s\+$//
Or, if some of your files were of type groff, this:
autocmd FileType groff,nroff autocmd BufWritePre <buffer> %s/\s\+$//
See:
help 40.3
help autocmd-buflocal
help BufWritePre
help FileType
help ftplugin-overrule
Regards,
Gary