{"id":1534,"date":"2013-02-20T17:09:55","date_gmt":"2013-02-20T09:09:55","guid":{"rendered":"http:\/\/me.doucl.com\/?p=1534"},"modified":"2013-02-20T17:11:24","modified_gmt":"2013-02-20T09:11:24","slug":"vim-motion-txt-selected","status":"publish","type":"post","link":"https:\/\/blog.vimge.com\/archives\/vim\/vim-motion-txt-selected.html","title":{"rendered":"vim\u533a\u57df\u9009\u62e9\u4e4bmotion\u7279\u6027"},"content":{"rendered":"
\u533a\u57df\u9009\u62e9\u8bed\u6cd5\uff1a <action>a<object> \u6216 <action>i<object><\/p>\n
action\u53ef\u4ee5\u662f\u4efb\u4f55\u7684\u547d\u4ee4\uff0c\u5982 d (\u5220\u9664), y (\u62f7\u8d1d), v (\u53ef\u4ee5\u89c6\u6a21\u5f0f\u9009\u62e9),c(\u4fee\u6539)\u3002
object \u53ef\u80fd\u662f\uff1a w \u4e00\u4e2a\u5355\u8bcd\uff0c W \u4e00\u4e2a\u4ee5\u7a7a\u683c\u4e3a\u5206\u9694\u7684\u5355\u8bcd\uff0c s \u4e00\u4e2a\u53e5\u5b57\uff0c p \u4e00\u4e2a\u6bb5\u843d\u3002\u4e5f\u53ef\u4ee5\u662f\u4e00\u4e2a\u7279\u522b\u7684\u5b57\u7b26\uff1a”\u3001 ‘\u3001 )\u3001 }\u3001 ]\u3001<\u3001>\u3002PS\uff1aHTML\u6807\u7b7e\u7f16\u8f91\u662f\u4e0d\u662f\u4f1a\u5f88\u723d \ud83d\ude42<\/p>\n
\u5047\u8bbe\u4f60\u6709\u4e00\u4e2a\u5b57\u7b26\u4e32 (map (+) (“foo”)).\u800c\u5149\u6807\u952e\u5728\u7b2c\u4e00\u4e2a o \u7684\u4f4d\u7f6e\u3002<\/p>\n
vi\"<\/code>\u00a0\u2192 \u4f1a\u9009\u62e9\u00a0
foo<\/code>.
\nva\"<\/code>\u00a0\u2192 \u4f1a\u9009\u62e9\u00a0
\"foo\"<\/code>.
\nvi)<\/code>\u00a0\u2192 \u4f1a\u9009\u62e9\u00a0
\"foo\"<\/code>.
\nva)<\/code>\u00a0\u2192 \u4f1a\u9009\u62e9
(\"foo\")<\/code>.
\nv2i)<\/code>\u00a0\u2192 \u4f1a\u9009\u62e9\u00a0
map (+) (\"foo\")<\/code>
\nv2a)<\/code>\u00a0\u2192 \u4f1a\u9009\u62e9\u00a0
(map (+) (\"foo\"))<\/code><\/p><\/blockquote>\n
\n<\/pre>\n<\/p>\n
\u5b9e\u9645\u4e0a\u533a\u57df\u9009\u62e9\u8bed\u6cd5\u7528\u5230\u4e86vim\u7684”motion”\u7279\u6027\uff0c\u5b98\u65b9\u6587\u6863\u8bf4\u660e\u5982\u4e0b\uff1a
\nThe motion commands can be used after an operator<\/a> command, to have the command
\noperate on the text that was moved over. That is the text between the cursor
\nposition before and after the motion. Operators are generally used to delete
\nor change text.
\nIf the motion includes a count<\/a> and the operator<\/a> also had a count<\/a> before it,
\nthe two counts are multiplied. For example: “2d3w” deletes six words.<\/p>\n<\/div>\n\nmotion\u547d\u4ee4\u53ef\u4ee5\u7528\u5728operator\u547d\u4ee4\u540e\u9762\uff0c\u5b9e\u73b0\u5728\u5339\u914d\u7684\u6587\u672c\u5185\u5bb9\u4e0a\u6267\u884c\u7279\u5b9a\u547d\u4ee4.motion\u547d\u4ee4\u5339\u914d\u6307\u5b9a\u6807\u8bc6\u7b26\u914d\u5bf9\u95f4\u7684\u5185\u5bb9.
\nmotion\u547d\u4ee4\u652f\u6301\u524d\u7f00\u6570\u5b57\u8868\u793a\u5339\u914d\u6b21\u6570\uff0c\u5f53\u7136operator\u4e0emotion\u7ec4\u5408\u65f6\u4e5f\u652f\u6301\u6570\u5b57\u524d\u7f00\uff0c\u4e24\u4e2a\u6570\u5b57\u524d\u7f00\u5c06\u8fdb\u884c\u4e58\u6cd5\u6548\u679c.<\/p>\n<\/p>\n<\/div>\n
\u5f15\u7528\u8d44\u6599\uff1a<\/strong><\/div>\n