这两天没什么时间弄新计划,只是练了任务帖。今天再新增一些内容,以及新的任务。以往的练习中,h j k l 四个按键的使用熟悉了不少,删除的 x 键及插入按键也记牢了。
相关信息:
以下内容中,不特别说明的,一般都是在命令模式下进行。以下是补充常用键,我最近比较常用:
- n 键。输入 / 查找匹配,在高光显示查找结果时,按 n 可跳至附近查找,再按则跳至下一个结果。相当于跳到下一个;
- u 键。错误删除时可能想返回操作,不建议使用 “Ctrl+z”,在命令模式下按 u 可撤消操作,意思是 undo;
- :help N。N为help的关键字,不加也可以,用以显示帮助。这时候页面内容会切换,退出时:q;
接下来是新的内容:
- yy 键。拷贝当前行到剪切板(相当于 Ctrl+C);
- dd 键。x 升级版,删除当前行,并且把内容拷到剪切板中(相当于 Ctrl+X);
- p 键。copy,将当前剪切板中的内容复制到当前位置(相当 Ctrl+V);
- o 键。小写 o 在当前位置后插入一行;
- O 键。大写 O 在当前位置前插入一行;
- gg 键。小写2个g,把光标移支文档首行位置;
- G 键。大写G,把光标称到文档尾行位置;
任务帖:
- 每一行后插入一行,内容为该行的第一个单词;
- 每一行前插入一行,内容为该行的第一个单词;
- 第一段的位置和第二段的位置对调(一行一行来);
- 第一段和最后一段位置对调;
- 第三段后复制第二段的内容;
- 最后一段后再复制最后一段内容;
附:
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 -----------
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.
Q:按小 o 之后,有时候光标并不是停留在下一行的行首,而是靠后的位置?