1,首先下载 arduino 语法高亮 vim syntax file
http://www.vim.org/scripts/script.php?script_id=2654
2.生成ctags文件
在linux下,可使用如下命令:
ctags -f tags.cpp `find . -name "*.cpp" -o -name "*.h"`
ctags -f tags.pde --langmap=c++:.pde `find . -name "*.pde"`
cat tags.cpp tags.pde > tags
sort tags -o tags
rm -f tags.*
在windows下:
#递归找出当前文件夹内的*.h 和 *.cpp文件,结果输出到a.txt
find -name "*.h" -o -name ".cpp" > a.txt
#同上
find -name "*.ino" > c.txt
#将a.txt中的换行符替换为空格,结果输出到b.txt
cat a.txt | tr "\r\n" " " > b.txt
#同上
cat c.txt | tr "\r\n" " " > d.txt
ctags -f tags.cpp (将b.txt的内容复制过来)
ctags ctags -f tags.pde --langmap=c++:.pde (将d.txt的内容复制过来)
cat tags.cpp tags.pde > tags
sort tags -o tags