Advanced Editing with Vim

30 minutes
  • 2 Learning Objectives

About this Hands-on Lab

The Vim editor is extremely capable and has many features that merit attention, chiefly to enhance the productivity of its users. While there are alternatives in the open and proprietary worlds, it’s still the most-shipped and included editor in the world of Unix and Linux. In this lab, we’ll use more advanced features of the editor, including additional search and replacement of text, as well as a visual mode that allows multi-dimensional selection of lines, text, and columns. We’ll also learn about the use of Vim windows, how to split the display into windows, and navigate and configure them to suit your style. Additionally, we’ll get an awareness of the `diff` command, how diff mode is incorporated into Vim, how to invoke it to resolve changes between files, and how to use vimdiff mode, as well as how to learn even more about Vim.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Use the Vim Editor for Advanced Search/Replace, Select Items Visually, and Use and Navigate Windows
  1. Use the Vim editor to do advanced search and replace, including additional search options and searching in ranges of lines.
  2. Use Vim’s visual mode to select text, lines, and columns that cannot be selected elsewhere, enabling new dimensions of editing files.
  3. Use vim’s windows functions to open, navigate between, and edit multiple files, as well as multiple versions of the same file.
Use Vim’s diff Mode to Display, Compare, and Resolve Differences Between Files
  1. Use Vim’s diff mode to display two or more files in a side-by-side comparison, highlighting differences clearly.
  2. Compare differences between files, and resolve them in a bi-directional or unidirectional manner.
  3. Enable and disable the diff mode on demand from within the editor or use the vimdiff command to separately invoke the function.

Additional Resources

Log in via SSH to the lab server using the credentials provided:

ssh cloud_user@<PUBLIC IP ADDRESS

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?