Chinaunix首页 | 论坛 | 博客
  • 博客访问: 590414
  • 博文数量: 150
  • 博客积分: 1132
  • 博客等级: 少尉
  • 技术积分: 2067
  • 用 户 组: 普通用户
  • 注册时间: 2012-04-11 16:46
文章分类

全部博文(150)

文章存档

2015年(15)

2014年(75)

2013年(4)

2012年(56)

vim

分类: 系统运维

2014-07-18 15:31:45

1. 显示看不清楚的时候,调整下配色方案:
    :colorscheme evening
2. 文本替换:
     Search as in sed
     ~ Affects current line by default.
     ~ Use x,y ranges or % for whole file
          :1,5s/cat/dog/
          :%s/cat/dog/gi
3. 替换一行的命令行命令:
     cc     #挺好用
4. Undoing Changes:
     ~ u undo most recent change
     ~ Ctrl-r redo last "undone" change   #与上面的配合,棒极了!
     ~ U undo all changes to the current line since the cursor landed on the line.
5. Visual Mode:
    ~ Allows selection of blocks of text.
          v starts character-oriented highlighting
          V starts line-oriented highlighting
    ~ Visual keys can be used in conjunction with movement keys.
    ~ Highlighted text can be deleted, yanked, changed, filtered, search/replaced, etc.
6. Using multiple "windows":
    ~ Multiple documents can be viewed in a single vim screen.
        - Ctrl-w, s splits the screen horizontally
        - Ctrl-w, v splits the screen vertically
        - Ctrl-w, Arrow(h,j,k,l is ok, too) moves between windows.
    ~ Ex-mode instructions always affect the current window
    ~ :help windows displays more window commands
    ~ vim -O file1 file2   #竖着用两个 windows 分别打开 file1 和 file2
       vim -o file1 file2   #横着用两个 windows 分别打开 file2 和 file2
    ~ 调整 window 的大小:
        Ctrl-w, N+     #增加高度,幅度是 N
        Ctrl-w, N      #降低高度,幅度是 N
        Ctrl-w,N>    #增加宽度,幅度是 N
        Ctrl-w, N<
    #缩小宽度,幅度是 N
7.   
阅读(719) | 评论(0) | 转发(0) |
0

上一篇:SYN Cookie原理

下一篇:svn 向 git 迁移

给主人留下些什么吧!~~