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.
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
- Use the Vim editor to do advanced search and replace, including additional search options and searching in ranges of lines.
- Use Vim’s visual mode to select text, lines, and columns that cannot be selected elsewhere, enabling new dimensions of editing files.
- 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
- Use Vim’s diff mode to display two or more files in a side-by-side comparison, highlighting differences clearly.
- Compare differences between files, and resolve them in a bi-directional or unidirectional manner.
- Enable and disable the diff mode on demand from within the editor or use the
vimdiffcommand to separately invoke the function.