Vim入门(三)

这两天没什么时间弄新计划,只是练了任务帖。今天再新增一些内容,以及新的任务。以往的练习中,h j k l 四个按键的使用熟悉了不少,删除的 x 键及插入按键也记牢了。

相关信息:

以下内容中,不特别说明的,一般都是在命令模式下进行。以下是补充常用键,我最近比较常用:

  1. n 键。输入 / 查找匹配,在高光显示查找结果时,按 n 可跳至附近查找,再按则跳至下一个结果。相当于跳到下一个;
  2. u 键。错误删除时可能想返回操作,不建议使用 “Ctrl+z”,在命令模式下按 u 可撤消操作,意思是 undo;
  3. :help N。N为help的关键字,不加也可以,用以显示帮助。这时候页面内容会切换,退出时:q;
接下来是新的内容:
  1. yy 键。拷贝当前行到剪切板(相当于 Ctrl+C);
  2. dd 键。x 升级版,删除当前行,并且把内容拷到剪切板中(相当于 Ctrl+X);
  3. p 键。copy,将当前剪切板中的内容复制到当前位置(相当 Ctrl+V);
  4. o 键。小写 o 在当前位置后插入一行;
  5. O 键。大写 O 在当前位置前插入一行;
  6. gg 键。小写2个g,把光标移支文档首行位置;
  7. G 键。大写G,把光标称到文档尾行位置;

任务帖:

  1. 每一行后插入一行,内容为该行的第一个单词;
  2. 每一行前插入一行,内容为该行的第一个单词;
  3. 第一段的位置和第二段的位置对调(一行一行来);
  4. 第一段和最后一段位置对调;
  5. 第三段后复制第二段的内容;
  6. 最后一段后再复制最后一段内容;

附:

With Microsoft Windows becoming more and more popular around the world, 
it is increasingly important that we,
 as developers, target the various international markets. 
It was once common for U.S.
 versions of software to ship as much as six months 
prior to the shipping of international versions. 
But increasing international support for the operating 
 is making it easier to produce applications for 
international markets and therefore is reducing
 the time lag between distribution of the U.S. and 
international versions of our software.


Windows has always offered support to help developers
 localize their applications. An application can get
 country-specific information from various functions
 and can examine Control Panel settings to determine
 the user's preferences. Windows even supports different
 fonts for our applications. Last but not least, in
 Windows Vista, Unicode 5.0 is now supported. (Read
 "Extend The Global Reach Of Your Applications With
 Unicode 5.0" at
 http://msdn.microsoft.com/msdnmag/issues/07/01/Unicode/default.aspx
 for a high-level presentation of Unicode 5.0.)


Buffer overrun errors (which are typical when 
manipulating character strings) have become a vector
 for security attacks against applications and even
 against parts of the operating system. In previous
 years, Microsoft put forth a lot of internal and
 external efforts to raise the security bar in the
 Windows world. The second part of this chapter
 presents new functions provided by Microsoft 
in the C run-time library. You should use these
 new functions to protect your code against buffer
 over-runs when manipulating strings.


I decided to present this chapter early in the book
 because I highly recommend that your application
 always use Unicode strings and that you always 
manipulate these strings via the new secure string
 functions. As you'll see, issues regarding the
 secure use of Unicode strings are discussed in
 just about every chapter and in all the sample
 applications presented in this book. If you have
 a code base that is non-Unicode, you'll be best
 served by moving that code base to Unicode,
 as this will improve your application's 
execution performance as well as prepare it for
 localization. It will also help when interoperating
 with COM and the .NET Framework.
---------------------------------------------------------------------- 9.6 -----------
Q:按小 o 之后,有时候光标并不是停留在下一行的行首,而是靠后的位置?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值