{"id":93,"date":"2014-03-09T15:43:06","date_gmt":"2014-03-09T06:43:06","guid":{"rendered":"http:\/\/www.turtlewalk.org\/blog\/?p=93"},"modified":"2014-03-09T15:43:06","modified_gmt":"2014-03-09T06:43:06","slug":"global-pygments-plugin","status":"publish","type":"post","link":"https:\/\/www.turtlewalk.org\/blog\/2014\/03\/09\/global-pygments-plugin\/","title":{"rendered":"Pygments \u3092\u5229\u7528\u3057\u3066 GNU GLOBAL \u306e\u5bfe\u5fdc\u8a00\u8a9e\u3092\u5927\u5e45\u306b\u5897\u3084\u3059"},"content":{"rendered":"<p>\u666e\u6bb5 GNU GLOBAL (gtags) \u306b\u306f\u5927\u5909\u304a\u4e16\u8a71\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n<a title=\"http:\/\/www.gnu.org\/software\/global\/global.html\" href=\"http:\/\/www.gnu.org\/software\/global\/global.html\">http:\/\/www.gnu.org\/software\/global\/global.html<\/a><br \/>\n\u3053\u308c\u304c\u306a\u3051\u308c\u3070\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306e\u8aad\u89e3\u3084\u4e0d\u5177\u5408\u8abf\u67fb\u306a\u3069\u3001\u3042\u3089\u3086\u308b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u6d3b\u52d5\u306b\u652f\u969c\u304c\u51fa\u308b\u307b\u3069\u3002<br \/>\n\u305d\u3093\u306a GNU GLOBAL \u3067\u3059\u304c\u3001\u5bfe\u5fdc\u8a00\u8a9e\u304c\u5c11\u306a\u3044\u3053\u3068\u304c\u60a9\u307f\u306e\u7a2e\u3067\u3057\u305f\u3002<\/p>\n<p><!--more--><\/p>\n<p>\u30d7\u30e9\u30b0\u30a4\u30f3\u30d1\u30fc\u30b6\u30fc\u3092\u4f7f\u3063\u3066 Exuberant Ctags (<a title=\"http:\/\/ctags.sourceforge.net\/\" href=\"http:\/\/ctags.sourceforge.net\/\">http:\/\/ctags.sourceforge.net\/<\/a>) \u3068\u9023\u643a\u3055\u305b\u308c\u3070\u5bfe\u5fdc\u8a00\u8a9e\u306f\u5897\u3048\u307e\u3059\u304c\u3001ctags \u306f\u5b9a\u7fa9\u5143\u306e\u60c5\u5831\u3057\u304b\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u5316\u3057\u306a\u3044\u305f\u3081\u3001GLOBAL \u306e\u7279\u5fb4\u3067\u3042\u308b\u53c2\u7167\u5143\u3078\u306e\u30b8\u30e3\u30f3\u30d7\u304c\u3067\u304d\u306a\u304f\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<br \/>\n\u500b\u4eba\u7684\u306b\u306f\u53c2\u7167\u5143\u3084\u30b7\u30f3\u30dc\u30eb\u3078\u306e\u30b8\u30e3\u30f3\u30d7\u3082\u3088\u304f\u4f7f\u3046\u306e\u3067\u3001ctags \u30d7\u30e9\u30b0\u30a4\u30f3\u30d1\u30fc\u30b6\u30fc\u3067\u306f\u7269\u8db3\u308a\u306a\u3044\u3068\u611f\u3058\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>GLOBAL \u306b\u65b0\u898f\u306b\u5bfe\u5fdc\u8a00\u8a9e\u3092\u8ffd\u52a0\u3059\u308b\u306b\u306f(\u4f55\u3089\u304b\u306e\u8a00\u8a9e\u3067)\u30d1\u30fc\u30b6\u30fc\u3092\u66f8\u304b\u306a\u3051\u308c\u3070\u306a\u3089\u305a\u3001\u304b\u306a\u308a\u9aa8\u304c\u6298\u308c\u308b\u4f5c\u696d\u3067\u3059\u3002<br \/>\n\u3061\u3083\u3093\u3068\u3057\u305f\u30d1\u30fc\u30b6\u30fc\u3092\u66f8\u304f\u306e\u306f\u9762\u5012\u3067\u3059\u304c\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304b\u3089\u8b58\u5225\u5b50\u3092\u629c\u304d\u51fa\u3059\u304f\u3089\u3044\u306a\u3089\u6b63\u898f\u8868\u73fe\u30d9\u30fc\u30b9\u306e\u5b9f\u88c5\u3067\u3082\u5b9f\u73fe\u3067\u304d\u3001(\u30b7\u30f3\u30dc\u30eb\u30bf\u30b0\u306e\u307f\u306e\u5bfe\u5fdc\u306b\u306f\u306a\u308a\u307e\u3059\u304c)\u6bd4\u8f03\u7684\u5bb9\u6613\u306b\u5bfe\u5fdc\u8a00\u8a9e\u3092\u5897\u3084\u305b\u308b\u306e\u3067\u306f\u306a\u3044\u304b\u3068\u8003\u3048\u307e\u3057\u305f\u3002<\/p>\n<p>\u6b63\u898f\u8868\u73fe\u3067\u3046\u307e\u304f\u8b58\u5225\u5b50\u3092\u629c\u304d\u51fa\u3059\u306b\u306f\u3069\u3046\u3059\u308c\u3070\u3044\u3044\u306e\u304b\u3068\u601d\u3044\u3001Pygments (<a title=\"http:\/\/pygments.org\/\" href=\"http:\/\/pygments.org\/\">http:\/\/pygments.org\/<\/a>) \u306e\u30bd\u30fc\u30b9\u3092\u773a\u3081\u3066\u3044\u307e\u3057\u305f\u3002<br \/>\n\u773a\u3081\u3066\u3044\u308b\u3046\u3061\u306b\u3001\u3042\u308c\u3001\u3053\u308c\u305d\u306e\u307e\u307e\u4f7f\u3048\u3070\u3044\u3044\u3093\u3058\u3083\u306d\uff1f \u3068\u601d\u3044\u81f3\u308a\u307e\u3057\u305f\u3002<br \/>\nPygments \u306f\u30e9\u30a4\u30d6\u30e9\u30ea\u3068\u3057\u3066\u547c\u3079\u3066\u3001\u30c8\u30fc\u30af\u30f3\u3092\u53d6\u308a\u51fa\u3059\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u3042\u308a\u307e\u3059\u3002\u307e\u305f\u3001\u5e83\u7bc4\u306a\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u3002GitHub \u306e\u30b7\u30f3\u30bf\u30c3\u30af\u30b9\u30cf\u30a4\u30e9\u30a4\u30c6\u30a3\u30f3\u30b0\u306b\u3082\u4f7f\u308f\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3093\u306a\u308f\u3051\u3067\u3001Pygments \u3092\u5229\u7528\u3057\u3066 GLOBAL \u306e\u305f\u3081\u306e\u30bf\u30b0\u60c5\u5831\u3092\u629c\u304d\u51fa\u3059\u30d7\u30e9\u30b0\u30a4\u30f3\u30d1\u30fc\u30b6\u30fc\u3092\u4f5c\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>Pygments Plug-in Parser for GNU GLOBAL<br \/>\n<a title=\"https:\/\/github.com\/yoshizow\/global-pygments-plugin\n\" href=\"https:\/\/github.com\/yoshizow\/global-pygments-plugin\">https:\/\/github.com\/yoshizow\/global-pygments-plugin<br \/>\n<\/a><\/p>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5\u306f README.md \u3092\u898b\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u5b9f\u884c\u306b\u306f python 2.6 \u4ee5\u964d\u3068 Pygments \u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p>global-pygments-plugin \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f\u3067\u3001~\/.globalrc \u306b global-pygments-plugin \u3092\u4f7f\u3046\u3088\u3046\u306b\u8a2d\u5b9a\u3092\u66f8\u3044\u305f\u3089\u3001\u3042\u3068\u306f\u3044\u3064\u3082\u3069\u304a\u308a gtags \u3092\u5b9f\u884c\u3059\u308b\u306e\u307f\u3067\u3059\u3002<\/p>\n<pre class=\"nums:false lang:sh highlight:0 decode:true\">$ cat hello.rb\r\nclass Hello\r\n  def hello\r\n    puts message\r\n  end\r\n\r\n  def message; 'hello, world'; end\r\nend\r\n$ gtags\r\n$ global -sx message hello.rb \r\nmessage             3 hello.rb             puts message\r\nmessage             6 hello.rb           def message; 'hello, world'; end<\/pre>\n<p>\u53c2\u7167\u5143\u3067\u3042\u308b 3 \u884c\u76ee\u306e message \u304c\u51fa\u529b\u3055\u308c\u3066\u3044\u308b\u306e\u304c\u308f\u304b\u308a\u307e\u3059\u3002\u307e\u305f\u30016 \u884c\u76ee\u306e message \u306f\u672c\u6765\u306f\u5b9a\u7fa9\u5143\u30bf\u30b0\u3067\u3059\u304c\u3001Pygments \u306e\u51fa\u529b\u304b\u3089\u306f\u533a\u5225\u304c\u4ed8\u304b\u306a\u3044\u306e\u3067\u30b7\u30f3\u30dc\u30eb\u30bf\u30b0\u3068\u3057\u3066\u51fa\u529b\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3055\u3089\u306b\u3001ctags \u304c\u5b58\u5728\u3059\u308b\u5834\u5408\u306f ctags \u3082\u547c\u3093\u3067\u3001\u5b9a\u7fa9\u5143\u306e\u30bf\u30b0\u3092\u53ce\u96c6\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u5b9a\u7fa9\u5143\u3068\u53c2\u7167\u5143\u306e\u533a\u5225\u304c\u3064\u304f\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u3082\u3061\u308d\u3093\u3001ctags \u304c\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u8a00\u8a9e\u306b\u5bfe\u3057\u3066\u306e\u307f\u6709\u52b9\u3067\u3059\u3002<\/p>\n<pre class=\"nums:false lang:sh highlight:0 decode:true\">$ gtags\r\n$ global -x message hello.rb \r\nmessage             6 hello.rb         def message; 'hello, world'; end\r\n$ global -rx message hello.rb \r\nmessage             3 hello.rb             puts message<\/pre>\n<p>message \u304c\u5b9a\u7fa9\u5143\u3068\u53c2\u7167\u5143\u306b\u5206\u3051\u3089\u308c\u3066\u3044\u308b\u306e\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n<p>\u3055\u3066\u3001\u3053\u306e\u30c4\u30fc\u30eb\u3067\u3069\u308c\u304f\u3089\u3044\u306e\u8a00\u8a9e\u306b\u5bfe\u5fdc\u3067\u304d\u305f\u3053\u3068\u306b\u306a\u308b\u3067\u3057\u3087\u3046\u304b\u3002<br \/>\nPygments \u306e\u5bfe\u5fdc\u8a00\u8a9e\u306f <a title=\"http:\/\/pygments.org\/languages\/\" href=\"http:\/\/pygments.org\/languages\/\">http:\/\/pygments.org\/languages\/<\/a> \u306b\u4e00\u89a7\u304c\u3042\u308a\u307e\u3059(Pygments \u958b\u767a\u7248\u3082\u542b\u307e\u308c\u308b)\u3002\u307e\u305f\u3001\u624b\u5143\u3067 <code>pygmentize -L lexers<\/code> \u3092\u5b9f\u884c\u3059\u308c\u3070\u624b\u5143\u306e Pygments \u306e\u5bfe\u5fdc\u5ea6\u5408\u3044\u304c\u308f\u304b\u308a\u307e\u3059\u3002<br \/>\n\u4e2d\u306b\u306f\u3046\u307e\u304f\u52d5\u4f5c\u3057\u306a\u3044\u3082\u306e\u3082\u3042\u308a\u307e\u3059\u3002\u4f8b\u3048\u3070 Pygments 1.6 \u306e CoffeeScript lexer \u306f\u30c8\u30fc\u30af\u30f3\u306e\u533a\u5207\u308a\u65b9\u304c\u304a\u304b\u3057\u304f\u3001\u30b7\u30f3\u30bf\u30c3\u30af\u30b9\u30cf\u30a4\u30e9\u30a4\u30c8\u3068\u3057\u3066\u306f\u8aad\u307f\u3084\u3059\u3044\u306e\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u30bf\u30b0\u30b8\u30e3\u30f3\u30d7\u306b\u306f\u4f7f\u3048\u306a\u3044\u30c7\u30fc\u30bf\u3092\u8fd4\u3057\u3066\u304d\u307e\u3059\u3002<br \/>\n\u3067\u3059\u304c CoffeeScript \u306e\u4f8b\u306f\u30ec\u30a2\u30b1\u30fc\u30b9\u3067\u3001\u3060\u3044\u305f\u3044\u306e\u8a00\u8a9e\u3067\u306f\u3060\u3044\u305f\u3044\u3046\u307e\u304f\u8b58\u5225\u5b50\u3092\u629c\u304d\u51fa\u305b\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u30c4\u30fc\u30eb\u306e\u6b20\u70b9\u306f\u9045\u3044\u3053\u3068\u3067\u3059\u3002gtags \u306e\u30d3\u30eb\u30c8\u30a4\u30f3\u30d1\u30fc\u30b6\u30fc\u3084 ctags \u306b\u6bd4\u3079\u308b\u3068\u3060\u3044\u3076\u9045\u3044\u3067\u3059\u3002\u539f\u56e0\u3068\u3057\u3066\u306f<\/p>\n<ul>\n<li>\u30b7\u30f3\u30dc\u30eb\u30bf\u30b0\u306e\u6570\u306f\u901a\u5e38 \u5b9a\u7fa9\u5143\u30bf\u30b0\u306e\u6570\u3088\u308a\u304b\u306a\u308a\u591a\u3044\n<li>Pygments \u306f\u8b58\u5225\u5b50\u3068\u95a2\u4fc2\u306a\u3044\u30c8\u30fc\u30af\u30f3\u307e\u3067\u8a73\u7d30\u306b\u89e3\u6790\u3059\u308b (\u30b7\u30f3\u30bf\u30c3\u30af\u30b9\u30cf\u30a4\u30e9\u30a4\u30bf\u30fc\u3060\u304b\u3089&#8230;)\n<li>\u540c\u3058\u51e6\u7406\u3092\u66f8\u3044\u3066\u3082 C \u3088\u308a Python \u306e\u307b\u3046\u304c\u591a\u304f\u306e\u5834\u5408\u9045\u3044\n<\/ul>\n<p>\u3068\u3044\u3063\u305f\u3068\u3053\u308d\u304b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u3053\u308c\u306f Pygments \u3092\u7121\u7406\u3084\u308a\u4f7f\u3063\u3066\u3044\u308b\u4ee5\u4e0a\u3001\u4ed5\u65b9\u306e\u306a\u3044\u90e8\u5206\u304b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n<code>gtags -i<\/code> (incremental) \u306a\u3069\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6d3b\u7528\u3057\u305f\u308a\u3001\u591c\u9593\u306b\u5b9f\u884c\u3059\u308b\u306a\u3069\u5de5\u592b\u304c\u5fc5\u8981\u3067\u3057\u3087\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u666e\u6bb5 GNU GLOBAL (gtags) \u306b\u306f\u5927\u5909\u304a\u4e16\u8a71\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002 http:\/\/www.gnu.org\/software\/global\/global.html \u3053\u308c\u304c\u306a\u3051\u308c\u3070\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306e\u8aad\u89e3\u3084\u4e0d\u5177\u5408\u8abf\u67fb\u306a\u3069 &#8230;<\/p>\n<p><a href=\"https:\/\/www.turtlewalk.org\/blog\/2014\/03\/09\/global-pygments-plugin\/\" class=\"more-link\">Continue reading &lsquo;Pygments \u3092\u5229\u7528\u3057\u3066 GNU GLOBAL \u306e\u5bfe\u5fdc\u8a00\u8a9e\u3092\u5927\u5e45\u306b\u5897\u3084\u3059&rsquo; &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/www.turtlewalk.org\/blog\/wp-json\/wp\/v2\/posts\/93"}],"collection":[{"href":"https:\/\/www.turtlewalk.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.turtlewalk.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.turtlewalk.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.turtlewalk.org\/blog\/wp-json\/wp\/v2\/comments?post=93"}],"version-history":[{"count":25,"href":"https:\/\/www.turtlewalk.org\/blog\/wp-json\/wp\/v2\/posts\/93\/revisions"}],"predecessor-version":[{"id":157,"href":"https:\/\/www.turtlewalk.org\/blog\/wp-json\/wp\/v2\/posts\/93\/revisions\/157"}],"wp:attachment":[{"href":"https:\/\/www.turtlewalk.org\/blog\/wp-json\/wp\/v2\/media?parent=93"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.turtlewalk.org\/blog\/wp-json\/wp\/v2\/categories?post=93"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.turtlewalk.org\/blog\/wp-json\/wp\/v2\/tags?post=93"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}