[vim编辑器]

[2016-04-12][vim常用命令]

  1. Esc //退出编辑模式
  2. i //进入编辑模式,光标停留在当前位置
  3. o //进入编辑模式,在当前行之后新建一行,光标停留在新行行首
  4. dd //删除当前光标所在行,在命令前加数字可以删除多行,如 5dd 将删除从当前行开始向下5行
  5. yy //复制当前光标所在行,在命令前加数字可以复制多行,如 5yy 将复制从当前行开始向下5行
  6. p //把复制的内容粘在当前行下面,大写的P就粘上面
  7. gg //跳到文件第一行
  8. u //撤销
  9. gg=G //规范缩进
  10. :w //保存
  11. :q //退出
  12. :q! //不保存强制退出
  13. :%s/old/new/g //搜索整个文件,将old都替换成new,old和new是字符串

[2016-04-16][vim配置信息]

  • 修改~/.vimrc文件
  • 最后if-endif语句,是设置光标为windows下的竖线
  1. syntax on
  2. set tabstop=8
  3. set softtabstop=8
  4. set shiftwidth=8
  5. set cindent
  6. set nu
  7. if has("autocmd")
  8. au InsertEnter * silent execute "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape ibeam"
  9. au InsertLeave * silent execute "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape block"
  10. au VimLeave * silent execute "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape ibeam"
  11. endif


来自为知笔记(Wiz)


posted on 2016-04-17 00:11  红洋  阅读(161)  评论(0)    收藏  举报

导航