{"id":436,"date":"2017-12-17T22:50:13","date_gmt":"2017-12-17T13:50:13","guid":{"rendered":"https:\/\/www8281uo.sakura.ne.jp\/blog\/?p=436"},"modified":"2017-12-17T22:50:13","modified_gmt":"2017-12-17T13:50:13","slug":"windows-%e3%81%a7-vim-fugitive-%e3%82%92%e4%bd%bf%e3%81%86%e6%99%82%e3%81%ae%e6%b3%a8%e6%84%8f","status":"publish","type":"post","link":"https:\/\/www8281uo.sakura.ne.jp\/blog\/?p=436","title":{"rendered":"\u3010\u89e3\u6c7a\u6e08\u3011MSYS2 + gVim + vim-fugitive on Windows"},"content":{"rendered":"<p><a href=\"https:\/\/github.com\/tpope\/vim-fugitive\">vim-fugitive<\/a> \u3081\u3063\u3061\u3083\u4f7f\u3044\u3084\u3059\u3044\u3002Vim \u306e\u30ad\u30e9\u30fc\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\uff11\u3064\u3067\u306f\u306a\u3044\u304b\u3068\u601d\u3046\u3002Windows \u3067\u306e CUI \u74b0\u5883\u3092 MSYS2 \u306b\u79fb\u884c\u3057\u305f\u304f\u3089\u3044\u304b\u3089\u3001gVim \u3067 <code>:GStatus<\/code>\u00a0\u304c\u4f7f\u3048\u306a\u304f\u306a\u3063\u3066\u3001CUI \u7248\u306e Vim \u3092\u4f7f\u3063\u3066\u3044\u305f\u3002\u4eca\u56de\u305d\u306e\u7406\u7531\u306b\u6c17\u3065\u3044\u305f\u306e\u3067\u3001\u30e1\u30e2\u3068\u3057\u3066\u6b8b\u3057\u3066\u304a\u304f\u3002<\/p>\n<h3>\u75c7\u72b6<\/h3>\n<p>\u5143\u3005\u306e\u74b0\u5883<\/p>\n<ul>\n<li>CUI Vim: <a href=\"http:\/\/www.msys2.org\/\">MSYS2<\/a> (not <a href=\"http:\/\/gitforwindows.org\/\">Git for Windows<\/a>) \u306e Vim<\/li>\n<li>GUI Vim: <a href=\"https:\/\/www.kaoriya.net\/software\/vim\/\">Kaoriya \u7248\u306e gVim<\/a><\/li>\n<li>git \u30b3\u30de\u30f3\u30c9\u306f MSYS2 \u306e\u3082\u306e\u3092\u4f7f\u3063\u3066\u3044\u305f\u3002<\/li>\n<\/ul>\n<p>\u75c7\u72b6<\/p>\n<ul>\n<li>CUI \u304b\u3089\u306f\u3001<code>:Gstatus<\/code>\u00a0\u3082\u52d5\u304f<\/li>\n<li>GUI \u304b\u3089\u306f\u3001<code>:Gstatus<\/code>\u00a0\u3059\u308b\u3068\u3001<code>\/home<\/code> \u304b\u3089\u59cb\u307e\u3063\u3066\u3001<code>C:<\/code>\u00a0\u3067\u7d42\u308f\u308b\u5909\u306a\u30d1\u30b9\u3068\u3068\u3082\u306b\u3001<code>No such file or directory<\/code> \u306e\u30a8\u30e9\u30fc\u304c\u8868\u793a\u3055\u308c\u308b\u3002<\/li>\n<\/ul>\n<p>\u76f4\u3057\u65b9\u3060\u3051\u77e5\u308a\u305f\u3044\u4eba\u306f\u3001<a href=\"#solution\">\u89e3\u6c7a\u7b56<\/a>\u3078\u3002<!--more--><\/p>\n<h3>vim-fugitive \u304c\u30b5\u30dd\u30fc\u30c8\u3059\u308b\u8a2d\u5b9a<\/h3>\n<p>\u3061\u3087\u3063\u3068\u53e4\u3044\u306e\u3060\u3051\u3069\u3001<a href=\"https:\/\/github.com\/tpope\/vim-fugitive\/issues\/212#issuecomment-6261982\">vim-fugitive \u306e\u4f5c\u8005\u306e\u767a\u8a00<\/a>\u306f\u4ee5\u4e0b\u3002<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-483\" src=\"https:\/\/i0.wp.com\/www8281uo.sakura.ne.jp\/blog\/wp-content\/uploads\/2017\/12\/fugitiveWinSupport.png?resize=625%2C414&#038;ssl=1\" alt=\"fugitiveWinSupport.png\" width=\"625\" height=\"414\" \/><\/p>\n<ol>\n<li>Windows mode: msysgit\/<code>shell=cmd<\/code>\/<code>noshellslash<\/code><\/li>\n<li>Cygwin mode: cygwin git\/<code>shell=bash<\/code>\/<code>shellslash<\/code><\/li>\n<\/ol>\n<p>\u3053\u306e\u6642\u70b9\u3067\u306f\u3001Git for Windows \u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u308b git \u3068\u3001MSYS2 \u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u308b git \u306f\u540c\u3058\u3068\u3057\u3066\u6271\u3048\u308b\u3060\u308d\u3046\u3068\u601d\u3063\u3066\u3044\u305f\u3002\u306a\u306e\u3067\u3001\uff11\u306e\u8a2d\u5b9a\u3092\u3057\u305f\u3051\u3069\u3001\u3084\u306f\u308a\u3046\u307e\u304f\u3044\u304b\u306a\u3044\u3002<\/p>\n<p>\u30d1\u30b9\u304c\u304a\u304b\u3057\u3044\u3001\u3068\u3044\u3046\u3068\u3053\u308d\u304b\u3089\u3001<code>shellslash<\/code>\u00a0\u3068\u304b\u3001<code>shell<\/code>\u00a0\u306e\u8a2d\u5b9a\u304c\u307e\u305a\u3044\u306e\u304b\u306a\uff1f\u3068\u601d\u3063\u305f\u3051\u3069\u3001\u76f4\u3059\u3053\u3068\u304c\u3067\u304d\u305a\u3001\u3057\u3070\u3089\u304f gVim \u306e\u4f7f\u7528\u306f\u3042\u304d\u3089\u3081\u3066\u3001CUI \u3067 Vim \u3092\u4f7f\u3063\u3066\u3044\u305f\u3002<\/p>\n<h3>\u6c17\u3065\u3044\u305f\u7d4c\u7def<\/h3>\n<p><a href=\"https:\/\/github.com\/junegunn\/vim-plug\/issues\/713#issuecomment-350619213\">vim-plug \u306e issue \u3067\u306e\u3053\u306e\u66f8\u304d\u8fbc\u307f<\/a>\u3092\u898b\u305f\u306e\u304c\u3067\u304b\u3044\u3002<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-471\" src=\"https:\/\/i0.wp.com\/www8281uo.sakura.ne.jp\/blog\/wp-content\/uploads\/2017\/12\/GitOnWindows.png?resize=625%2C223&#038;ssl=1\" alt=\"GitOnWindows.png\" width=\"625\" height=\"223\" \/><\/p>\n<p>\u3093\uff1f\u3068\u601d\u3063\u3066\u3001\u81ea\u5206\u306e MSYS2 \u306e git \u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u78ba\u304b\u3081\u3066\u307f\u308b\u3068\u3001<\/p>\n<pre>$ git --version\ngit version 2.15.0<\/pre>\n<p>\u304a\u3001\u3053\u308c\u306f\u30fb\u30fb\u30fb MSYS2 \u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f git \u3082 Cygwin \u3068\u540c\u3058\u6271\u3044\u3058\u3083\u3093\u30fb\u30fb\u30fb\u3068\u3044\u3046\u3053\u3068\u306b\u6c17\u3065\u3044\u305f\u3002\u305d\u3053\u3067\u3001gVim \u3067 2 \u306e\u8a2d\u5b9a\u3082\u8a66\u3057\u3066\u307f\u305f\u3051\u3069\u3001\u3053\u308c\u3082\u3060\u3081\u3002\u305f\u3076\u3093\u3001gVim \u306f <code>win32unix<\/code>\u00a0\u3058\u3083\u306a\u3044\uff08<code>win32unix<\/code>\u00a0\u306f Cygwin \u306e Vim \u304c\u6301\u3063\u3066\u3044\u308b feature\uff09\u304b\u3089\u306a\u3093\u3060\u3068\u601d\u3046\u3002\u3068\u3044\u3046\u3053\u3068\u306f\u3001Git for Windows \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308c\u3070\u3088\u3044\u306e\u3067\u306f\uff1f\u3068\u3044\u3046\u3053\u3068\u306b\u601d\u3044\u81f3\u308b\u3002<\/p>\n<h3 id=\"solution\" style=\"margin-top: -60px; padding-top: 60px;\">\u89e3\u6c7a\u7b56<\/h3>\n<p>\u7d50\u5c40\u3069\u3046\u3059\u308c\u3070\u826f\u304b\u3063\u305f\u306e\u304b\u3068\u3044\u3046\u3068\u3001Git for Windows \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3001gVim \u304b\u3089\u306f\u305d\u306e git \u3092\u4f7f\u3048\u3070\u826f\u3044\u3002<\/p>\n<p>UNIX \u30e9\u30a4\u30af\u306a\u74b0\u5883\u3068\u3057\u3066\u306f\u3001Git for Windows \u3067\u306f\u306a\u304f\u3001pacman \u3092\u4f7f\u3048\u308b MSYS2 \u306b\u3057\u305f\u304b\u3063\u305f\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u305f\u3002<\/p>\n<ul>\n<li>CUI: MSYS2 \u306e Vim\/MSYS2 \u306e git\/<code>shell=bash<\/code>\/<code>shellslash<\/code><\/li>\n<li>GUI: gVim (Kaoriya)\/Git for Windows \u306e git\/<code>shell=cmd<\/code>\/<code>noshellslash<\/code><\/li>\n<\/ul>\n<p>CUI \u3067\u3082\u3001Git for Windows \u306e git \u3092\u4f7f\u3046\u3053\u3068\u306f\u3067\u304d\u308b\u306f\u305a\u3002<\/p>\n<p>MSYS2 \u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u308b git \u3068\u3001Git for Windows \u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u308b git \u306f\u5225\u7269\u3060\u304b\u3089\u6c17\u3092\u3064\u3051\u308d\u3002MSYS2 \u3068 Git for Windows \u3092\u4e21\u65b9\u5165\u308c\u308b\u306e\u306f\u30b9\u30c8\u30ec\u30fc\u30b8\u306e\u7121\u99c4\u306a\u6c17\u304c\u3059\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u3051\u3069\u73fe\u72b6\u3067\u306f\u4ed5\u65b9\u306e\u306a\u3044\u3053\u3068\u306a\u306e\u3060\u3068\u601d\u3046\u3002<\/p>\n<ul>\n<li>MSYS2 \u306e git\n<pre>$ \/usr\/bin\/git --version\ngit version 2.15.0<\/pre>\n<\/li>\n<li>Git for Windows \u306e git\n<pre>$ \/c\/Git\/bin\/git --version\ngit version 2.15.1.windows.2<\/pre>\n<\/li>\n<\/ul>\n<h3>\u756a\u5916\u7de8<\/h3>\n<p>\u3068\u3001\u3053\u3053\u307e\u3067\u66f8\u3044\u3066\u3001\u3042\u308b\u4e8b\u306b\u6c17\u304c\u4ed8\u3044\u305f\u3002GitHubDesktop \u306b\u3082 git \u306f\u3042\u308b\u306f\u305a\u3060\u3001\u3068\u3002GitHubDesktop \u3082\u4f7f\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u3053\u306e git \u304c\u3082\u3057\u3001Git for Windows \u7248\u3067\u3042\u308c\u3070\u3001Git for Windows \u3092\u5165\u308c\u308b\u5fc5\u8981\u306f\u306a\u3044\u3002\u3068\u3044\u3046\u3053\u3068\u3067\u63a2\u3059\u3068\u3042\u308a\u307e\u3057\u305f\u30021.0.10 \u306e\u90e8\u5206\u306f GitHubDesktop \u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u3088\u3063\u3066\u5909\u308f\u308b\u3068\u601d\u3046\u3051\u3069\u3001\u3053\u3053\u306b\u3042\u308b\u3002<\/p>\n<p><code>%USERPROFILE%\\AppData\\Local\\GitHubDesktop\\app-1.0.10\\resources\\app\\git\\cmd\\git.exe<\/code><\/p>\n<p>GitHubDesktop \u306e git<\/p>\n<pre>$ git.exe --version\ngit version 2.15.1.windows.1<\/pre>\n<p>\u8a66\u3057\u306b\u3001\u3053\u306e git.exe \u306e\u30d1\u30b9\u3092 gVim \u306e <code>$PATH<\/code> \u306b\u8ffd\u52a0\u3057\u3066 <code>:Gstatus<\/code>\u00a0\u3057\u3066\u307f\u308b\u3068\u306a\u3093\u3068\u3061\u3083\u3093\u3068\u52d5\u3044\u3066\u304f\u308c\u308b\u3002<\/p>\n<p>\u306a\u306e\u3067\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f Git for Windows \u306f\u901f\u653b\u30a2\u30f3\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u4e0a\u306e git \u306e\u30d1\u30b9\u306f\u306a\u3093\u3060\u304b\u3068\u3066\u3082\u9577\u304f\u3066\u5acc\u3060\u3063\u305f\u306e\u3067\u3001<code>%USERPROFILE\\AppData\\Local\\GitHubDesktop\\app-1.0.10\\resources\\app\\git<\/code>\u00a0\u306e\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u30ea\u30f3\u30af\u3092\u9069\u5f53\u306a\u3068\u3053\u308d\u306b\u4f5c\u3063\u3066 <code>.gvimrc<\/code>\u00a0\u3067\u30d1\u30b9\u3092\u8ffd\u52a0\u3059\u308b\u3088\u3046\u306b\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>vim-fugitive \u3081\u3063\u3061\u3083\u4f7f\u3044\u3084\u3059\u3044\u3002Vim \u306e\u30ad\u30e9\u30fc\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\uff11\u3064\u3067\u306f\u306a\u3044\u304b\u3068\u601d\u3046\u3002Windows \u3067\u306e CUI \u74b0\u5883\u3092 MSYS2 \u306b\u79fb\u884c\u3057\u305f\u304f\u3089\u3044\u304b\u3089\u3001gVim \u3067 :GStatus\u00a0\u304c\u4f7f\u3048\u306a\u304f\u306a\u3063\u3066\u3001C [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[7],"tags":[],"class_list":["post-436","post","type-post","status-publish","format-standard","hentry","category-vim"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www8281uo.sakura.ne.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/436","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www8281uo.sakura.ne.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www8281uo.sakura.ne.jp\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www8281uo.sakura.ne.jp\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www8281uo.sakura.ne.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=436"}],"version-history":[{"count":0,"href":"https:\/\/www8281uo.sakura.ne.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/436\/revisions"}],"wp:attachment":[{"href":"https:\/\/www8281uo.sakura.ne.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=436"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www8281uo.sakura.ne.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=436"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www8281uo.sakura.ne.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=436"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}