【vim】在vim中将unix命令执行的结果保存在vim文件中
来源:互联网 发布:今年淘宝总额 编辑:程序博客网 时间:2024/05/16 16:55
You can combine :read with a call to Unix, to read the results of a Unix command into
your file. As a very simple example:
示例1:
:r !date (此命令是将当前日期添加到当前行)
示例2:
假设有如下文本,phone.log:
=======================
Willing, Sue 333-4444
Walsh, Linda 555-6666
Quercia, Valerie 777-8888
Dougherty, Nancy 999-0000
==========================
然后执行命令:
:r !sort phone.log
执行后,会将排过序的数据插入到当前行的下面
示例3:
Suppose you are editing a file and want to insert text from another file in the directory,
but you can’t remember the new file’s name. You could perform this task the long way:
exit your file, give the ls command, note the correct filename, reenter your file, and
search for your place.
Or you could do the task in fewer steps:
Keystrokes
:!ls
Results file1 newfile file2 practice letter
Display a list of files in the current directory. Note the correct filename. Press ENTER to
continue editing.
:r newfile
"newfile" 35 lines, 949 characters
Read in the new file.
- 【vim】在vim中将unix命令执行的结果保存在vim文件中
- 【vim】在vim中使用unix命令
- 使用vim在文件中插入命令执行的输出结果
- 在Vim编辑器中执行Shell命令
- 在vim中将行号写入文件
- 在Vim中执行Python
- [vim 小技巧] 在vim里保存只读文件
- vim操作技巧(二)在vim中调用命令结果
- vim的保存文件和退出命令
- vim的保存文件和退出命令
- vim的保存文件和退出命令
- vim的保存文件和退出命令
- vim的保存文件和退出命令
- vim的保存文件和退出命令
- vim的保存文件和退出命令
- vim的保存文件和退出命令
- vim的保存文件和退出命令
- vim的保存文件和退出命令
- C++ 编译出现: error C2871: 'std' : does not exist or is not a namespace 怎么解决
- Linux Epoll介绍和程序实例
- linux 下动态链接库的创建与使用——dlopen,dlsym
- pydev 功能及使用示例
- 10391 - Compound Words
- 【vim】在vim中将unix命令执行的结果保存在vim文件中
- null是什么类型,初始化null在内存中是如何分配内存的?
- 勿让“天地图”成绿坝第二
- Java注释Override、Deprecated、SuppressWarnings详解
- Oracle 启动的三个步骤
- java工厂模式
- C++中对文本的读写
- 解决d.setToolTipText() 显示文本不能显示图片的问题
- mono-3.0.2安装指南及一键安装脚本