我用vimrc.vim写了以下文章
:filetype plugin on
:let s:save_cpo = &cpo
:set cpo&vim
:let &cpo = s:save_cpo
:set runtimepath = ~/home/nikcha/.vim/plugin
:set fileformat = unix
:function! print_hi()
:echo "Hi..its done"
:endfunction
:map <F7> : call print_hi()<CR>在打开一个文件并输入:F7时,它会给出错误E488:Trailing Characters,什么地方会出错呢?
发布于 2015-01-23 10:56:29
您不应该键入:<F7>,而是按F7键。这就是:map <F7> : call print_hi()<CR>的意思:
:map # Map the following printable characters:
<F7> # # How F7 is seen by vim
: # to
call # call a function:
print_hi() # # previously defined function print_hi
<CR> # and print a new line.如果要以可视模式(键入:bla)调用函数,则不应使用键,而应键入:call print_hi()。
https://unix.stackexchange.com/questions/180614
复制相似问题