在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插件,用起來實在太爽了