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. c++ stl algorithm: std::fill, std::fill_n

    std::fill 在[first, last)范围内填充值 #include <iostream> #include <vector> #include <algori ...

  2. 组件-------(一)redis系列--安装部署redis+实现redis分布式缓存 java+Spring+redis

    目的:解决单机session不能共享问题,插入查询数据库时间效率问题,实现分布式缓存. 准备材料:Redis 下载链接 http://pan.baidu.com/s/1dEGTxvV 相关jar包如果 ...

  3. hdu1081(最大子矩阵)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1081 分析:a[i][j]代表第i行,前j个数据的和:那么由a[i][j]可得sum[k][long] ...

  4. SE 2014年4月22日(一)

    实验 练习: 如图配置: 两自治系统 AS 100  和 AS 200 AS 100 是由两私有自治系统 (AS 65001 和 AS 65002)构成 要求配置BGP联盟 使得 R3 R4 R5 下 ...

  5. 单点更新线段树 RMQ

    D. Xenia and Bit Operations time limit per test 2 seconds memory limit per test 256 megabytes input ...

  6. 逆向 Framework.jar

    Ref:http://www.addictivetips.com/mobile/what-is-odex-and-deodex-in-android-complete-guide/ Ref:http: ...

  7. HDU 5066 Harry And Physical Teacher(物理题)

    HDU 5066 Harry And Physical Teacher 思路:利用物理里面的动量守恒公式.因为保证小车质量远大于小球.所以能够把小车质量当成无穷大带进去,得到答案为2 * v0 - v ...

  8. ubuntu14.04中 gedit 凝视能显示中文,而source insight中显示为乱码的解决的方法

    1.乱码显示情况: watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcjc3NjgzOTYy/font/5a6L5L2T/fontsize/400/fill/ ...

  9. java导入excel

    package com.duosen.gate.test; import java.io.File; import java.io.FileInputStream; import java.io.Fi ...

  10. WPF实现无窗体鼠标跟随

    原文:WPF实现无窗体鼠标跟随 上次的弹力模拟动画实现后,我觉得可以把这个弄得更好玩一些,我们可以让小球实时跟随着鼠标,并且还可以让窗口完全消失,让小球在桌面上飞来飞去. 这只需要一些简单的修改就可以 ...