Quantcast
Channel: Active questions tagged user-commands - Vi and Vim Stack Exchange
Viewing all articles
Browse latest Browse all 60

How do I call a function from a user command? (Getting a "trailing character" error, E488)

$
0
0

So I was trying to setup a custom command to change tab width on the fly.

function! SetTab(width)    set tabstop=a:widthendfunction:command Tab -nargs=1 call SetTab(<args>)

The idea is to when I type :Tab 2, the current tab width will be changed to 2.

But it doesn't work and gives E488 Trailing characters when I issue the command, not sure where it's coming from, I couldn't find any trailing char.


Viewing all articles
Browse latest Browse all 60

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>