I am trying out <expr>, and I found out not all ex-mode command can be run in a function. :LspInfo is a command from nvim-lsp.

function! Message()

nnoremap <expr> gd Message() 

When I press gd, it returns this:

Error detected while processing function Message:
line    2:
E5108: Error executing lua .../pack/paqs/start/nvim-lspconfig/lua/lspconfig/_lspui.lua:105:
E523: Not allowed here

Why is this happening?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.