{"id":5699,"date":"2013-10-15T12:01:09","date_gmt":"2013-10-15T04:01:09","guid":{"rendered":"http:\/\/jpuyy.com\/?p=5699"},"modified":"2013-10-17T22:54:49","modified_gmt":"2013-10-17T14:54:49","slug":"vimtutor-summary","status":"publish","type":"post","link":"https:\/\/jpuyy.com\/?p=5699","title":{"rendered":"vimtutor\u5b66\u4e60\u7b14\u8bb0"},"content":{"rendered":"<p>vimtutor\u662f\u4e00\u4e2a\u6559\u7a0b\uff0c\u6559\u4eba\u5b66\u4e60\u4f7f\u7528vim\uff0c\u91cc\u9762\u6709\u4e00\u53e5\u5f88\u91cd\u8981\u7684\u8bdd<\/p>\n<p>NOTE: As you go through this tutor, do not try to memorize, learn by usage.<\/p>\n<p>NOTE: Remember that you should be learning by doing, not memorization.<\/p>\n<p>vim\u5c5e\u4e8e\u5de5\u5177\uff0c\u8981\u4ee5\u52a8\u624b\u64cd\u4f5c\u4e3a\u5b66\u4e60\u76ee\u7684\uff0c\u800c\u4e0d\u662f\u53bb\u8bb0\u5fc6\u3002<\/p>\n<p>\u6574\u7406\u4e00\u4e0b\u4ee5\u524d\u4e0d\u6e05\u6670\u548c\u65b0\u5b66\u5230\u7684\u77e5\u8bc6\u70b9\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>Lesson 1.5: TEXT EDITING &#8211; APPENDING<br \/>\n** Press A to append text. ** \u6309\u5927\u5199\u7684A\uff0c\u5149\u6807\u79fb\u52a8\u5230\u5f53\u524d\u884c\u6700\u540e\u5e76\u5207\u6362\u5230\u63d2\u5165\u6a21\u5f0f<\/p>\n<p>Lesson 2.1: DELETION COMMANDS<br \/>\n** Type dw to delete a word. ** \u5c06\u5149\u6807\u79fb\u52a8\u5230\u4e00\u4e2a\u5355\u8bcd\u7684\u5f00\u5934\u5b57\u6bcd\uff0c\u6309\u4e0bdw\uff0c\u5220\u9664\u5f53\u524d\u5355\u8bcd\u53ca\u8bcd\u540e\u7a7a\u683c\u3002<\/p>\n<p>Lesson 2.2: MORE DELETION COMMANDS<br \/>\n** Type d$ to delete to the end of the line. **\u6309\u4e0bd$\uff0c\u5220\u9664\u4ece\u5149\u6807\u4f4d\u7f6e\u5230\u884c\u5c3e\u7684\u6240\u6709\u5b57<\/p>\n<p>Lesson 2.3: ON OPERATORS AND MOTIONS<br \/>\nvim\u4e2d\u5f88\u591a\u4fee\u6539\u547d\u4ee4\u662f\u9075\u4ece \u64cd\u4f5c+\u52a8\u4f5c \u00a0\u7684\u3002\u5220\u9664\u5373\uff1a<\/p>\n<p>d motion<\/p>\n<p>\u90a3\u4e48<br \/>\nd &#8211; \u8868\u793a\u5220\u9664<br \/>\nmotion &#8211; \u52a8\u4f5c<\/p>\n<p>\u4ee5\u4e0b\u4e09\u4e2a\u662f\u52a8\u4f5c<br \/>\nw &#8211; \u5220\u9664\u5f53\u524d\u5149\u6807\u81f3\u4e0b\u4e00\u4e2a\u5355\u8bcd\u4e4b\u524d\u7684\u5b57\u7b26<br \/>\ne &#8211; \u5220\u9664\u5f53\u524d\u5149\u6807\u81f3\u5f53\u524d\u8bcd\u7684\u672b\u5b57\u7b26<br \/>\n$ &#8211;\u00a0\u5220\u9664\u4ece\u5149\u6807\u4f4d\u7f6e\u5230\u884c\u5c3e\u7684\u6240\u6709\u5b57\u7b26<\/p>\n<p>NOTE:\u53ef\u4ee5\u53d1\u73b0\u5982\u679c\u4e0d\u6309d\uff0c\u5219w\u8868\u793a\u8df3\u5230\u4e0b\u4e00\u4e2a\u5355\u8bcd\u7684\u9996\u5b57\u7b26\uff0ce\u8868\u793a\u8df3\u5230\u5355\u8bcd\u7684\u5c3e\u5b57\u7b26\uff0c$\u8868\u793a\u8df3\u5230\u884c\u5c3e\u3002\u52a0\u6570\u5b57\u8868\u793a\u8ba1\u6570\uff0c\u59823w\u4f1a\u8df3\u5230\u540e\u9762\u7b2c\u4e09\u4e2a\u8bcd\u7684\u9996\u5b57\u6bcd\uff0cd3w\u8868\u793a\u5220\u9664\u4e09\u4e2a\u5355\u8bcd\u3002<\/p>\n<p>Lesson 2.7: THE UNDO COMMAND<\/p>\n<p>** Press u to undo the last commands, U to fix a whole line. ** \u5c0fu\u662f\u64a4\u9500\u64cd\u4f5c\uff0c\u5927U\u662f\u6062\u590d\u5f53\u524d\u884c\u5230\u521d\u59cb\u72b6\u6001\u3002CTRL-R\u8868\u793a\u91cd\u505a\uff0c\u5373undo the undo&#8217;s.<\/p>\n<p>Lesson 3.1: THE PUT COMMAND<\/p>\n<p>** Type p to put previously deleted text after the cursor. **\u5c0fp\u8868\u793aput\u4e4b\u524d\u64cd\u4f5c\u8fc7\uff08\u5220\u9664\uff0c\u590d\u5236\uff09\u7684\u5b57\u7b26\uff0c\u5f53\u7136\u4e5f\u53ef\u4ee5\u8ba4\u4e3a\u662fpaste\u3002\u6309p\uff0c\u201c\u5b57\u7b26\u201d\u4f1a\u88ab\u653e\u5728\u5149\u6807\u7684\u540e\u9762\uff0c\u201c\u884c\u201d\u4f1a\u653e\u5728\u5f53\u524d\u884c\u7684\u4e0b\u9762\u3002<\/p>\n<p>Lesson 3.2: THE REPLACE COMMAND<\/p>\n<p>** Type rx to replace the character at the cursor with x . **\u6309rx\u8868\u793a\u66ff\u6362\u5149\u6807\u7684\u5b57\u7b26\u4e3ax\u3002\u6309\u5927\u5199\u7684R\u4f1a\u4ece\u5f53\u524d\u5b57\u7b26\u66ff\u6362\uff0c\u8f93\u5165\u5b8c\u6210\u540e\u6309esc\u9000\u51fa\u66ff\u6362\u72b6\u6001\uff0c\u8be6\u89c1Lesson 6.3: ANOTHER WAY TO REPLACE<\/p>\n<p>Lesson 3.3: THE CHANGE OPERATOR<\/p>\n<p>** To change until the end of a word, type ce . **\u6309ce\u4f1a\u5220\u9664\u5f53\u524d\u5149\u6807\u5230\u8bcd\u5c3e\u7684\u5b57\u7b26\u5e76\u5207\u6362\u5230\u63d2\u5165\u6a21\u5f0f\u3002\u540c\u6837\u53ef\u4ee5\u4f7f\u7528c$, cw, c3w\u7b49\u64cd\u4f5c\u3002<\/p>\n<p>Lesson 4.1: CURSOR LOCATION AND FILE STATUS<\/p>\n<p>** Type CTRL-G to show your location in the file and the file status.<br \/>\nType G to move to a line in the file. **CTRL-G\u663e\u793a\u5f53\u524d\u4f4d\u7f6e\u7684\u4fe1\u606f\uff0c\u5149\u6807\u7684\u884c\u5217\u7b49\u3002<\/p>\n<p>Lesson 4.2: THE SEARCH COMMAND<br \/>\n** Type \/ followed by a phrase to search for the phrase. **\u641c\u7d22\u65b9\u6cd5\u662f\/word\uff0c\u5982\u679c\u5411\u4e0b\u641c\u7d22\u4f7f\u7528\u5c0fn\uff0c\u5411\u4e0a\u641c\u7d22\u4f7f\u7528\u5927N\uff1b\u4f7f\u7528?\u641c\u7d22\u4e0e\u4f7f\u7528\/\u641c\u7d22\u6b63\u597d\u76f8\u53cd\u3002\u5149\u6807\u5728\u641c\u7d22\u65f6\u8df3\u5230\u4e0d\u540c\u4f4d\u7f6e\uff0c\u8981\u56de\u5230\u4e0a\u4e00\u4f4d\u7f6e\u6309CTRL-O \u5230\u4e0b\u4e00\u4f4d\u7f6e\u6309CTRL-I.<\/p>\n<p>Lesson 4.3: MATCHING PARENTHESES SEARCH<\/p>\n<p>** Type % to find a matching ),], or } . **\u6309%\u8df3\u5230),],}\u7684\u914d\u5bf9\u3002<\/p>\n<p>Lesson 4.4: THE SUBSTITUTE COMMAND<br \/>\n** Type :s\/old\/new\/g to substitute &#8216;new&#8217; for &#8216;old&#8217;. **\u66ff\u6362<\/p>\n<p>#,#s\/old\/new\/g \u4ece\u7b2c\u51e0\u884c\uff0c\u5230\u7b2c\u51e0\u884c\u5c06old\u66ff\u6362\u4e3anew<\/p>\n<p>%s\/old\/new\/g \u66ff\u6362\u5168\u90e8\u6587\u4ef6\u7684old\u4e3anew<br \/>\n%s\/old\/new\/gc \u5728\u5168\u6587\u4ef6\u4e2d\u66ff\u6362\uff0c\u6bcf\u4e00\u6b21\u66ff\u6362\u4f1a\u6709\u63d0\u793a\u8981\u6c42\u786e\u8ba4\u3002<\/p>\n<p>Lesson 5.1: HOW TO EXECUTE AN EXTERNAL COMMAND<\/p>\n<p>** Type :! followed by an external command to execute that command. **\u6267\u884c:!+shell\u547d\u4ee4+\u56de\u8f66 \u00a0\u4f1a\u6267\u884c\u547d\u4ee4\uff0c\u5c31\u4e0d\u7528\u9000\u51favim\u518d\u6267\u884c\u547d\u4ee4\u4e86\u3002<\/p>\n<p>Lesson 5.3: SELECTING TEXT TO WRITE<\/p>\n<p>** To save part of the file, type v motion :w FILENAME **\u4fdd\u5b58\u90e8\u5206\u6587\u4ef6\uff0c\u5148\u6309v\uff0c\u9009\u53d6\u9700\u8981\u7684\u884c\uff0c\u7136\u540e\u6309:w ttt\uff0c\u4fdd\u5b58\u4e3attt<\/p>\n<p>Lesson 5.4: RETRIEVING AND MERGING FILES<\/p>\n<p>** To insert the contents of a file, type :r FILENAME **\u8bfb\u53d6\u6587\u4ef6\u5e76\u63d2\u5165\u5230\u6587\u6863\u4e2d\uff0c\u6309:r filename\u4f1a\u5c06filename\u7684\u5185\u5bb9\u63d2\u5165\u5230\u5f53\u524d\u6587\u6863\u4e2d\u3002:r !ls\u8868\u793a\u5c06ls\u7684\u7ed3\u679c\u63d2\u5165\u5230\u6587\u6863\u4e2d\u3002<\/p>\n<p>Lesson 6.5: SET OPTION<\/p>\n<p>** Set an option so a search or substitute ignores case **vim\u4e2d\u4f7f\u7528\u201c\/\u201d\u641c\u7d22\uff0c\u8bbe\u7f6e\u641c\u7d22\u9ad8\u4eae(hlsearch)\u548c\u5ffd\u89c6\u5927\u5c0f\u5199(ignore case)<\/p>\n<p>:set hls \u641c\u7d22\u9ad8\u4eae<\/p>\n<p>:set nohlsearch \u641c\u7d22\u4e0d\u9ad8\u4eae<\/p>\n<p>:set ic \u5ffd\u89c6\u5927\u5c0f\u5199<\/p>\n<p>:set noic \u4e0d\u5ffd\u89c6\u5927\u5c0f\u5199<\/p>\n<p>\/abc\\c \u5982\u679c\u53ea\u641c\u7d22\u641c\u7d22\u4e00\u6b21\uff0c\u4f7f\u7528\\c\u8868\u793a\u5ffd\u89c6\u5927\u5c0f\u5199<\/p>\n<p>&#8216;ic&#8217; &#8216;ignorecase&#8217; \u5ffd\u7565\u5927\u5c0f\u5199<br \/>\n&#8216;is&#8217; &#8216;incsearch&#8217; \u663e\u793a\u4e0e\u641c\u7d22\u5b57\u7b26\u4e32\u90e8\u5206\u5339\u914d\u7684\u5b57\u7b26\u4e32<br \/>\n&#8216;hls&#8217; &#8216;hlsearch&#8217; \u9ad8\u4eae\u6240\u6709\u5339\u914d\u5b57\u7b26\u4e32<\/p>\n<p>Lesson 7.1: GETTING HELP<br \/>\n** Use the on-line help system **\u83b7\u53d6\u5e2e\u52a9\uff0c\u8f93\u5165 :help &lt;ENTER&gt;<\/p>\n<p>\u4f7f\u7528CTRL-W\u5728vim\u7684\u4e0d\u540c\u7a97\u53e3\u5207\u6362\uff0c\u4f7f\u7528:q\u9000\u51fa\u5f53\u524d\u7a97\u53e3\u3002 \u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u201c:help \u6761\u76ee\u201d\u7684\u683c\u5f0f<br \/>\n:help w<br \/>\n:help c_CTRL-D<br \/>\n:help insert-index<br \/>\n:help user-manual<\/p>\n<p>vim\u8fd8\u6709\u66f4\u591a\u7684\u8bbe\u7f6e\u5728vimrc\u4e2d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>vimtutor\u662f\u4e00\u4e2a\u6559\u7a0b\uff0c\u6559\u4eba\u5b66\u4e60\u4f7f\u7528vim\uff0c\u91cc\u9762\u6709\u4e00\u53e5\u5f88\u91cd\u8981\u7684\u8bdd NOTE: As you go through this tutor, do not try to memorize, learn by usage. NOTE: Remember that you should be learning by doing, not memorization. vim\u5c5e\u4e8e\u5de5\u5177\uff0c\u8981\u4ee5\u52a8\u624b\u64cd\u4f5c\u4e3a\u5b66\u4e60\u76ee\u7684\uff0c\u800c\u4e0d\u662f\u53bb\u8bb0\u5fc6\u3002 \u6574\u7406\u4e00\u4e0b\u4ee5\u524d\u4e0d\u6e05\u6670\u548c\u65b0\u5b66\u5230\u7684\u77e5\u8bc6\u70b9\u3002 &nbsp; Lesson 1.5: TEXT EDITING &#8211; APPENDING ** Press A to append text. ** \u6309\u5927\u5199\u7684A\uff0c\u5149\u6807\u79fb\u52a8\u5230\u5f53\u524d\u884c\u6700\u540e\u5e76\u5207\u6362\u5230\u63d2\u5165\u6a21\u5f0f Lesson 2.1: DELETION COMMANDS ** Type dw to delete a word. [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[94],"tags":[],"class_list":["post-5699","post","type-post","status-publish","format-standard","hentry","category-vim"],"_links":{"self":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/5699","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5699"}],"version-history":[{"count":19,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/5699\/revisions"}],"predecessor-version":[{"id":5733,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/5699\/revisions\/5733"}],"wp:attachment":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5699"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5699"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}