Skip to main content

Text Editing with Vim (Vi iMproved)

Course

Intro Video

Photo of Ross Brunson

Ross Brunson

Linux Training Architect II

Length

08:43:29

Difficulty

Beginner

Videos

18

Hands-on Labs

8

Course Details

This course is a deep dive into the world of the Vim text editor.

It is made up of two parts:

The Vim Survival Kit - A single lesson that contains a condensed set of just the absolute basics of how to use Vim for your first few editing sessions Working with Vim - Expands on and goes a lot further than the Survival Kit, diving deeper into each of the foundational Vim areas, including advanced operations.

The two parts are designed to be taken separately or together, it's up to the attendee how they decide to consume the course.

Either way, the Training Architect has structured this course to give you the maximum Vim skills and experience in a compact amount of time, and had a great time creating it!

Enjoy!

Syllabus

Introduction

Course Introduction

Course Introduction

00:02:03

Lesson Description:

This short video introduces the course and describes how it's constructed in two parts: the Vim Survival Kit for those who need Vim skills and practice right away, and the Main Course, which is for those who want a more traditional full course on Vim, from beginner to advanced topics.

About the Training Architect

00:00:56

Lesson Description:

Your Training Architect is Ross Brunson, a longtime trainer, author and speaker at events. Ross lives in Southern Montana near Yellowstone. He enjoys winters sports (and it's a good thing he does!), hiking, and living in the mountains. Ross has been a Certification Architect for SUSE, a Sales Engineer for Novell, a Technical Instructor for Learning Tree, a sysadmin for many years, and much more. Ross also thinks he's a drummer, but not everyone agrees.

The Vim Editor

Vim Survival Kit

Vim Survival Kit

00:25:52

Lesson Description:

This is a new type of lesson that has been designed to be most helpful to those who are new to, or unfamiliar with, Vim. The tasks in the lesson are those most likely a new Vim user would encounter, be confused by, or to have difficulty accomplishing. If you watch this lesson, do the lab, and keep a copy of the Vim Survival Kit PDF by your side, you will make it successfully through your first few experiences with Vim! For those who want to go straight to a specific task, here are the start times for each of the eight tasks:2:42 Task 1 - Creating, Opening, and Exiting a File 5:28 Task 2 - Making a Simple Change to a File 7:56 Task 3 - Changing a System File 9:33 Task 4 - Simple Navigation 12:42 Task 5 - Inserting, Copying, and Deleting 16:07 Task 6 - Undoing and Redoing 17:04 Task 7 - Saving and/or Exiting 18:34 Task 8 - Resources for Getting HelpWe'll be very direct and terse in this lesson, so we can fit all the tasks in. For more of a conversational set of lessons on Vim topics, take the rest of the course and labs, it'll expand on your new knowledge and set you on a course to true Vim mastery!

Working with Vim

Introduction to Vim

00:07:57

Lesson Description:

In this lesson we'll introduce you to the Vim editor, where it came from, it's author, why it's important to have text editing skills in general and Vim skills in specific and lastly we'll introduce you to some fun things that are Vim-related.

Vim Modes

00:11:35

Lesson Description:

In this lesson we'll demystify the modes that Vim uses to do its work when you edit files with it. Not understanding how Vim's modes work can effectively stop you from using Vim to do anything useful! After you know what modes are and how they work, those same modes can make you incredibly productive!

Navigating in Vim

00:17:03

Lesson Description:

Vim offers so many ways to get around in editing sessions that it's staggering at times! We'll cover the basics, add some key advanced moving options, and ensure you know what's offered in what mode to get you where you want to be in your session.

Manipulating Text Part 1

00:19:48

Lesson Description:

Being able to properly and efficiently create, manipulate, and transform text in Vim is a critical skill. In this, Part 1 of the lesson, we'll start by covering the adding of text, move on to selecting it with Visual Mode, and then end with deleting words, lines, and characters.Note: This lesson is split into two parts due to its length, and to make sure you can fit at least one part and a lab during lunch!

Manipulating Text Part 2

00:15:31

Lesson Description:

In this, Part 2 of the lesson, we'll learn how to use undo and redo to your best advantage. We'll start with copying and pasting text, and end with altering/changing or transforming text.Note: This lesson is split into two parts due to its length, and to make sure you can fit at least one part and a lab during lunch!

Searching and Replacing Part 1

00:14:21

Lesson Description:

Editing a file is one thing, but knowing how to find what you need in existing files is quite another. Being able to search and replace to transform your files is the ultimate goal of being efficient, and all of this is possible in Vim. In this, Part 1 of the lesson, we'll cover simple string and character searches (forward and backward). Then we'll and transition into searching for whole words (at the beginning of strings, the end, and by their position in a line). Finally we will look at how to easily search for items without typing very long search terms.Note: This lesson is split into two parts due to its length, and to make sure you can fit at least one part and a lab during lunch!

Searching and Replacing Part 2

00:16:52

Lesson Description:

Editing a file is one thing, but knowing how to find what you need in existing files is quite another. Being able to search and replace to transform your files is the ultimate goal of being efficient, and all of this is possible in Vim. Part 2 of the lesson delves right into showing you all about the complex world of searching and replacing text in Vim. We'll use parameters to control what we are searching for, where it occurs, and whether we are prompted or not. Then we will look at how to do search and replace operations in ranges. The lesson finishes up with walking through how to repeat changes either inside Vim, or how to use a script and supporting files to make mass changes in many files.Note: This lesson is split into two parts due to its length, and to make sure you can fit at least one part and a lab during lunch!

External Commands via Vim Part 1

00:16:12

Lesson Description:

Vim is a very complete editing environment, but it can't do absolutely everything you'll need internally. Knowing how to use Vim and external commands and files to your best advantage is a great skill to have, both in terms of productivity and self esteem! In this, Part 1 of the lesson, we'll cover why you would want to use external commands with Vim, how to run simple commands to display information, using more complex methods to import external file content into Vim, how to have external commands act on buffer contents, and how to add to or replace buffer contents with external command output.Note: This lesson is split into two parts due to its length, and to make sure you can fit at least one part and a lab during lunch!

External Commands via Vim Part 2

00:13:12

Lesson Description:

Vim is a very complete editing environment, but it can't do absolutely everything you'll need internally. Knowing how to use Vim and external commands and files to your best advantage is a great skill to have, both in terms of productivity and self esteem! In this, Part 2 of the lesson, we'll continue with several Vim functions. We are going to look at writing Vim buffer content to disk (either overwriting or appending text to existing files), how to perform lookups in the man pages from within Vim, and lastly a really fun treatment of the macro recording function in Vim.Note: This lesson is split into two parts due to its length, and to make sure you can fit at least one part and a lab during lunch!

File and Buffer Operations

00:17:09

Lesson Description:

Knowing how to create, edit, write, save, and manage your files with Vim is critical knowledge. So is how to work with multiple files from within Vim, for efficiency. In this lesson, we'll cover how to create, edit, save and quit your files, including how to see what files/buffers you are editing, their status, and how to navigate between those open editing instances. We'll also cover what to do when Vim crashes, or a file gets corrupted. This is one of the most difficult situations for those new to Vim, or not familiar with how it handles crashes.

Advanced Operations in Vim

00:16:55

Lesson Description:

This lesson is large, it will be comprised of 3 parts, and cover a multitude of topics. In this, the first of 3 parts, we'll cover the concept of state management. We'll set, save, and restore the current session, or state (things like tabs, windows, views, etc.). Since Vim supports the concept of saving the current state to disk, once we set it and save it we can then reload it into other similar sessions to make switching projects or tasks easy. This means that once we get into a Vim session, we're ready to work, without having to set all of those things up again. We'll cover the creation, management and changing of sessions, as well as the .viminfo file which holds data about the configuration of Vim overall.

Advanced Operations in Vim Part 2

00:18:52

Lesson Description:

This lesson is large, it will be comprised of 3 parts, and cover a multitude of topics. In this, the second of 3 parts, we'll cover the topic of using windows in Vim for displaying multiple buffers in new and interesting ways on the same screen or tab page. We'll show how to do horizontal and vertical split windows, and how to navigate between windows using various key combinations and commands. We also cover how to resize the windows in all directions and how to place the windows in various positions related to other windows for maximum productivity. We'll finish up by showing how windows can be turned into tabs, and show an overview of how tabs, windows, and buffers all relate to each other.

Advanced Operations in Vim Part 3

00:18:05

Lesson Description:

This lesson is large, it will be comprised of 3 parts, and cover a multitude of topics. In this, the third of 3 parts, we'll look at the diff command-line tool and cover the concept of merging file differences. Then we will see how Vim has a Diff mode, with can be accessed either via vimdiff or from within Vim itself. We then look at how to compare two files and merge minor differences between the files, and how to change the window split configuration while you are doing it. Next we will cover the use of options, and how to set those options in the /etc/vimrc and ~/.vimrc files so that your Vim sessions will start with the proper configuration. Finally we will walk through how to place customized .vimrc files in a project directory to have that project's settings take preference.

Conclusion

Next Steps

Course Conclusion

00:04:28

Lesson Description:

In this short video we summarize the content for the course, the two main sections, the number of lessons and labs, highlights for each of the sections covered, and in general wrap up the presentation of content for the course.

What's Next

00:01:29

Lesson Description:

In this final video in the course, we'll show a couple of options for things to do next, from a fun plugin site, to a free Integrated Development Environment to check out, to the Training Architect's other courses people might be interested in.

Take this course and learn a new skill today.

Transform your learning with our all access plan.

Start 7-Day Free Trial