vim 简单介绍

2,295 views次阅读
没有评论

vim 简单介绍

 

vim 命令,vim是一个很好的编辑工具,下面为大家介绍一下vim入门基本命令。

 

vim 启动命令

格式: vim 文件名 <回车>

 

vim 退出命令

  1. 按 “ESC”键。
  2. :q! <回车> 不保存退出。
  3. :wq <回车> 保存退出。

 

vim 常用编辑命令

  1. x 键来删除光标所在位置的字符。
  2. i 键来删除文本。

 

vim 删除类命令

  1. 输入 dw 可以从光标处删除至一个单字/单词的末尾,包括空格。
  2. 输入 de 可以从光标处删除至一个单字/单词的末尾,包括不空格。
  3. 输入 d$ 可以从当前光标删除到行末。
  4. 输入 dd 可以删除整个当前行。
  5. 输入 u 来撤销最后执行的命令。
  6. 输入 U 修正整行,撤销整行所做的改动。
  7. 如果要撤销之前的撤销命令,恢复以前的操作结果。输入 CTRL-R。

 

vim 搜索命令

输入 / 以及尾随的字符可以来搜索当前文件中的字符串。

 

vim 替换命令

输入 :s/old/new/g 可以替换 old 为 new 。

 

正文完
 0
HopoL
版权声明:本站原创文章,由 HopoL 于2016-09-16发表,共计369字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
评论(没有评论)

HopoL's Blog

文章搜索
最新评论
Metaldololity Metaldololity Whoa, that's really simple. You just save my time a lot. Thankyou!
HopoL HopoL Since you’ve got the backup, it’s actually pretty simple. Just restore the backup files to your new flash drive, then head over to the /config directory and edit the go file. Look for export UNRAID_GUID=xxxxxxxxxxxxxx and swap it with your new drive's GUID. That should do the trick!
Metaldololity Metaldololity Really apreciate for your fast respond, mate. I actually have the backup of the flashdrive (from regular unraid backup). The problem is, when i search on youtube tutorial about changing the failed flashdrive, the process need some sort of confirmation with an account in unraid (blacklist the old one -> whitelist the new one). Since i have a cracked unraid, i don't know how to register my new flashdrive as the correct one (and the system not asking me for the old failed flashdrive). Thanks in advance
HopoL HopoL Man, that's a tough spot to be in. Regularly backing up your /boot folder is super important for exactly this reason. If you don't have a backup and your flash drive is completely fried, your best bet is to Google some specific recovery guides or check the Unraid forums. There are ways to rebuild your config by identifying your parity and data drives, but it can be a bit of a process. Hope you can get it sorted!
Metaldololity Metaldololity Hi! Huge thanks for the update on 7.2.0. I have question here, my flashdrive corrupted. how do i install it on the new flashdrive without losing all my configuration?