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. jQuery 复制节点的元素实现加入到购物车功能

    描写叙述: 用户点击左边div中的商品,相应商品会自己主动加入到右面的div中,类似电子商城中的加入到购物车功能. 主要用到了jquery中的复制节点功能,基本原理是首先获取点击的元素,然后将对应信息 ...

  2. hdu2861(递推)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2861 题意:n个板凳有m个人坐,求刚好将序列分成k段的方式. 分析: a[n][m][k]=a[n-1 ...

  3. Codeforces Round #254 (Div. 1)-A,B

    A:选取两点一边就能够了,非常明显能够想出来... 可是一開始看错题了,sad.... #include<stdio.h> #include<string.h> #includ ...

  4. Android模拟器设置竖屏

    使用Android模拟器測试自己开发的程序时,有时候会发现屏幕为横屏显示,查看效果非常不方便. 这里记录了一种禁止横屏的方法. 在文件  Mainfest.xml 中,在须要禁止横屏的 activit ...

  5. SQLServer2012 分页语句执行分析

    上一篇文章提到了,SQLServer2012在使用Offset,Fetch语句分页时,获取了大量不需要的数据,导致查询效率低的问题. 现在让我们来看看,究竟是什么导致SQLServer不能按需取数呢? ...

  6. JS经常使用正則表達式【分享】

    工作中JS经常使用表达式: 1)2010-09-10类型日期校验 2)推断正整数.字符串长度 3)校验长度,和是否空 4)推断字符串是否为空 5)比較字符大小 6)推断字符串长度 7)推断格式是否为E ...

  7. linux下mysql数据的导出和导入

    导出整个数据库中的全部数据 1.在linux命令行下输入: mysqldump -u userName -p dabaseName > fileName.sql fileName.sql最好加上 ...

  8. hdu5618 (三维偏序,cdq分治)

    给定空间中的n个点,问每个点有多少个点小于等于自己. 先来分析简单的二维的情况,那么只要将x坐标排序,那么这样的问题就可以划分为两个子问题,,这样的分治有一个特点,即前一个子问题的解决是独立的,而后一 ...

  9. cocos2d-x 精灵的创建和基本使用

    在cocos2d-x中.精灵能够说是一个最重要的组成元素,它代表游戏中一个最小的可见单位.同一时候也是CCNode一个最为灵活的子类,由于它能够通过装载一个平面纹理,从而具有丰富的表现力. 在进一步说 ...

  10. Unix/Linux周边环境C编程新手教程(1) Solaris 11 64bit环境结构

    Unix/Linux许多的版本号.我们推荐Unix/Linux刚開始学习的人选用几款典型的Unix/Linux操作系统进行学习. 本文就带大家来安装Solaris 11 64位而且配置好C/C++开发 ...