对Linux命令进一步学习vim(二)
2016-03-14 11:39
906 查看
今天,进一步学习Linux相关的命令,可能会有重复的地方,但学习本来就是不断重复的过程。故作小记!
1.安装了:vim ,,,一款Linux爱好者经常用到的ide
sudo apt-get install vim
root@wuheng-virtual-machine:/var/www/html# ls
a.txt demo1 index.html phpmyadmin wh.tar.gz
root@wuheng-virtual-machine:/var/www/html# vi a.txt #####使用vim编辑器打开a.txt文件,,,vim a.txt亦可。
E325: ATTENTION
Found a swap file by the name ".a.txt.swp"
owned by: root dated: Sun Mar 13 19:41:51 2016
file name: /var/www/html/a.txt
modified: YES
user name: root host name: wuheng-virtual-machine
process ID: 3529 (still running)
While opening file "a.txt"
dated: Sun Mar 13 20:04:42 2016
NEWER than swap file!
(1) Another program may be editing the same file. If this is the case,
be careful not to end up with two different instances of the same
file when making changes. Quit, or continue with caution.
(2) An edit session for this file crashed.
If this is the case, use ":recover" or "vim -r a.txt"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file ".a.txt.swp"
to avoid this message.
Swap file ".a.txt.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort: #####选择你要对该文件的访问方式
1-1.历史命令
以:和/开头的命令都有历史纪录,可以首先键入:或/然后按上下箭头来选择某个历史命令。
~
~
~
:q!
1-2.直接在文本内容上进行编辑操作。
1-3:编辑完成后,按“Esc”键,退出当前的编辑,按组合键(“shift+:”),然后使用退出命令
:wq 保存并退出
ZZ 保存并退出
:q! 强制退出并忽略所有更改
:e! 放弃所有修改,并打开原来文件。
1-4,vim模式
正常模式(按Esc或Ctrl+[进入) 左下角显示文件名或为空
插入模式(按i键进入) 左下角显示--INSERT--
可视模式(不知道如何进入) 左下角显示--VISUAL--
1-5,插入命令
i 在当前位置生前插入
I 在当前行首插入
a 在当前位置后插入
A 在当前行尾插入
o 在当前行之后插入一行
O 在当前行之前插入一行
1.安装了:vim ,,,一款Linux爱好者经常用到的ide
sudo apt-get install vim
root@wuheng-virtual-machine:/var/www/html# ls
a.txt demo1 index.html phpmyadmin wh.tar.gz
root@wuheng-virtual-machine:/var/www/html# vi a.txt #####使用vim编辑器打开a.txt文件,,,vim a.txt亦可。
E325: ATTENTION
Found a swap file by the name ".a.txt.swp"
owned by: root dated: Sun Mar 13 19:41:51 2016
file name: /var/www/html/a.txt
modified: YES
user name: root host name: wuheng-virtual-machine
process ID: 3529 (still running)
While opening file "a.txt"
dated: Sun Mar 13 20:04:42 2016
NEWER than swap file!
(1) Another program may be editing the same file. If this is the case,
be careful not to end up with two different instances of the same
file when making changes. Quit, or continue with caution.
(2) An edit session for this file crashed.
If this is the case, use ":recover" or "vim -r a.txt"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file ".a.txt.swp"
to avoid this message.
Swap file ".a.txt.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort: #####选择你要对该文件的访问方式
1-1.历史命令
以:和/开头的命令都有历史纪录,可以首先键入:或/然后按上下箭头来选择某个历史命令。
~
~
~
:q!
1-2.直接在文本内容上进行编辑操作。
1-3:编辑完成后,按“Esc”键,退出当前的编辑,按组合键(“shift+:”),然后使用退出命令
:wq 保存并退出
ZZ 保存并退出
:q! 强制退出并忽略所有更改
:e! 放弃所有修改,并打开原来文件。
1-4,vim模式
正常模式(按Esc或Ctrl+[进入) 左下角显示文件名或为空
插入模式(按i键进入) 左下角显示--INSERT--
可视模式(不知道如何进入) 左下角显示--VISUAL--
1-5,插入命令
i 在当前位置生前插入
I 在当前行首插入
a 在当前位置后插入
A 在当前行尾插入
o 在当前行之后插入一行
O 在当前行之前插入一行
相关文章推荐
- linux-vim编辑器笔记(长期持续更新)
- Linux并发(task_struct结构体)
- Linux g++编译 so文件出错:file not recognized: File trunccated
- Linux下设置MySQL编码
- Linux下PS命令详解 (转)
- Linux CPU affinity
- Linux 进程间通信-管道
- linux 学习之路(学linux必看)
- 你知道 Linux 内核是如何构建的吗?
- Linux 删除mysql数据库失败的解决方法
- 在Centos下用alternatives命令切换各个版本的jdk的方法
- linux系统优化
- Linux Makefile try-run
- Linux 下街机模拟器 mame 安装
- Redhat&CentOS 国内YUM源配置
- latencytop深度了解你的Linux系统的延迟
- CENTOS与时间服务器时间同步
- 初学linux—windows与ubuntu文件共享samba
- man 命令的使用,linux根分区详解!
- U盘安装Centos拔除U盘后无法启动问题解决