vim编辑常用命令
来源:互联网 发布:mysql distinct where 编辑:程序博客网 时间:2024/06/05 19:12
vim配置文件
:vimrc
普通模式下常用命令
:s/foo/bar/g change each 'foo' to 'bar' in the current line
:%s /foo/bar/g change each 'foo' to 'bar' in all lines
:123[Enter] takes you to line 123 in the file
123[Enter] takes you 123 lines down from your present position
u undo last change
ctrl-R Redo changes which were undo
gg Jump to the start of the file
G Jump to the end of the file
dG Delete from the current line to the end of the line
o insert newline after the current line
O insert newline before the current line
x 删除光标所在字符
rc 将当前字符替换成c
:set expandtab insert space characters whenever tab key is pressed
:set tabstep=4 insert 4 space for a tab
/word 查找单词word
Find a whole word
\< represents the begining of a word
\> represents the end of a word
to find only the whole word "i" use pattern:
\<i\>
关于:map
:map j gg j will be mapped to gg
:map Q j Q will be mapped to gg
:noremap w j W will be mapped to j
:map recursive, works in all mode
:noremap non-recursive, works in all mode
:nmap works in normal mode
:nnoremap works in normal mode
例:普通模式插入空格
:nnoremap <space> i<space><ESC>
复制和粘贴
Position the cursor where you want to begin cutting
Press v( or upper v if you want to cut with whole lines)
Move the cursor to the end of what you want to cut
Press y to copy or d to cut
Move to where you would like to paste
Press P to paste before cursor, or p to paste after
- vim编辑常用命令
- vim编辑中用到的一些常用命令
- vim编辑
- vim编辑
- vim 编辑
- vim 编辑
- LinuxStudyNote(36)-Vim(1)-Vim常用操作、Vim操作详细教程、Vim常用命令、命令模式、命令模式常用命令、插入模式、编辑模式
- VIM常用命令
- vim常用命令
- vim常用命令
- vim常用命令
- Vim常用命令
- vim常用命令
- vim常用命令
- vim常用命令
- VIM 常用命令
- VIM常用命令
- vim 常用命令
- 事务
- mysqlbinlog参数详解#摘录自MySQL5.5文档
- 设计复数类complex
- 面向程序员的数据库访问性能优化法则
- 010Editor 5.0.2 附注册机 附elf,dex,xml文件格式分析模板
- vim编辑常用命令
- 【cocos2d-x从c++到js】12:回调函数1——按键回调
- hadoop学习7-
- CSS:自定义链接样式(设置链接不同状态下的字体颜色/背景色等)
- 学习博客、网站
- Unity3d-除了C#还需要学习什么语言?
- 酒店评价方案
- 【cocos2d-x从c++到js】13:回调函数2——JSCallbackWrapper
- HDFS性能压测工具浅析