Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4447259
  • 博文数量: 1214
  • 博客积分: 13195
  • 博客等级: 上将
  • 技术积分: 9105
  • 用 户 组: 普通用户
  • 注册时间: 2007-01-19 14:41
个人简介

C++,python,热爱算法和机器学习

文章分类

全部博文(1214)

文章存档

2021年(13)

2020年(49)

2019年(14)

2018年(27)

2017年(69)

2016年(100)

2015年(106)

2014年(240)

2013年(5)

2012年(193)

2011年(155)

2010年(93)

2009年(62)

2008年(51)

2007年(37)

分类:

2007-11-10 10:05:12

vi -R filename          /*readonly
view filename           /*readonly

0                       /*begin at the head of a line
$                       /*begin at the tail of a line
w                       /*go to next word
b                       /*go back to the previous word
W/B                     /*do not count the punctuation
(                       /*the begian of this sentense
)                       /*the begian of next sentense

:x                      /*put the cursor to the specific line
Ctrl+G                  /*the get the position of the cursor now
ZZ/:x                   /*the same as :wq
Ctrl+G                  /*the get the position of the cursor now
:e!                     /*reopen the file without your modification

dw                      /*remove the character until the begian of next word
D                       /*remove the character until the end of the line
cc                      /*remove the whole line then go to insert mode
cw
r
R
s
S                       /*remove the whole line then go to insert mode
yw
U                       /*only recover the current line

:!command               /*for example: :!ls
s/misspelled/correct spelled    /*only replace the fist object in the line
s/misspelled/correct spelled/g  /*replace all the objects in the line(globally)
x,ys/characters to be replaced/what to replace with     /*x,y is the line number
x,ys/characters to be replaced/what to replace with/g   /*x,y is the line number
1,$s/mispelled/correct spelled/g    /*replace all the mispelled word in the file
1,$s/mispelled/correct spelled/gc   /*confirm the every replaced word
1,$s/mispelled*/correct spelled/gc   
1,$s/\*/hello/g         /*use hello to replace all the * in the file
1,$s/1,$s/>the/none/g

阅读(1442) | 评论(0) | 转发(0) |
0

上一篇:智力题

下一篇:metacharacter

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