snipMate安裝後報錯

jiufreeman發表於2020-04-07

自己安裝了 snipMate,啟動vim後出現以下錯誤:

Warning in snipMate.vim: Snippet c) is already defined. See :h multi_snip for help on snippets with multiple matches.
Warning in snipMate.vim: Snippet date is already defined. See :h multi_snip for help on snippets with multiple matches.
Press ENTER or type command to continue
[root@localhost ~]# vim hello.c 
Warning in snipMate.vim: Snippet c) is already defined. See :h multi_snip for help on snippets with multiple matches.
Warning in snipMate.vim: Snippet date is already defined. See :h multi_snip for help on snippets with multiple matches.
Press ENTER or type command to continue
[root@localhost ~]# vim hello.c 
Warning in snipMate.vim: Snippet c) is already defined. See :h multi_snip for help on snippets with multiple matches.
Warning in snipMate.vim: Snippet date is already defined. See :h multi_snip for help on snippets with multiple matches.
Press ENTER or type command to continue

錯誤原因:

我在/usr/share/vim/vim72和~/.vim分別解壓了 snipMate.zip一次,造成了檔案重複。

解決辦法:

將/usr/share/vim/vim72中snipMate相關的檔案去除即可。

 

總結一下snipMate的安裝辦法:

1.到http://www.vim.org/scripts/script.php?script_id=2540下載snipMate.zip

2.將snipMate.zip複製到~/.vim,用“unzip snipMate.zip”解壓。如果沒有~/.vim目錄,自己建立。

3.修改~/.vimrc,增加這麼一行:

filetype plugin on

4.啟動Vim開啟一個C檔案,輸入"int main<tab>"看看會發生什麼。

相關文章