Remap `:wq` to <nop>

Hello, how can I remap :wq to not quit nvim? This answer suggests you use cnoabbrev, which would look something like this, in .vim

:cnoreabbrev wq <nop>

But I haven’t been able to do the “noabbrev” part in lua, i.e. these all fail and browsing for a solution in the :h pages has failed me.

vim.keymap.set('cnoreabbrev', 'wq', '<nop>') -- Shortname is too long: cnoreabbrev
vim.keymap.set('c', 'wq', '<nop>', { abbrev = false } ) -- invalid key: abbrev

thanks!

Use this: vim.cmd.cnoreabbrev'wq <nop>'

If you’re using the latest dev build (v0.10.0-dev) then you can do vim.keymap.set('ca','wq','')

this worked. Thank you very much!

vim.cmd.cnoreabbrev('wq <nop>')