Can I get sudo privilege while using vim? [duplicate]

I would try

:w /tmp/jxhyc.json
:! sudo cp /tmp/jxhyc.json /Library/Google/Chrome/NativeMessagingHosts/org.jabref.jabref.json

You should also be able to configure Vim to warn you when opening a read-only file and to show [RO] in the Vim status line.