Lab 9 Using vim

Sequence 1: Navigating with vim

1. Log in as user student

2. [student@stationX ~]$ cp /etc/passwd ~

3. [student@stationX ~]$ vim ~/passwd

4. First, try moving around using such as the arrows, PgUp, PgDn.
They should all work as expected. Note, however, that on older systems they might
not.

5. moving from word to word with the w and b keys.
moving by sentence (the parentheses) and paragraph (the curly braces)

6. Try combining numbers with movement keys.
5w
2Down Arrow

7. Press the i key.
The arrow keys, Home and End still move your cursor

8. Exit insert mode by pressing Esc.

9. Try pressing the u key. This will undo each change that you made. Changes can be re-done
with Ctrl-r

10. The ex mode is invoked by typing : while in command mode.

11. At the ex prompt (:) enter set nu.

12. Try entering ex mode again and typing :set nonu.

13. Try jumping to line 5 by typing 5G.
G to the end
1G to the first line

14. search feature: /root.
press n and N to navigate.

15. :set nohls.
      :set hls.

16. Try running :q. :q!

Sequence 2: Configuring vim

1. [student@stationX ~]$ vim ~/.vimrc
:set nu
:set wrapmargin=10

2. [student@stationX ~]$vim /etc/passwd again.

Sequence 3: Configuring basic sudo privileges with vim

1. [student@stationX ~]$ su -

2. [root@stationX ~]# visudo

3. /root
The line appears about halfway down the file and looks like this:
root ALL=(ALL) ALL

4. yyp
yy "yanks" (copies) the current line and p "pastes" it one line down.

5. cw studen Esc.

6. w cw stationX
The line should now read:
student stationX=(ALL) ALL

7. Exit insert mode by pressing Esc. :wq

8. [student@stationX ~]$ ls /etc/pki/CA
ls: /etc/pki/CA: Permission denied

[student@stationX ~]$ sudo ls /etc/pki/CA
Password:
private

9. sudo will remember that you have already authenticated for five minutes before prompting you
again.

Challenge Sequence 4: Learning more with vimtutor

1. [student@stationX ~]$ vimtutor

RH033读书笔记(8)-Lab 9 Using vim的更多相关文章

  1. RH033读书笔记(15)-Lab 16 The Linux Filesystem

    Lab 16 The Linux Filesystem Goal: Develop a better understanding of Linux filesystem essentials incl ...

  2. RH033读书笔记(10)-Lab 11 Process Control

    Lab 11 Process Control Sequence 1: Job Control 1. [student@stationX ~]$ su - 2. Begin some jobs in t ...

  3. RH033读书笔记(2)-Lab 3 Getting Help with Commands

    Lab 3 Getting Help with Commands Sequence 1: Using the Help Tools 1. man -f keyword whatis keyword l ...

  4. RH033读书笔记(5)-Lab 6 Exploring the Bash Shell

    Lab 6 Exploring the Bash Shell Sequence 1: Directory and file organization 1. Log in as user student ...

  5. RH033读书笔记(4)-Lab 5 File Permissions

    Lab 5 File Permissions Sequence 1: Determining File Permissions 1. What is the symbolic representati ...

  6. RH033读书笔记(3)-Lab 4 Browsing the Filesystem

    Lab 4 Browsing the Filesystem Sequence 1: Directory and File Organization 1. Log in as user student ...

  7. RH033读书笔记(7)-Lab 8 Introduction to String Processing

    Lab 8 Introduction to String Processing Sequence 1: Exercises in string processing 1. Other than the ...

  8. RH033读书笔记(6)-Lab 7 Standard I/O and Pipes

    Lab 7 Standard I/O and Pipes 1. [student@stationX ~]$ cat /proc/cpuinfo /proc/meminfo 2. [student@st ...

  9. RH033读书笔记(11)-Lab 12 Configuring the bash Shell

    Sequence 1: Configuring the bash Shell Deliverable: A system with new aliases that clear the screen, ...

随机推荐

  1. Libevent使用样例,从简单到复杂

            转载请注明出处:http://blog.csdn.net/luotuo44/article/details/39670221 本文从简单到复杂.展示怎样使用libevent.网上的很多 ...

  2. [置顶] Android常用适配器控件

    Android常用适配器控件 列表控件用于显示数据集合,Android不是使用一种类型的控件管理显示和数据,而是将这两项功能分布用列表控件和适配器来实现.列表控件扩展了android.widget.A ...

  3. SE 2014年4月22日(二)

    如图配置: 网络中存在三个公有AS 其中AS200使用了 BGP联盟技术(如图配置) 在AS 100 中R1上起源了四条BGP路由,(1)要求全网BGP设备均能够正常学习 (2)要求:(使用BGP团体 ...

  4. 【Unity Shaders】使用CgInclude让你的Shader模块化——Unity内置的CgInclude文件

    本系列主要參考<Unity Shaders and Effects Cookbook>一书(感谢原书作者),同一时候会加上一点个人理解或拓展. 这里是本书全部的插图. 这里是本书所需的代码 ...

  5. Unity3D开发一个2D横版射击游戏

    教程基于http://pixelnest.io/tutorials/2d-game-unity/ , 这个例子感觉还是比较经典的, 网上转载的也比较多. 刚好最近也在学习U3D, 做的过程中自己又修改 ...

  6. C#实现仿QQ震动

    前提:新建winForm窗体应用程序,放置一个Button,设置按钮的单击事件 ; i < ; i++) { Point p = this.FindForm().Location; ,p.Y+) ...

  7. mybatis配置文件xxxx.xml中缺失返回类型的后果A query was run and no Result Maps were found

    使用mybatis时出现异常问题: 有如下的错误 Error querying database.  Cause: org.apache.ibatis.executor.ExecutorExcepti ...

  8. 设置 zend studio 默认编码为UTF8

    今天用zend studio 打开文件时发现为乱码,这肯定是编码出了问题,我看了一下果然是编码出了问题,默认的是以GBK编码方式打开,我换utf8编码打开就好了,换编码打开的方法是: 1点击工具栏中的 ...

  9. Wooden Sticks(杭州电1051)

    Wooden Sticks Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) To ...

  10. Cocos2d-x学习笔记(1)

    Cocos2d-x原型Cocos2d,基于Cocos2d-iPhone,跨平台. Hello Workd分析: 1."resource"目录 该目录主要用于存放游戏中须要的图片.音 ...