RH033读书笔记(8)-Lab 9 Using vim
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的更多相关文章
- RH033读书笔记(15)-Lab 16 The Linux Filesystem
Lab 16 The Linux Filesystem Goal: Develop a better understanding of Linux filesystem essentials incl ...
- RH033读书笔记(10)-Lab 11 Process Control
Lab 11 Process Control Sequence 1: Job Control 1. [student@stationX ~]$ su - 2. Begin some jobs in t ...
- 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 ...
- 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 ...
- RH033读书笔记(4)-Lab 5 File Permissions
Lab 5 File Permissions Sequence 1: Determining File Permissions 1. What is the symbolic representati ...
- RH033读书笔记(3)-Lab 4 Browsing the Filesystem
Lab 4 Browsing the Filesystem Sequence 1: Directory and File Organization 1. Log in as user student ...
- RH033读书笔记(7)-Lab 8 Introduction to String Processing
Lab 8 Introduction to String Processing Sequence 1: Exercises in string processing 1. Other than the ...
- 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 ...
- RH033读书笔记(11)-Lab 12 Configuring the bash Shell
Sequence 1: Configuring the bash Shell Deliverable: A system with new aliases that clear the screen, ...
随机推荐
- 折扣&折让-看清实质的思考
折扣&折让 看清实质的思考 Author:zfive5(zidong) Email:zfive5@163.com 引子 有些东西,在没有人指点的情况,一时理解不了,就放一放,等到某一个契机到来 ...
- hdu4489(递推dp)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4489 题意:给一个n,求n个高矮不同的人排成一排使得高.矮依次排列的种数. 详细思路参考:http:/ ...
- TreeSet排序
TreeSet的排序能够通过两种方法来实现: 1.通过TreeSet(Comparator<? super E> comparator) 构造方法指定TreeSet的比較器进行排序. 2. ...
- APS.NET Cookie
Cookie 提供了一种在 Web 应用程序中存储用户特定信息(如历史记录或用户首选项)的方法. Cookie 是一小段文本.伴随着请求和响应在 Web server和client之间来回传输.Coo ...
- ZOJ3626(树形dp)
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4772 题意:给一棵有n个结点的树,每个点有点权表示在这个点上的价值, ...
- httpcomponents-client-4.4.x
Chapter 1. Fundamentals Prev Next Chapter 1. Fundamentals 1.1. Request execution The most essent ...
- Android获取SIM卡信息--TelephonyManager
1>获得TelephonyManager TelephonyManager telMgr = (TelephonyManager) getSystemService(TELEPHONY_SER ...
- 提高PHP编程效率的方法
用单引号代替双引号来包含字符串,这样做会更快一些.因为PHP会在双引号包围的字符串中搜寻变量,单引号则不会,注意:只有echo能这么做,它是一种可以把多个字符串当作参数的“函数”(译注:PHP手册中说 ...
- 【cocos2d-x制作别踩白块儿】第一期:游戏介绍
这一系类文章.我们将来分析时下最火的一款游戏 -- 别踩白块儿. 无图无真相,先上图 这就是我们终于要完毕项目的效果图. 游戏刚開始的最以下有一栏为黄色,紧接着上面每一行都是有一个黑色块,其余为白色块 ...
- abstract修饰方法总结
abstract这种方法修饰,主要用在抽象类和抽象方法. 抽象的类是不可实例化的比如 public abstract class Test{ } 他能够含有抽象的方法 public abstract ...