{"id":1688,"date":"2011-12-20T17:00:09","date_gmt":"2011-12-20T09:00:09","guid":{"rendered":"http:\/\/blog.pighead.cc\/whsyu\/?p=1688"},"modified":"2011-12-20T17:00:09","modified_gmt":"2011-12-20T09:00:09","slug":"vim-syntax-and-modeline","status":"publish","type":"post","link":"https:\/\/blog.pighead.cc\/whsyu\/2011\/12\/20\/vim-syntax-and-modeline\/","title":{"rendered":"vim syntax \u53ca modeline"},"content":{"rendered":"<p class=\"bb-post-separator\"><strong>[\u83ef\u8a9e, cmn-Hant-TW]  <\/strong><\/p><p>vim \u53ea\u8981\u8a2d\u5b9a\u597d\u7684\u8a71\uff0c\u53ea\u8981\u4ed6\u8a8d\u8b58\u7684\u6a94\u6848\u90fd\u6703\u7528\u6b63\u78ba\u7684\u8a9e\u6cd5\u4e0a\u8272\uff0c\u4e0d\u904e\u5176\u5be6\u4e5f\u4e0d\u662f\u6bcf\u6b21\u90fd\u6703\u5224\u65b7\u6b63\u78ba\uff0c\u6216\u8005\u6709\u4e9b\u6a94\u6848\u5c31\u662f\u6c92\u8fa6\u6cd5\u76f4\u63a5\u5224\u65b7\uff0c\u8981\u544a\u8a34 vim \u5167\u5bb9\u662f\u5565\u4ed6\u624d\u6703\u52d5\uff0c\u9019\u6642\u5019\u53ef\u4ee5\u7528 :set syn=syntax \u6307\u5b9a\u8a9e\u6cd5\uff0c\u4e0d\u904e\u6bcf\u6b21\u958b\u6a94\u6848\u90fd\u8981\u8a2d\u5b9a\u4e00\u6b21\u6703\u89ba\u5f97\u6709\u9ede\u7169\uff0c\u9084\u597d\u6709 modeline \u53ef\u4ee5\u5e6b\u5fd9\u89e3\u6c7a\u554f\u984c\u3002<\/p>\n<p>\u9810\u8a2d\u60c5\u6cc1\u4e0b modeline \u662f\u958b\u555f\u7684\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\uff0c\u4f7f\u7528\u65b9\u5f0f\u4e5f\u5f88\u7c21\u55ae\uff0c\u4f8b\u5982\u60f3\u7528 tcsh \u8a9e\u6cd5\u4e0a\u8272\uff0c\u5c31\u76f4\u63a5\u5728\u8981\u7de8\u8f2f\u6a94\u6848\u958b\u982d\u52a0\u4e0a\u9019\u689d\u6558\u8ff0\u5373\u53ef\u3002<\/p>\n<pre lang=\"vim\"> \/* vi:set syn=tcsh: *\/<\/pre>\n<p>\u7528 C \u7684\u8a3b\u89e3\u8a9e\u6cd5\u5305\u8d77\u4f86 (shell script \u53ef\u80fd\u8981\u5728\u524d\u9762\u52a0 #)\uff0c \u5169\u500b\u5192\u865f\u4e4b\u9593\u5c31\u662f\u8981\u4e0b\u7684\u6307\u4ee4\u3002\u9664\u4e86 syn \u5916\uff0c\u6709\u9700\u8981\u7279\u8abf ts(tabstop), sts(softtabstop), sw(shiftwidth) \u4e4b\u985e\u7684\u90fd\u53ef\u4ee5\u4e00\u8d77\u52a0\u5728\u88e1\u9762\uff0c\u4ee5\u5f8c\u6bcf\u6b21\u958b\u9019\u500b\u6a94\u6848\u5c31\u6703\u5957\u7528\u9019\u500b\u8a2d\u5b9a\uff0c\u7576\u4e0d\u540c\u8a08\u756b\u6848\u7684 coding style \u898f\u7bc4\u4e0d\u540c\u7684\u6642\u5019\u5c31\u5f88\u597d\u7528\u3002<\/p>\n<pre lang=\"vim\"> \/* vi:set syn=tcsh ts=8 sts=2 sw=2: *\/<\/pre>\n<p>\u8981\u6ce8\u610f\u5728 7.0 \u67d0\u7248\u4e4b\u5f8c\u56e0\u70ba\u5b89\u5168\u554f\u984c root \u4f7f\u7528\u8005\u6703\u7121\u8996\u9019\u884c\uff0c\u9019\u7a2e\u7528\u6cd5\u53ea\u5c0d\u4e00\u822c\u4f7f\u7528\u8005\u6709\u6548\u3002\u8a73\u7d30\u8a2d\u5b9a\u53ef\u53c3\u8003\u5b98\u65b9\u7db2\u7ad9\u7684 <a href=\"http:\/\/vimdoc.sourceforge.net\/htmldoc\/options.html#modeline\">Vim \u6587\u4ef6<\/a>\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[\u83ef\u8a9e, cmn-Hant-TW] vim \u53ea\u8981\u8a2d\u5b9a\u597d\u7684\u8a71\uff0c\u53ea\u8981\u4ed6\u8a8d\u8b58\u7684\u6a94\u6848\u90fd\u6703\u7528\u6b63\u78ba\u7684\u8a9e\u6cd5\u4e0a\u8272\uff0c\u4e0d\u904e\u5176\u5be6\u4e5f\u4e0d\u662f\u6bcf\u6b21\u90fd\u6703\u5224\u65b7\u6b63\u78ba\uff0c\u6216\u8005\u6709\u4e9b\u6a94\u6848\u5c31\u662f\u6c92\u8fa6\u6cd5\u76f4\u63a5\u5224\u65b7\uff0c\u8981\u544a\u8a34 vim \u5167\u5bb9\u662f\u5565\u4ed6\u624d\u6703\u52d5\uff0c\u9019\u6642\u5019\u53ef\u4ee5\u7528 :set syn=syntax \u6307\u5b9a\u8a9e\u6cd5\uff0c\u4e0d\u904e\u6bcf\u6b21\u958b\u6a94\u6848\u90fd\u8981\u8a2d\u5b9a\u4e00\u6b21\u6703\u89ba\u5f97\u6709\u9ede\u7169\uff0c\u9084\u597d\u6709 modeline \u53ef\u4ee5\u5e6b\u5fd9\u89e3\u6c7a\u554f\u984c\u3002 \u9810\u8a2d\u60c5\u6cc1\u4e0b modeline \u662f\u958b\u555f\u7684\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\uff0c\u4f7f\u7528\u65b9\u5f0f\u4e5f\u5f88\u7c21\u55ae\uff0c\u4f8b\u5982\u60f3\u7528 tcsh \u8a9e\u6cd5\u4e0a\u8272\uff0c\u5c31\u76f4\u63a5\u5728\u8981\u7de8\u8f2f\u6a94\u6848\u958b\u982d\u52a0\u4e0a\u9019\u689d\u6558\u8ff0\u5373\u53ef\u3002 \/* vi:set syn=tcsh: *\/ \u7528 C \u7684\u8a3b\u89e3\u8a9e\u6cd5\u5305\u8d77\u4f86 (shell script \u53ef\u80fd\u8981\u5728\u524d\u9762\u52a0 #)\uff0c \u5169\u500b\u5192\u865f\u4e4b\u9593\u5c31\u662f\u8981\u4e0b\u7684\u6307\u4ee4\u3002\u9664\u4e86 syn \u5916\uff0c\u6709\u9700\u8981\u7279\u8abf ts(tabstop), sts(softtabstop), sw(shiftwidth) \u4e4b\u985e\u7684\u90fd\u53ef\u4ee5\u4e00\u8d77\u52a0\u5728\u88e1\u9762\uff0c\u4ee5\u5f8c\u6bcf\u6b21\u958b\u9019\u500b\u6a94\u6848\u5c31\u6703\u5957\u7528\u9019\u500b\u8a2d\u5b9a\uff0c\u7576\u4e0d\u540c\u8a08\u756b\u6848\u7684 coding style \u898f\u7bc4\u4e0d\u540c\u7684\u6642\u5019\u5c31\u5f88\u597d\u7528\u3002 \/* vi:set syn=tcsh&hellip; <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[47],"tags":[4513],"class_list":["post-1688","post","type-post","status-publish","format-standard","hentry","category-applications","tag-vim"],"_links":{"self":[{"href":"https:\/\/blog.pighead.cc\/whsyu\/wp-json\/wp\/v2\/posts\/1688","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.pighead.cc\/whsyu\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.pighead.cc\/whsyu\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.pighead.cc\/whsyu\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.pighead.cc\/whsyu\/wp-json\/wp\/v2\/comments?post=1688"}],"version-history":[{"count":12,"href":"https:\/\/blog.pighead.cc\/whsyu\/wp-json\/wp\/v2\/posts\/1688\/revisions"}],"predecessor-version":[{"id":1700,"href":"https:\/\/blog.pighead.cc\/whsyu\/wp-json\/wp\/v2\/posts\/1688\/revisions\/1700"}],"wp:attachment":[{"href":"https:\/\/blog.pighead.cc\/whsyu\/wp-json\/wp\/v2\/media?parent=1688"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.pighead.cc\/whsyu\/wp-json\/wp\/v2\/categories?post=1688"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.pighead.cc\/whsyu\/wp-json\/wp\/v2\/tags?post=1688"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}