Book Image

CentOS System Administration Essentials

Book Image

CentOS System Administration Essentials

Overview of this book

Table of Contents (18 chapters)
CentOS System Administration Essentials
About the Author
About the Reviewers

Chapter 1. Taming vi

You may have some experience with vi, or what is now known as Vim (which is when simply put—vi improved). All too often, I find that those first experiences have never been good ones or to be looked back upon with much fondness. Guiding you through the initially unfathomable regime of vi, we are going to make sure that you are the master of vi and you leave wanting to use this tool from the gods. vi is like everything else in the sense that you just need to stick with it in the early days and keep practicing. Remember how you persevered for many hours riding your bicycle as a toddler and became a master, despite a few bruised knees? I want you to persevere with vi too. We will start with a little command-line magic to make the whole command-line interface (CLI) experience a better one. We will then be ready to start our black-belt experience in vi.

In this chapter, we will go through the following topics:

  • CLI trickery – shortcuts that you will love

  • Vim and vi: In this section, you will learn to differentiate between these twins and meet their graphical cousin

  • Getting the .vimrc setup the way you like

  • Search and replace: In this section, you will learn how to quickly find and replace text within files from both inside and outside Vim

  • Learning to remove extraneous comments from a file with a few deft key strokes