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. Android 布局之LinearLayout 子控件weight权重的作用详析(转)

    关于Android开发中的LinearLayout子控件权重android:layout_weigh参数的作用,网上关于其用法有两种截然相反说法: 说法一:值越大,重要性越高,所占用的空间越大: 说法 ...

  2. 在Laravel中一步一步创建Packages

    首先要看一下Laravel官方文档,这是最新4.2的文档,假设想看中文的话点击此处,基本一样.这个github上的库setup-laravel4-package,也是一步一步介绍怎样创建一个包.并关联 ...

  3. SPARK如何使用AKKA实现进程、节点通信

    SPARK如何使用AKKA实现进程.节点通信 <深入理解Spark:核心思想与源码分析>一书前言的内容请看链接<深入理解SPARK:核心思想与源码分析>一书正式出版上市 < ...

  4. 【译】ASP.NET MVC 5 教程 - 4:添加模型

    原文:[译]ASP.NET MVC 5 教程 - 4:添加模型 在本节中,我们将添加一些管理电影数据库的类,这些类在ASP.NET MVC 应用程序中扮演“Model”的角色. 我们将使用.NET F ...

  5. Python倒计时器(转)

    # Countdown using Tkinter from Tkinter import * import time import tkMessageBox class App: def __ini ...

  6. Tomcat6 Session建立机制简要

    底:  测试部门做压力测试, 结果没多久新闻,出现OutOfMemory. 查找原因,通过监视工具,查找StandardSession(org.apache.catalina.session.Stan ...

  7. 《JavaScript设计模式与开发实践》读书笔记之享元模式

    1. 享元模式 享元模式是一种用于性能优化的模式,享元模式的核心是运用共享技术来有效支持大量细粒度的对象 1.1 传统的文件上传方法 以文件上传为例,文件上传功能可以选择依照队列,一个一个的排队上传, ...

  8. PB数据库相关

    ---------------------------------------------------------------- 数据库画板: 一张表定义了主键或者唯一索引,则能够在Results视窗 ...

  9. 内网port映射具体解释(花生壳)

    关于怎样建立服务器的解答. 一.花生壳的作用 首先,我们先来了解一下花生壳的究竟有什么作用.由于ADSL每次拨号上网所获得的IP地址每次都是不同的,花生壳起到的作用就是方便用户訪问我们的server( ...

  10. vim ---- 自己主动的按钮indent该命令

    当使用vim一段代码的副本到一个程序时,有,经常indent会有一些问题. . 下面的这个强大的命令,使您可以一键码具有很好的格式. gg=G 样品: