Skip to content

Commit

Permalink
2016-04-15完善vim和vmware复制两篇文章
Browse files Browse the repository at this point in the history
  • Loading branch information
judasn committed Apr 15, 2016
1 parent f709516 commit 01264f0
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
5 changes: 4 additions & 1 deletion CentOS-Virtual-Machine-Copy-Settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

## 概述

- 在我们需要多台 CentOS 虚拟机的时候,对已有虚拟机的系统进行克隆或是复制。但是这样做又有一个问题,克隆出来的虚拟机启动的时候你输入命令:`ifconfig`,eth0 网卡信息没了,只有一个 eth1。 对于处女座的人来讲这是不允许的。所以我们需要改动下.
- 在我们需要多台 CentOS 虚拟机的时候,对已有虚拟机的系统进行克隆或是复制。但是这样做又有一个问题,克隆出来的虚拟机启动的时候你输入命令:`ifconfig`,eth0 网卡信息没了,只有一个 eth1。 对于处女座的人来讲这是不允许的。所以我们需要改动下。
- 复制虚拟机后,首次打开该会提示如下内容,一般选择 copy 这个配置。
- ![vim](images/CentOS-Virtual-Machine-Copy-Settings-a-1.png)



## 修改方法
Expand Down
28 changes: 19 additions & 9 deletions Vim-Install-And-Settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,16 @@
- 粘贴
- `p`,将粘贴板中内容复制到 **光标之后**
- `P`,将粘贴板中内容复制到 **光标之前**
- `ddp`,交换当前光标所在行和下一行的位置
- `u`,撤销
- `:wq`,退出并 **保存**
- `:q!`,退出并 **不保存**
- `Ctrl + v`,进入 Vim 列编辑
- `guu`,把当前行的字母全部转换成 **小写**
- `gUU`,把当前行的字母全部转换成 **大写**
- `g~~`,把当前行的字母是大写的转换成小写,是小写的转换成大写
- `:saveas /opt/setups/text.txt`,另存到 /opt/setups/text.txt
- 其他
- `ddp`,交换当前光标所在行和下一行的位置
- `u`,撤销
- `:wq`,退出并 **保存**
- `:q!`,退出并 **不保存**
- `Ctrl + v`,进入 Vim 列编辑
- `guu`,把当前行的字母全部转换成 **小写**
- `gUU`,把当前行的字母全部转换成 **大写**
- `g~~`,把当前行的字母是大写的转换成小写,是小写的转换成大写
- `:saveas /opt/setups/text.txt`,另存到 /opt/setups/text.txt
- 搜索
- `/YouMeek`,从光标开始处向文件尾搜索 YouMeek 字符,按 `n` 继续向下找,按 `N` 继续向上找
- `?YouMeek`,从光标开始处向文件首搜索 YouMeek 字符,按 `n` 继续向下找,按 `N` 继续向上找
Expand All @@ -95,6 +96,15 @@
- `:10,31s/YouMeek/Judasng`,把第 10 行到 31 行之间所有 YouMeek 替换为 Judasn


## Vim 的特殊复制、黏贴

- Vim 提供了 12 个剪贴板,分别是:`0,1,2,3,4,5,6,7,8,9,a,"`,默认采用的是 `"`,也就是双引号,可能你初读感觉很奇怪。你可以用 Vim 编辑某个文件,然后输入:`:reg`。你可以看到如下内容:
- ![vim](images/Vim-Cut-And-Paste-a-1.png)
- 复制到某个剪切板的命令:`"7y`,表示使用 7 号剪切板。
- 黏贴某个剪切板内容:`"7p`,表示使用 7 号剪切板内容进行黏贴



## Vim 配置

- 我个人本地不使用 Vim 的,基本上都是在操作服务器的时候使用,所以这里推荐这个配置文件
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Vim-Cut-And-Paste-a-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 01264f0

Please sign in to comment.