{"id":280,"date":"2023-02-24T21:40:53","date_gmt":"2023-02-24T13:40:53","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=280"},"modified":"2023-04-30T15:14:12","modified_gmt":"2023-04-30T07:14:12","slug":"vim-configuration-and-shortcut-keys","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/02\/24\/vim-configuration-and-shortcut-keys\/","title":{"rendered":"vim\u914d\u7f6e\u53ca\u5feb\u6377\u952e"},"content":{"rendered":"<h2>\u914d\u7f6e\u6587\u4ef6<\/h2>\n<pre><code># vim \/etc\/vimrc  \u6216  #vim \/etc\/vim\/vimrc \/\/\u66f4\u6539\u5168\u5c40\u914d\u7f6e\uff0c\u9700\u8981root\u6743\u9650\n# vim ~\/.vimrc \/\/\u4e3a\u5f53\u524d\u7528\u6237\u914d\u7f6e\u73af\u5883<\/code><\/pre>\n<p><!-- more --><\/p>\n<p>\u63a8\u8350\u4f7f\u7528\u5982\u4e0b\u914d\u7f6e\uff1a<\/p>\n<pre><code>set ts=4          &quot;tab\u5bbd\u56db\u4e2a\u7a7a\u683c\nset expandtab     &quot;\u7f29\u8fdb\u4f7f\u7528\u7a7a\u683c\u8868\u793a\nset hlsearch      &quot;\u9ad8\u4eae\u5ea6\u53cd\u767d\nset backspace=2   &quot;\u53ef\u968f\u65f6\u7528\u9000\u683c\u952e\u5220\u9664\nset autoindent    &quot;\u81ea\u52a8\u7f29\u6392\nset nu            &quot;\u663e\u793a\u884c\u53f7\nset ruler         &quot;\u53ef\u663e\u793a\u6700\u540e\u4e00\u884c\u7684\u72b6\u6001\nset cursorline    &quot;\u884c\u9ad8\u4eae\u6807\u8bb0\nset showmode      &quot;\u5de6\u4e0b\u89d2\u90a3\u4e00\u884c\u7684\u72b6\u6001\nset bg=dark       &quot;\u663e\u793a\u4e0d\u540c\u7684\u5e95\u8272\u8272\u8c03\nsyntax on         &quot;\u8fdb\u884c\u8bed\u6cd5\u68c0\u9a8c\uff0c\u989c\u8272\u663e\u793a<\/code><\/pre>\n<h2>\u547d\u4ee4\u6a21\u5f0f\u5feb\u6377\u952e<\/h2>\n<ul>\n<li><code>x<\/code>\uff1a\u5220\u9664<\/li>\n<li><code>dd<\/code>\uff1a\u5220\u9664\u884c<\/li>\n<li><code>u<\/code>\uff1a\u64a4\u9500<\/li>\n<li><code>yy<\/code>:\uff1a\u590d\u5236\u884c<\/li>\n<li><code>p<\/code>\uff1a\u7c98\u8d34<\/li>\n<\/ul>\n<h2>vim\u5220\u9664\u5feb\u6377\u952e<\/h2>\n<p><code>dd<\/code>: \u5220\u9664\u6e38\u6807\u6240\u5728\u7684\u4e00\u6574\u884c(\u5e38\u7528)<br \/>\n<code>ndd<\/code>: n\u4e3a\u6570\u5b57\u3002\u5220\u9664\u5149\u6807\u6240\u5728\u7684\u5411\u4e0bn\u884c\uff0c\u4f8b\u598220dd\u5219\u662f\u5220\u9664\u5149\u6807\u6240\u5728\u7684\u5411\u4e0b20\u884c<br \/>\n<code>d1G<\/code>: \u5220\u9664\u5149\u6807\u6240\u5728\u5230\u7b2c\u4e00\u884c\u7684\u6240\u6709\u6570\u636e<br \/>\n<code>dG<\/code>: \u5220\u9664\u5149\u6807\u6240\u5728\u5230\u6700\u540e\u4e00\u884c\u7684\u6240\u6709\u6570\u636e<br \/>\n<code>d$<\/code>: \u5220\u9664\u5149\u6807\u6240\u5728\u5904\uff0c\u5230\u8be5\u884c\u7684\u6700\u540e\u4e00\u4e2a\u5b57\u7b26<br \/>\n<code>d0<\/code>: \u90a3\u4e2a\u662f\u6570\u5b570\uff0c\u5220\u9664\u5149\u6807\u6240\u5728\u5230\u8be5\u884c\u7684\u6700\u524d\u9762\u7684\u4e00\u4e2a\u5b57\u7b26<br \/>\n<code>x,X<\/code>: x\u5411\u540e\u5220\u9664\u4e00\u4e2a\u5b57\u7b26(\u76f8\u5f53\u4e8e[del]\u6309\u952e)\uff0cX\u5411\u524d\u5220\u9664\u4e00\u4e2a\u5b57\u7b26(\u76f8\u5f53\u4e8e[backspace]\u5373\u9000\u683c\u952e)<br \/>\n<code>nx<\/code>: n\u4e3a\u6570\u5b57\uff0c\u8fde\u7eed\u5411\u540e\u5220\u9664n\u4e2a\u5b57\u7b26<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u914d\u7f6e\u6587\u4ef6 # vim \/etc\/vimrc \u6216 #vim \/etc\/vim\/vimrc \/\/\u66f4\u6539\u5168\u5c40\u914d\u7f6e\uff0c\u9700\u8981 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[93],"class_list":["post-280","post","type-post","status-publish","format-standard","hentry","category-devops-base","tag-vim"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/280","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=280"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/280\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=280"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=280"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}