1

I have this custom command inside my .vimrc:

command! Minfo -nargs=1 call s:MappingInfo(<f-args>)

The argument of the command is then passed to the MappingInfo function which "pastes" it to bash command using Vim's execute concatenation.

The function works fine when I execute it using :call MappingInfo("something") but when I try the command: :Minfo something, I get the error: E488: Trailing characters.

How do I fix error?

1 Answer 1

3

Switch the name and the arguments number:

command! -nargs=1 Minfo call s:MappingInfo(<f-args>)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.