duanchi19820419 2012-08-23 02:31
浏览 49
已采纳

snipMate文件类型设置不正确

I downloaded vim and used it in a python file and the snippets worked perfectly. But when I tried to use snipMate in a .go file (golang) it didn't work. I read the documentation and couldn't find an answer but when I manually used the command ":set ft=go" the snippets worked. Why does snipMate automatically work for python and not go. Snippet files for both languages are supplied. How do I get snippets for go to automatically work?

  • 写回答

1条回答 默认 最新

  • doupo6967 2012-08-23 02:33
    关注

    It sounds like your .go files aren't getting set to the appropriate filetype. You can use

    au BufRead,BufNewFile *.go setl ft=go
    

    in your ~/.vimrc to remedy this.

    The appropriate place for files like this is in your ~/.vim/ftdetect directory. For instance, you could create a file called ~/.vim/ftdetect/go.vim and put the command in there.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题