문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top