如果文件类型 == tex [英] if filetype == tex

查看:24
本文介绍了如果文件类型 == tex的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果文件是乳胶文件,我想在 .vimrc 中运行命令.我想我有一些语法问题,它不起作用.有什么线索吗?

I want to run a command in the .vimrc in case a file is a latex file. I think I have something with the syntax, it does not work. Any clue?

if &filetype=='tex'
    set spell
endif

推荐答案

您可以使用自动命令来实现您想要的:

You can use auto commands to achieve what you want:

autocmd BufNewFile,BufRead *.tex set spell

这篇关于如果文件类型 == tex的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆