[2016-04-12][vim常用命令]
Esc //退出编辑模式 i //进入编辑模式,光标停留在当前位置 o //进入编辑模式,在当前行之后新建一行,光标停留在新行行首 dd //删除当前光标所在行,在命令前加数字可以删除多行,如 5dd 将删除从当前行开始向下5行 yy //复制当前光标所在行,在命令前加数字可以复制多行,如 5yy 将复制从当前行开始向下5行 p //把复制的内容粘在当前行下面,大写的P就粘上面 gg //跳到文件第一行 u //撤销 gg=G //规范缩进 :w //保存 :q //退出 :q! //不保存强制退出 :%s/old/new/g //搜索整个文件,将old都替换成new,old和new是字符串
[2016-04-16][vim配置信息]
- 修改~/.vimrc文件
- 最后if-endif语句,是设置光标为windows下的竖线
syntax onset tabstop=8set softtabstop=8set shiftwidth=8set cindentset nuif has("autocmd") au InsertEnter * silent execute "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape ibeam" au InsertLeave * silent execute "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape block" au VimLeave * silent execute "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape ibeam" endif