Book Image

Mastering Vim

By : Ruslan Osipov
Book Image

Mastering Vim

By: Ruslan Osipov

Overview of this book

Vim is a ubiquitous text editor that can be used for all programming languages. It has an extensive plugin system and integrates with many tools. Vim offers an extensible and customizable development environment for programmers, making it one of the most popular text editors in the world. Mastering Vim begins with explaining how the Vim editor will help you build applications efficiently. With the fundamentals of Vim, you will be taken through the Vim philosophy. As you make your way through the chapters, you will learn about advanced movement, text operations, and how Vim can be used as a Python (or any other language for that matter) IDE. The book will then cover essential tasks, such as refactoring, debugging, building, testing, and working with a version control system, as well as plugin configuration and management. In the concluding chapters, you will be introduced to additional mindset guidelines, learn to personalize your Vim experience, and go above and beyond with Vimscript. By the end of this book, you will be sufficiently confident to make Vim (or its fork, Neovim) your first choice when writing applications in Python and other programming languages.
Table of Contents (12 chapters)

What this book covers

Chapter 1, Getting Started, introduces the reader to basic concepts and the world of Vim.

Chapter 2, Advanced Editing and Navigation, covers movement and more complex editing operations, and introduces a number of plugins.

Chapter 3, Follow the Leader – Plugin Management, talks about modes, mappings, and managing your plugins.

Chapter 4, Understanding the Text, helps you interact with, and navigate, code bases in a semantically meaningful way.

Chapter 5, Build, Test, and Execute, explores options for running code in, or alongside, your editor.

Chapter 6, Refactoring Code with Regex and Macros, takes a deeper look at refactoring operations.

Chapter 7, Making Vim Your Own, discusses options available for further customizing your Vim experience.

Chapter 8, Transcending the Mundane with Vimscript, dives into the powerful scripting language Vim provides.

Chapter 9, Neovim, showcases one of Vim's younger siblings.

Chapter 10, Where to Go from Here, provides some farewell food for thought and points at a few places on the internet you might be interested in.

Download the example code files

The code bundle for the book is hosted on GitHub at https://github.com/PacktPublishing/Mastering-Vim. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

In addition, you can download the example code files for this book from your account at www.packt.com. If you purchased this book elsewhere, you can visit www.packt.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register at www.packt.com.
  2. Select the SUPPORT tab.
  3. Click on Code Downloads & Errata.
  4. Enter the name of the book in the Search box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR/7-Zip for Windows
  • Zipeg/iZip/UnRarX for Mac
  • 7-Zip/PeaZip for Linux

Conventions used

There are a number of text conventions used throughout this book.

CodeInTxt: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Mount the downloaded WebStorm-10*.dmg disk image file as another disk in your system."

A block of code is set as follows:

" Manage plugins with vim-plug.
call plug#begin()
call plug#end()

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

" Manage plugins with vim-plug.
call plug#begin()

Plug 'scrooloose/nerdtree'
Plug 'tpope/vim-vinegar'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'mileszs/ack.vim'
Plug 'easymotion/vim-easymotion'

call plug#end()

Any command-line input is written as follows:

$ cd ~/.vim
$ git init

Bold: Indicates a new term, an important word, or words that you see on screen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Select System info from the Administration panel."

Warnings or important notes appear like this.
Tips and tricks appear like this.