<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>FreeBSD on LCY's Notes</title><link>https://blog.lcy.one/tags/freebsd/</link><description>Recent content in FreeBSD on LCY's Notes</description><generator>Hugo</generator><language>zh-tw</language><copyright>lcy</copyright><lastBuildDate>Fri, 13 Apr 2018 00:00:00 +0800</lastBuildDate><atom:link href="https://blog.lcy.one/tags/freebsd/feed.xml" rel="self" type="application/rss+xml"/><item><title>Vim 對於 .conf 檔案的 syntax highlighting</title><link>https://blog.lcy.one/2018/04/13/vim-syntax-highlighting-for-conf.html</link><pubDate>Fri, 13 Apr 2018 00:00:00 +0800</pubDate><guid>https://blog.lcy.one/2018/04/13/vim-syntax-highlighting-for-conf.html</guid><description>&lt;p&gt;前一陣子在使用 FreeBSD 時&lt;br&gt;
發現開啟 rc.conf 時，vim 沒有將該檔案作為 conf 檔做 syntax highlighting&lt;br&gt;
但是開啟其他 .conf 檔案時就有&lt;/p&gt;</description><content:encoded><![CDATA[<p>前一陣子在使用 FreeBSD 時<br>
發現開啟 rc.conf 時，vim 沒有將該檔案作為 conf 檔做 syntax highlighting<br>
但是開啟其他 .conf 檔案時就有</p>
<p>好奇問了一下萬能的 Google 大神<br>
才知道 vim 對於 conf 檔的認定<br>
除了附檔名要是 .conf 之外<br>
還有<strong>檔案第一行必須要是 <code>#</code> 開頭的註解</strong></p>
<p>於是我就在 rc.conf 最前面多加了</p>
<pre tabindex="0"><code class="language-conf" data-lang="conf"># rc.conf
</code></pre><p>重開 vim 之後就有正常的 syntax highlighting 了</p>
<hr>
<h2 id="參考資料">參考資料</h2>
<ul>
<li><a href="http://freebsd.1045724.x6.nabble.com/syntax-highlighting-of-rc-conf-with-vim-tp3952377.html">freebsd-stable - syntax highlighting of rc.conf with vim</a></li>
</ul>]]></content:encoded></item></channel></rss>