vi笔记3——vi之快速移动
来源:互联网 发布:in Linux system 编辑:程序博客网 时间:2024/06/11 19:27
vi笔记3——vi之快速移动
VI快速移动主要包含以下内容:
This chapter covers:
• Movement by screens
• Movement by text blocks
• Movement by searches for patterns
• Movement by line number
^F --Scroll forward one screen.^B --Scroll backward one screen.^D --Scroll forward half screen (down).^U --Scroll backward half screen (up).^E --scroll the screen up one line ^Y --scroll the screen down one line (^Y).(In this list of commands, the ^ symbol represents the CTRL key. So ^F means to hold down the CTRL key and press the f key simultaneously.)^L --Redrawing the Screen,When system messages appear on your screen, you need to redisplay, or redraw, the screen.Movement Within a ScreenH --Move to home—the top line on screen.M --Move to middle line on screen.L --Move to last line on screen.nH --Move to n lines below top line.nL --Move to n lines above last line.Movement by LineENTER --Move to first character of next line.+ --Move to first character of next line.- --Move to first character of previous line.Movement on the current lineDon’t forget that h and l move the cursor to the left and right, and that 0 (zero) and $ move the cursor to the beginning or end of the line. You can also use:^ --Move to first nonblank character of current line.n| --Move to column n of current linez ENTER --Move current line to top of screen and scroll.z. --Move current line to center of screen and scroll.z- -- Move current line to bottom of screen and scroll.Movement by Text BlocksYou have already learned to move forward and backward by word (w, W, b or B).e --Move to end of word.E --Move to end of word (ignore punctuation).( --Move to beginning of current sentence.) --Move to beginning of next sentence.{ --Move to beginning of current paragraph.} --Move to beginning of next paragraph.[[ --Move to beginning of current section.(如果文件只有一节,就跳到文件第一行)]] --Move to beginning of next section.(如果文件只有一节,就跳到文件最后一行)Movement by Searches?searchContent -- search backward,/searchContent -- search forward,n --Repeat search in same direction.(当使用/ 或者?后使用n可以依次跳转到相应的查询目标上面去)N --Repeat search in opposite direction./ ENTER --Repeat search forward.equal to /? ENTER --Repeat search backward.equal to ?Sometimes you want to find a word only if it is further ahead; you don’t want the search to wrap around earlier in the file. vi has an option, wrapscan, that controls whether searches wrap. You can disable wrapping like this::set nowrapscanWhen nowrapscan is set and a forward search fails, the status line displays the message:Address search hit BOTTOM without matching patternWhen nowrapscan is set and a backward search fails, the message displays “TOP”instead of “BOTTOM.”Current Line Searchesfx --Find (move cursor to) next occurrence of x in the line, where x stands for anycharacter.Fx --Find (move cursor to) previous occurrence of x in the line.tx --Find (move cursor to) character before next occurrence of x in the line.Tx --Find (move cursor to) character after previous occurrence of x in the line.; --Repeat previous find command in same direction., --Repeat previous find command in opposite direction.dfx --deletes up to and including the named character x. yfx --yanks up to and including the named character x.^G --显示当前行数,总行数,当前百分比;但是本人使用windows的vim和ubuntu1604的vim时候只显示了总行数和百分比nGG --move to number nG --move to the last number of the file'' --两个单引号,返回到最后一次使用G的位置ExamplesRemember that you can combine numbers with movement. For example, 3) moves ahead three sentences. Also remember that you can edit using movement commands: d) deletes to the end of the current sentence, 2y} copies (yanks) two paragraphs ahead.Review of vi Motion CommandsTable 3-1. Movement commandsMovement CommandScroll forward one Screen ^FScroll backward one screen ^BScroll forward half screen ^DScroll backward half screen ^UScroll forward one line ^EScroll backward one line ^YMove current line to top of screen and scroll z ENTERMove current line to center of screen and scroll z.Move current line to bottom of screen and scroll zRedraw the screen ^LMove to home—the top line of screen HMove to middle line of screen MMove to bottom line of Screen LMove to first character of next line ENTERMove to first character of next line +Move to first character of previous line -Move to first nonblank character of current line ^Move to column n of current line n|Move to end of word eMove to end of word (ignore punctuation) EMove to beginning of current sentence (Move to beginning of next sentence )Move to beginning of current paragraph {Move to beginning of next paragraph }Move to beginning of current section [[Move to beginning of next section ]]Search forward for pattern /patternSearch backward for pattern ?patternRepeat last search nRepeat last search in opposite direction NRepeat last search forward /Repeat last search backward ?Move to next occurrence of x in current line fxMove to previous occurrence of x in current line FxMove to just before next occurrence of x in current line txMove to just after previous occurrence of x in current line TxRepeat previous find command in same direction ;Repeat previous find command in opposite direction ,Go to given line n nGGo to end of file GReturn to previous mark or context ``Return to beginning of line containing previous mark ''Show current line (not a movement command) ^G
以上是学习vim时候整理的一些要点,分享此处以供学习!
对于一些想深入学习vi的人群,可以参考以下图书:Learning.the.vi.and.Vim.Editors.7th
下载链接:http://download.csdn.net/detail/u011127242/9617946 0 0
- vi笔记3——vi之快速移动
- Vi 技巧之:快速移动
- Vi 技巧之:快速移动
- 学习vi编辑器 —— 快速移动
- vi 快速移动光标
- vi笔记2——vi之简单编辑
- vi笔记4——vi之超越基础
- vi笔记1——vi之配置一个强大的vi/vim
- 学习笔记之使用vi之移动光标(二)
- vi笔记附录1——vi之配置一个强大的c语言、python IED
- VI 之快速查找定位
- 学习vi和vim编辑器——第三章 快速移动位置
- Linux学习笔记——vi/vim编辑器命令快速入门
- vi光标移动命令之二
- linux学习笔记——vi
- vi笔记
- vi笔记
- vi笔记
- Java大牛养成记(11)----Struts 2 & Struts 1
- 实现顺序栈各种基本运算算法
- JavaScript中的window.parent ,window.top,window.self 等等
- 删除字符串中相邻三个或以上重复的字符
- Java 第12章典型例子
- vi笔记3——vi之快速移动
- ros by example2 学习过程记录-0
- printf相关函数详解
- 将Logger的数据导入到数据库详解
- [Linux驱动入门]进程管理
- Java 第13章典型例子(石头剪刀布)
- Redis基础
- const的常见使用说明,用法
- C++ string类和字符串的访问和拼接操作