在filetype.vim里面添加一个类型
au BufNewFile,BufRead *.txt setf text
推荐用rst后缀名的,然后自己写一个sphinx-dict文件,里面写一些常用的标记比如 toctree:: literalincluded::等等,然后在_vimrc里加入
autocmd FileType text setlocal dictionary=$VIM/dict/sphinx-dict complete-=k complete+=k iskeyword+=: completeopt = "menu,menuone"
这时在配合AutoComplPop插件就可以在写sphinx的时候有提示操作了,另外选择文件时候还有文件补全提示,再去vim官网下载restructuredtext语法高亮和table插件,用起来实在太爽了