linux命令---vim常用命令
2016-04-06 10:59
429 查看
1、vim中的排序
2、vim中统计字节字符数
3、vim中的计算
4、vim中拷贝鼠标下单词到命令行中
5、vim中拷贝指定寄存器中的值到命令行
6、vim添加头文件
|2 | 22 | 111| 2222| |1 | 11 | 222| 1111| :sort /|[^|]\+|[^|]\+/ #sort grep |1 | 11 | 222| 1111| |2 | 22 | 111| 2222|
2、vim中统计字节字符数
g+[ctrl+g]
3、vim中的计算
在vim的插入模式下输入:CTRL+R =
4、vim中拷贝鼠标下单词到命令行中
ctrl-r-w
5、vim中拷贝指定寄存器中的值到命令行
ctrl-r+reg_name
6、vim添加头文件
function InsertHeadDef(firstLine, lastLine) if a:firstLine <1 || a:lastLine> line('$') echoerr 'InsertHeadDef : Range overflow !(FirstLine:'.a:firstLine.';LastLine:'.a:lastLine.';ValidRange:1~'.line('$').')' return '' endif let sourcefilename=expand("%:t") let definename=substitute(sourcefilename,' ','','g') let definename=substitute(definename,'\.','_','g') let definename = toupper(definename) exe 'normal '.a:firstLine.'GO' call setline('.', '#ifndef _'.definename."_") normal ==o call setline('.', '#define _'.definename."_") exe 'normal =='.(a:lastLine-a:firstLine+1).'jo' call setline('.', '#endif') let goLn = a:firstLine+2 exe 'normal =='.goLn.'G' endfunction function InsertHeadDefN() let firstLine = 1 let lastLine = line('$') let n=1 while n < 20 let line = getline(n) if n==1 if line =~ '^\/\*.*$' let n = n + 1 continue else break endif endif if line =~ '^.*\*\/$' let firstLine = n+1 break endif let n = n + 1 endwhile call InsertHeadDef(firstLine, lastLine) endfunction nmap ,ha :call InsertHeadDefN()<CR>
相关文章推荐
- centos7免密码登录
- linux下安装+配置+卸载jdk
- CentOS7.0分布式安装HADOOP 2.6.0笔记-转载的
- 慢慢聊Linux AIO
- Linux内核分析07
- Linux设备驱动开发详解总结(二)之并发与竞争
- 解决redhat自带yum不能用的问题 (借用CentOS)
- 宿主机Windows访问虚拟机Linux文件(一)
- linux重启命令学习
- linux ping不通外网unknown host xxxxx解决方法
- 我的2016年决心书(老男孩教育在线课程班)
- Linux应用服务器搭建手册——weblogic安装
- Linux下chkconfig命令详解
- umask文件权限屏蔽字
- linux如何禁止某个ip连接服务器
- Ubuntu下安装fastboot的时候出现 未发现软件包
- 局域网内Windows使用RealVNC远程连接CentOS6.5桌面
- 硬链接的创建及删除
- 阿里云CentOS使用vsftpd搭建FTP服务器
- 由文件描述符得到文件的全路径