0

我试图为 vim-surround 执行 cs 命令。但是,不幸的是,我得到了 E319:对不起,此版本消息中没有该命令。我使用来自http://amix.dk/vim/vimrc.html的 vimrc

这是我的 Vim 版本:

VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Nov 27 2010 19:38:25)
MacOS X (unix) version
Included patches: 1-47
Compiled by dio@Dios-MacBook.local
Normal version with MacVim GUI.  Features included (+) or not (-):
-arabic +autocmd +balloon_eval +browse +builtin_terms +byte_offset +cindent +clientserver +clipboard +cmdline_compl
+cmdline_hist +cmdline_info +comments -conceal +cryptv -cscope +cursorbind +cursorshape +dialog_con_gui +diff +digraphs
 +dnd -ebcdic -emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path +find_in_path +float +folding -footer
+fork() +fullscreen -gettext -hangul_input +iconv +insert_expand +jumplist -keymap -langmap +libcall +linebreak
+lispindent +listcmds +localmap -lua +menu +mksession +modify_fname +mouse +mouseshape -mouse_dec -mouse_gpm
-mouse_jsbterm -mouse_netterm -mouse_sysmouse +mouse_xterm +multi_byte +multi_lang -mzscheme +netbeans_intg +odbeditor
-osfiletype +path_extra -perl +persistent_undo +postscript +printer -profile -python -python3 +quickfix +reltime
-rightleft +ruby +scrollbind +signs +smartindent -sniff +startuptime +statusline -sun_workshop +syntax +tag_binary
+tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title +toolbar +transparency +user_commands
+vertsplit +virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup -X11
-xfontset +xim -xsmp -xterm_clipboard -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"

谢谢

4

1 回答 1

0

你安装了环绕.vim吗?

环绕功能不是 Vim 内置的,但需要我提到的插件。

所以即使你使用了别人的 .vimrc,你也应该安装插件。安装说明见链接。(您可能会在 github 上找到最新版本)。

您应该手动安装插件(即在 ~/.vim/ 目录中手动下载和复制文件),或者使用 .vimrc 文件开头提到的 svn,但我不确定您会得到最新的插件版本那样。

编辑:如果正确安装环绕,通过键入
:verbose map

在长长的命令列表中,您应该看到如下内容:

x s <Plug>Vsurround
Last set from ~\vimfiles\bundle\surround\plugin\surround.vim
n ySS <Plug>YSsurround
Last set from ~\vimfiles\bundle\surround\plugin\surround.vim n ySs <Plug>YSsurround
Last set from ~\vimfiles\bundle\surround\plugin\surround.vim
n yss <Plug>Yssurround
Last set from ~\vimfiles\bundle\surround\plugin\surround.vim
n yS <Plug>YSurround
Last set from ~\vimfiles\bundle\surround\plugin\surround.vim
n ys <Plug>Ysurround
Last set from ~\vimfiles\bundle\surround\plugin\surround.vim

环绕.vim 文件的路径可能因您的安装而异,但您应该看到已定义的命令。

于 2010-11-29T08:14:31.570 回答