Vim E488:函数中的尾随字符

Vim E488:函数中的尾随字符,vim,Vim,在下面的代码行中,我得到了一个“for循环”的尾随字符错误,我不知道为什么 function! s:HashID(str) "{{{ let l:hash_id = 0 for i in split(a:str, '\zs') l:hash_id += float2nr(pow(2, stridx('abcdefg', i))) endfor return l:hash_id endfunction 我搞砸了什么?您需要让命令为变量赋值。启动时

在下面的代码行中,我得到了一个“for循环”的尾随字符错误,我不知道为什么

function! s:HashID(str)  "{{{
    let l:hash_id = 0
    for i in split(a:str, '\zs')
        l:hash_id += float2nr(pow(2, stridx('abcdefg', i)))
    endfor
    return l:hash_id
endfunction

我搞砸了什么?

您需要
命令为变量赋值。

启动时。输入缓冲区时,通过autocmd调用该函数。如果我注释掉for循环,错误就消失了。我想该结束了