Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Mastering Vim
  • Table Of Contents Toc
Mastering Vim

Mastering Vim - Second Edition

By : Osipov
5 (1)
close
close
Mastering Vim

Mastering Vim

5 (1)
By: Osipov

Overview of this book

Discover what makes Vim one of the most popular text editors in the world, renowned for its blend of efficiency, customization, extensibility, and portability. With Mastering Vim, you’ll come to appreciate its extensive plugin system and seamless integration with various tools, which enable Vim to provide developers with an extensible and customizable development environment for programmers. This comprehensive guide to Vim will help you become more efficient at editing text: be it prose or code. Starting from the basics, advanced movement, and text operations, you’ll learn how Vim can be used as a full-fledged IDE. You’ll then progress to refactoring, debugging, building, testing, version control, plugins, and Vimscript through practical guidance. This second edition comes packed with fully revamped examples that are both engaging and easy to understand, complemented by drawings and diagrams that help to visualize the concepts covered in the book. Updated to cover Vim 9, this edition includes updated installation and troubleshooting instructions, along with examples in Vim9script. By the end of this Vim book, you’ll be well-versed in Vim and have the skills you need to build a complete application using this popular text editor.
Table of Contents (11 chapters)
close
close

Resolving conflicts with vimdiff

Often, during development, you’ll find yourself needing to compare some files—be it comparing different output or versions of a file, or dealing with merge conflicts as multiple developers collaborate on a single file. Vim provides vimdiff, a standalone binary that excels at file comparison operations.

Comparing two files

Using vimdiff to compare two files is fairly simple. Let’s look at two files in spam/kitchen/: kitchen/bacon.py and kitchen/egg.py. We’d like to know what’s different between the two.

Code location

The files from this example are available from https://github.com/PacktPublishing/Mastering-Vim-Second-Edition/tree/main/Chapter05/spam.

Open the files with vimdiff:

$ vimdiff kitchen/bacon.py kitchen/egg.py

You will be greeted by the following screen (how colorful the screen is will depend on your colorscheme):

Figure 5.13 – The vimdiff window shows the differences between kitchen/bacon.py and kitchen/egg.py.

Figure 5.13 – The vimdiff window shows...

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Mastering Vim
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon