{"id":4964,"date":"2024-10-24T09:46:54","date_gmt":"2024-10-24T09:46:54","guid":{"rendered":"https:\/\/howtogeek.blog\/ja\/?p=4964"},"modified":"2024-10-24T09:46:54","modified_gmt":"2024-10-24T09:46:54","slug":"stepbystep-guide-how-to-exit-vi-editor-in-linux","status":"publish","type":"post","link":"https:\/\/howtogeek.blog\/ja\/stepbystep-guide-how-to-exit-vi-editor-in-linux\/","title":{"rendered":"\u30b9\u30c6\u30c3\u30d7\u30d0\u30a4\u30b9\u30c6\u30c3\u30d7\u30ac\u30a4\u30c9: Linux \u3067 vi \u30a8\u30c7\u30a3\u30bf\u3092\u7d42\u4e86\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>Linux \u3092\u521d\u3081\u3066\u4f7f\u7528\u3059\u308b\u4eba\u306b\u3068\u3063\u3066\u3001<code>vi<\/code>\u30a8\u30c7\u30a3\u30bf\u30fc\u306e\u30e2\u30fc\u30c9\u3068\u30b3\u30de\u30f3\u30c9\u69cb\u9020\u304c\u72ec\u7279\u3067\u3042\u308b\u305f\u3081\u3001\u30a8\u30c7\u30a3\u30bf\u30fc\u3092\u7d42\u4e86\u3059\u308b\u306e\u304c\u3057\u3070\u3057\u3070\u6238\u60d1\u3046\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u4f5c\u696d\u306e\u9032\u884c\u72b6\u6cc1\u3092\u4fdd\u5b58\u3059\u308b\u5834\u5408\u3067\u3082\u3001\u5909\u66f4\u3092\u5b8c\u5168\u306b\u7834\u68c4\u3059\u308b\u5834\u5408\u3067\u3082\u3001\u6b63\u3057\u304f\u7d42\u4e86\u3059\u308b\u65b9\u6cd5\u3092\u77e5\u3063\u3066\u304a\u304f\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002<\/p>\n<h2 id=\"vi-modes\">\u3055\u307e\u3056\u307e\u306a\u30e2\u30fc\u30c9<code>vi<\/code><\/h2>\n<p>\u30a8\u30c7\u30a3\u30bf\u30fc<code>vi<\/code>\u306f\u4e3b\u306b 2 \u3064\u306e\u30e2\u30fc\u30c9\u3067\u6a5f\u80fd\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li><strong>\u30b3\u30de\u30f3\u30c9 \u30e2\u30fc\u30c9:<\/strong>\u3053\u306e\u30e2\u30fc\u30c9\u306f\u3001\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u3068\u3055\u307e\u3056\u307e\u306a\u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002<\/li>\n<li><strong>\u633f\u5165\u30e2\u30fc\u30c9:<\/strong>\u3053\u306e\u30e2\u30fc\u30c9\u3067\u306f\u3001\u30c6\u30ad\u30b9\u30c8\u3092\u8ffd\u52a0\u304a\u3088\u3073\u5909\u66f4\u3067\u304d\u307e\u3059\u3002<\/li>\n<\/ul>\n<p>\u3092\u958b\u304f\u3068<code>vi<\/code>\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u30b3\u30de\u30f3\u30c9 \u30e2\u30fc\u30c9\u306b\u306a\u308a\u307e\u3059\u3002\u633f\u5165\u30e2\u30fc\u30c9\u306b\u5207\u308a\u66ff\u3048\u308b\u306b\u306f\u3001 \u3092\u62bc\u3057\u307e\u3059<code>i<\/code>\u3002\u633f\u5165\u30e2\u30fc\u30c9\u304b\u3089\u30b3\u30de\u30f3\u30c9 \u30e2\u30fc\u30c9\u306b\u623b\u308b\u306b\u306f\u3001 \u3092\u62bc\u3059\u3060\u3051\u3067\u3059<code>Esc<\/code>\u3002<\/p>\n<h2 id=\"saving-changes-and-exiting-vi\">\u5909\u66f4\u3092\u4fdd\u5b58\u3057\u3066\u7d42\u4e86\u3059\u308b\u65b9\u6cd5<code>vi<\/code><\/h2>\n<ul>\n<li>\u307e\u305a\u3001 \u3092\u62bc\u3057\u3066<code>Esc<\/code>\u30b3\u30de\u30f3\u30c9\u30e2\u30fc\u30c9\u306b\u5165\u308a\u307e\u3059\u3002<\/li>\n<li>\u6b21\u306b\u3001<code>:wq<\/code>\u3068\u5165\u529b\u3057\u3066\u62bc\u3057\u307e\u3059<code>Enter<\/code>\u3002<\/li>\n<\/ul>\n<p>\u3053\u306e\u30b7\u30fc\u30b1\u30f3\u30b9\u306b\u3088\u308a\u3001\u5909\u66f4\u5185\u5bb9\u304c\u4fdd\u5b58\u3055\u308c\u3001\u30a8\u30c7\u30a3\u30bf\u30fc\u304c\u9589\u3058\u3089\u308c\u307e\u3059\u3002<\/p>\n<h2 id=\"exiting-vi-without-saving-changes\"><code>vi<\/code>\u5909\u66f4\u3092\u4fdd\u5b58\u305b\u305a\u306b\u9589\u3058\u308b<\/h2>\n<ul>\n<li>\u62bc\u3059<code>Esc<\/code>\u3068\u30b3\u30de\u30f3\u30c9\u30e2\u30fc\u30c9\u306b\u5207\u308a\u66ff\u308f\u308a\u307e\u3059\u3002<\/li>\n<li>\u5165\u529b\u3057<code>:q!<\/code>\u3066 \u3092\u62bc\u3057\u307e\u3059<code>Enter<\/code>\u3002<\/li>\n<\/ul>\n<p><code>vi<\/code>\u3053\u306e\u65b9\u6cd5\u3067\u306f\u3001\u30bb\u30c3\u30b7\u30e7\u30f3\u4e2d\u306b\u52a0\u3048\u3089\u308c\u305f\u5909\u66f4\u3092\u4fdd\u6301\u305b\u305a\u306b\u7d42\u4e86\u3057\u307e\u3059\u3002<\/p>\n<h2 id=\"alternative-command-for-saving-and-exiting\">\u4fdd\u5b58\u3057\u3066\u7d42\u4e86\u3059\u308b\u5225\u306e\u65b9\u6cd5<\/h2>\n<ul>\n<li>\u3092\u62bc\u3057\u3066\u30b3\u30de\u30f3\u30c9 \u30e2\u30fc\u30c9\u306b\u306a\u3063\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059<code>Esc<\/code>\u3002<\/li>\n<li>\u6b21\u306b\u3001<code>:x<\/code>\u3068\u5165\u529b\u3057\u3066\u62bc\u3057\u307e\u3059<code>Enter<\/code>\u3002<\/li>\n<\/ul>\n<p>\u30b3\u30de\u30f3\u30c9<code>:x<\/code>\u306f\u3001\u5909\u66f4\u304c\u5b58\u5728\u3059\u308b\u5834\u5408\u306b\u306e\u307f\u5909\u66f4\u3092\u4fdd\u5b58\u3057\u3001\u7d42\u4e86\u3057\u307e\u3059<code>vi<\/code>\u3002<\/p>\n<h2 id=\"quitting-vi-using-shortcut-keys\"><code>vi<\/code>\u30b7\u30e7\u30fc\u30c8\u30ab\u30c3\u30c8\u30ad\u30fc\u3067\u7d42\u4e86\u3059\u308b<\/h2>\n<ul>\n<li>\u62bc\u3059<code>Esc<\/code>\u3068\u30b3\u30de\u30f3\u30c9\u30e2\u30fc\u30c9\u306b\u306a\u308a\u307e\u3059\u3002<\/li>\n<li><code>Shift<\/code>+ \u3092<code>Z<\/code>2 \u56de ( )\u62bc\u3057\u3066<code>ZZ<\/code>\u4fdd\u5b58\u3057\u7d42\u4e86\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n<p>\u3092\u4f7f\u7528\u3059\u308b\u3068<code>ZZ<\/code>\u3001\u5909\u66f4\u304c\u5373\u5ea7\u306b\u4fdd\u5b58\u3055\u308c\u3001\u30a8\u30c7\u30a3\u30bf\u30fc\u304c\u9589\u3058\u3089\u308c\u307e\u3059\u3002<\/p>\n<h2 id=\"exiting-when-esc-key-does-not-work\"><code>Esc<\/code>\u30ad\u30fc\u304c\u6545\u969c\u3057\u305f\u5834\u5408\u306e\u5bfe\u51e6\u65b9\u6cd5<\/h2>\n<p><code>Esc<\/code>\u30ad\u30fc\u304c\u6a5f\u80fd\u3057\u306a\u3044\u5834\u5408\u306f\u3001\u30b3\u30de\u30f3\u30c9 \u30e2\u30fc\u30c9\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u305f\u3081\u306b\u6b21\u306e\u4ee3\u66ff\u65b9\u6cd5\u3092\u8a66\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<ul>\n<li><code>Ctrl<\/code>+ \u3092\u62bc\u3057\u307e\u3059<code>[<\/code>\u3002<\/li>\n<li><code>Ctrl<\/code>+ \u3092\u62bc\u3057\u307e\u3059<code>C<\/code>\u3002<\/li>\n<\/ul>\n<p>\u30b3\u30de\u30f3\u30c9 \u30e2\u30fc\u30c9\u306b\u6b63\u5e38\u306b\u5207\u308a\u66ff\u3048\u305f\u3089\u3001\u9069\u5207\u306a\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u7d42\u4e86\u3067\u304d\u307e\u3059<code>vi<\/code>\u3002<\/p>\n<h2 id=\"troubleshooting-common-issues\">\u3088\u304f\u3042\u308b\u554f\u984c\u306e\u89e3\u6c7a<\/h2>\n<p>\u7d42\u4e86\u3057\u3088\u3046\u3068\u3057\u305f\u3068\u304d\u306b\u6b21\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc \u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u305f\u5834\u5408:<\/p>\n<p> <code>E37: No write since last change (add!  to override)<\/code><\/p>\n<p>\u3053\u308c\u306f\u3001\u4fdd\u5b58\u3055\u308c\u3066\u3044\u306a\u3044\u5909\u66f4\u304c\u3042\u308b\u3053\u3068\u3092\u793a\u3057\u307e\u3059\u3002\u4fdd\u5b58\u305b\u305a\u306b\u7d42\u4e86\u3059\u308b\u306b\u306f\u3001 \u3092\u4f7f\u7528\u3057\u307e\u3059<code>:q!<\/code>\u3002\u4f5c\u696d\u5185\u5bb9\u3092\u4fdd\u5b58\u3057\u3066\u7d42\u4e86\u3059\u308b\u306b\u306f\u3001<code>:wq<\/code>\u307e\u305f\u306f \u3092\u9078\u629e\u3057\u307e\u3059<code>ZZ<\/code>\u3002<\/p>\n<p>\u6b63\u3057\u3044\u7d42\u4e86\u624b\u9806\u3092\u7406\u89e3\u3057\u3066\u304a\u304f\u3053\u3068\u3067\u3001<code>vi<\/code>\u5168\u4f53\u7684\u306a\u4f53\u9a13\u304c\u5411\u4e0a\u3057\u3001\u4f5c\u696d\u304c\u4fdd\u8b77\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><a class=\"xiaomi\" href=\"https:\/\/allthings.how\/how-to-exit-vi-in-linux\/\" rel=\"noopener noreferrer nofollow\" target=\"_blank\">\u30bd\u30fc\u30b9<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux \u3092\u521d\u3081\u3066\u4f7f\u7528\u3059\u308b\u4eba\u306b\u3068\u3063\u3066\u3001vi\u30a8\u30c7\u30a3\u30bf\u30fc\u306e\u30e2\u30fc\u30c9\u3068\u30b3\u30de\u30f3\u30c9\u69cb\u9020\u304c\u72ec\u7279\u3067\u3042\u308b\u305f\u3081\u3001\u30a8\u30c7\u30a3\u30bf\u30fc\u3092\u7d42\u4e86\u3059\u308b\u306e\u304c\u3057\u3070\u3057\u3070\u6238\u60d1\u3046\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u4f5c\u696d\u306e\u9032\u884c\u72b6\u6cc1\u3092\u4fdd\u5b58\u3059\u308b\u5834\u5408\u3067\u3082\u3001\u5909\u66f4\u3092\u5b8c\u5168\u306b\u7834\u68c4\u3059\u308b\u5834\u5408\u3067\u3082\u3001\u6b63\u3057\u304f\u7d42\u4e86\u3059\u308b\u65b9\u6cd5\u3092\u77e5\u3063\u3066\u304a\u304f\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002 \u3055\u307e\u3056\u307e\u306a\u30e2\u30fc\u30c9vi \u30a8\u30c7\u30a3\u30bf\u30fcvi\u306f\u4e3b\u306b 2 \u3064\u306e\u30e2\u30fc\u30c9\u3067\u6a5f\u80fd\u3057\u307e\u3059\u3002 \u30b3\u30de\u30f3\u30c9 \u30e2\u30fc\u30c9:\u3053\u306e\u30e2\u30fc\u30c9\u306f\u3001\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u3068\u3055\u307e\u3056\u307e\u306a\u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002 \u633f\u5165\u30e2\u30fc\u30c9:\u3053\u306e\u30e2\u30fc\u30c9\u3067\u306f\u3001\u30c6\u30ad\u30b9\u30c8\u3092\u8ffd\u52a0\u304a\u3088\u3073\u5909\u66f4\u3067\u304d\u307e\u3059\u3002 \u3092\u958b\u304f\u3068vi\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u30b3\u30de\u30f3\u30c9 \u30e2\u30fc\u30c9\u306b\u306a\u308a\u307e\u3059\u3002\u633f\u5165\u30e2\u30fc\u30c9\u306b\u5207\u308a\u66ff\u3048\u308b\u306b\u306f\u3001 \u3092\u62bc\u3057\u307e\u3059i\u3002\u633f\u5165\u30e2\u30fc\u30c9\u304b\u3089\u30b3\u30de\u30f3\u30c9 \u30e2\u30fc\u30c9\u306b\u623b\u308b\u306b\u306f\u3001 \u3092\u62bc\u3059\u3060\u3051\u3067\u3059Esc\u3002 \u5909\u66f4\u3092\u4fdd\u5b58\u3057\u3066\u7d42\u4e86\u3059\u308b\u65b9\u6cd5vi \u307e\u305a\u3001 \u3092\u62bc\u3057\u3066Esc\u30b3\u30de\u30f3\u30c9\u30e2\u30fc\u30c9\u306b\u5165\u308a\u307e\u3059\u3002 \u6b21\u306b\u3001:wq\u3068\u5165\u529b\u3057\u3066\u62bc\u3057\u307e\u3059Enter\u3002 \u3053\u306e\u30b7\u30fc\u30b1\u30f3\u30b9\u306b\u3088\u308a\u3001\u5909\u66f4\u5185\u5bb9\u304c\u4fdd\u5b58\u3055\u308c\u3001\u30a8\u30c7\u30a3\u30bf\u30fc\u304c\u9589\u3058\u3089\u308c\u307e\u3059\u3002 vi\u5909\u66f4\u3092\u4fdd\u5b58\u305b\u305a\u306b\u9589\u3058\u308b \u62bc\u3059Esc\u3068\u30b3\u30de\u30f3\u30c9\u30e2\u30fc\u30c9\u306b\u5207\u308a\u66ff\u308f\u308a\u307e\u3059\u3002 \u5165\u529b\u3057:q!\u3066 \u3092\u62bc\u3057\u307e\u3059Enter\u3002 vi\u3053\u306e\u65b9\u6cd5\u3067\u306f\u3001\u30bb\u30c3\u30b7\u30e7\u30f3\u4e2d\u306b\u52a0\u3048\u3089\u308c\u305f\u5909\u66f4\u3092\u4fdd\u6301\u305b\u305a\u306b\u7d42\u4e86\u3057\u307e\u3059\u3002 \u4fdd\u5b58\u3057\u3066\u7d42\u4e86\u3059\u308b\u5225\u306e\u65b9\u6cd5 \u3092\u62bc\u3057\u3066\u30b3\u30de\u30f3\u30c9 \u30e2\u30fc\u30c9\u306b\u306a\u3063\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059Esc\u3002 \u6b21\u306b\u3001:x\u3068\u5165\u529b\u3057\u3066\u62bc\u3057\u307e\u3059Enter\u3002 \u30b3\u30de\u30f3\u30c9:x\u306f\u3001\u5909\u66f4\u304c\u5b58\u5728\u3059\u308b\u5834\u5408\u306b\u306e\u307f\u5909\u66f4\u3092\u4fdd\u5b58\u3057\u3001\u7d42\u4e86\u3057\u307e\u3059vi\u3002 vi\u30b7\u30e7\u30fc\u30c8\u30ab\u30c3\u30c8\u30ad\u30fc\u3067\u7d42\u4e86\u3059\u308b \u62bc\u3059Esc\u3068\u30b3\u30de\u30f3\u30c9\u30e2\u30fc\u30c9\u306b\u306a\u308a\u307e\u3059\u3002 Shift+ \u3092Z2 \u56de ( )\u62bc\u3057\u3066ZZ\u4fdd\u5b58\u3057\u7d42\u4e86\u3057\u307e\u3059\u3002 \u3092\u4f7f\u7528\u3059\u308b\u3068ZZ\u3001\u5909\u66f4\u304c\u5373\u5ea7\u306b\u4fdd\u5b58\u3055\u308c\u3001\u30a8\u30c7\u30a3\u30bf\u30fc\u304c\u9589\u3058\u3089\u308c\u307e\u3059\u3002 Esc\u30ad\u30fc\u304c\u6545\u969c\u3057\u305f\u5834\u5408\u306e\u5bfe\u51e6\u65b9\u6cd5 Esc\u30ad\u30fc\u304c\u6a5f\u80fd\u3057\u306a\u3044\u5834\u5408\u306f\u3001\u30b3\u30de\u30f3\u30c9 \u30e2\u30fc\u30c9\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u305f\u3081\u306b\u6b21\u306e\u4ee3\u66ff\u65b9\u6cd5\u3092\u8a66\u3057\u3066\u304f\u3060\u3055\u3044\u3002 Ctrl+ \u3092\u62bc\u3057\u307e\u3059[\u3002 Ctrl+ \u3092\u62bc\u3057\u307e\u3059C\u3002 \u30b3\u30de\u30f3\u30c9 \u30e2\u30fc\u30c9\u306b\u6b63\u5e38\u306b\u5207\u308a\u66ff\u3048\u305f\u3089\u3001\u9069\u5207\u306a\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u7d42\u4e86\u3067\u304d\u307e\u3059vi\u3002 \u3088\u304f\u3042\u308b\u554f\u984c\u306e\u89e3\u6c7a \u7d42\u4e86\u3057\u3088\u3046\u3068\u3057\u305f\u3068\u304d\u306b\u6b21\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc \u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u305f\u5834\u5408: E37: No write since last change [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[205,127],"class_list":["post-4964","post","type-post","status-publish","format-standard","hentry","category-how-to","tag-linux","tag-microsoft"],"acf":[],"_links":{"self":[{"href":"https:\/\/howtogeek.blog\/ja\/wp-json\/wp\/v2\/posts\/4964","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/howtogeek.blog\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/howtogeek.blog\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/howtogeek.blog\/ja\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/howtogeek.blog\/ja\/wp-json\/wp\/v2\/comments?post=4964"}],"version-history":[{"count":1,"href":"https:\/\/howtogeek.blog\/ja\/wp-json\/wp\/v2\/posts\/4964\/revisions"}],"predecessor-version":[{"id":4965,"href":"https:\/\/howtogeek.blog\/ja\/wp-json\/wp\/v2\/posts\/4964\/revisions\/4965"}],"wp:attachment":[{"href":"https:\/\/howtogeek.blog\/ja\/wp-json\/wp\/v2\/media?parent=4964"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/howtogeek.blog\/ja\/wp-json\/wp\/v2\/categories?post=4964"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/howtogeek.blog\/ja\/wp-json\/wp\/v2\/tags?post=4964"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}