vim脚本中的回显字符串和变量

vim脚本中的回显字符串和变量,vim,Vim,在vim脚本中具有以下简单功能: function me#Tabwidth(width) let &tabstop = a:width let &shiftwidth = a:width set expandtab echom "Tab width set to " + a:width endfunction 该函数在vimrc文件中被这样调用 command -nargs=* Tabwidth :call me#Tabwidth(<f-a

在vim脚本中具有以下简单功能:

function me#Tabwidth(width)
    let &tabstop = a:width
    let &shiftwidth = a:width
    set expandtab
    echom "Tab width set to " + a:width
endfunction
该函数在vimrc文件中被这样调用

command -nargs=* Tabwidth :call me#Tabwidth(<f-args>)
command-nargs=*Tabwidth:call me#Tabwidth()

当通过键入“Tabwidth 2”调用时,只回显变量的值,而不回显字符串。我做错了什么?

在vim脚本中,字符串连接是通过
操作符完成的。试着这样做:

echom "Tab width set to " . a:width
如果
a:width
是一个数字,它将自动转换