O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Scripting Vim

Video Description

Vim is a great editor, but it’s certainly not perfect. Even though it has a huge range of built-in tools and commands, it’s always missing one or two crucial features. Unfortunately, which crucial features are missing—and how they should be provided—is different for just about every single Vim user. Fortunately, Vim provides a way for every single Vim user to modify, enhance, and extend Vim to suit themselves via its built-in scripting language. Developers are only as good as their tools and the most fundamental tool developers have is their editor. Designed for the advanced beginner- to intermediate-level developer with some Vim scripting experience, this course teaches you how to script Vim to make it much more powerful and vastly easier to use.

  • Understand the features and syntax of Vim’s built-in scripting language
  • Learn to connect your scripts into Vim’s interface via abbreviations, maps, and auto commands
  • Survey the limitations and pitfalls of the Vimscript language and learn to avoid them
  • Master the ability to use the Vimscript debugger
  • Review dozens of the most useful built-in functions Vim provides
  • Understand how to implement your own Vim functions
  • See how Vim is scripted in other scripting languages, so you can reuse functions you’ve invented

Dr. Damian Conway is a widely sought-after speaker, trainer, and author. He runs Thoughtstream, an international IT training company serving clients throughout Australasia, North America, and Europe; he designed the regex mechanism for Perl 6; and he's written multiple O'Reilly titles, including Modern Perl Best Practices and Mastering Vim.

Table of Contents

  1. Extending Vim Without Coding
    1. Introduction 00:03:10
    2. Abbreviations 00:09:10
    3. Restrictions on the LHS 00:02:17
    4. Expanding Abbreviations 00:01:47
    5. Reviewing Your Abbreviations 00:01:21
    6. Targeted Abbreviations 00:03:12
    7. Computed Abbreviations 00:05:30
    8. Maps 00:01:11
    9. Insertion Maps 00:06:09
    10. Normal Maps 00:06:24
    11. Command-Line Maps 00:02:05
    12. Other Kinds of Maps 00:01:14
    13. Unremappable Maps 00:06:06
  2. The VimScript Language
    1. Vim Scripting Basics 00:07:14
    2. Running Vim Scripts 00:07:22
    3. Statements 00:02:44
    4. Values 00:03:29
    5. Comments 00:03:12
    6. Variables 00:12:16
    7. Expressions 00:08:47
    8. Control Structures 00:06:31
    9. Built-In Functions 00:01:47
    10. String Functions 00:10:20
    11. Pattern Matching and Transformation 00:07:48
    12. Input and Output Functions 00:07:42
    13. Buffer Interaction Functions 00:06:19
    14. Cursor Control Functions 00:09:49
    15. System and Filesystem Functions 00:12:52
    16. Code Execution Functions 00:03:04
  3. Data Structures in VimScript
    1. Lists 00:01:20
    2. List Creation and Access 00:02:58
    3. Sublists 00:01:46
    4. Nested Lists 00:01:35
    5. List Assignment 00:05:29
    6. Sublist Assignment 00:01:22
    7. List Identity 00:04:31
    8. List Unpacking 00:04:47
    9. Other List-Related Functions 00:07:04
    10. Other List-Related Procedures 00:19:06
    11. Dictionaries 00:03:06
    12. Accessing Dictionary Entries 00:04:56
    13. List-Processing of Dictionaries 00:05:00
    14. Assignments and Identities 00:01:44
    15. Additions and Subtractions 00:05:40
    16. Other Dictionary-Related Functions 00:03:41
    17. How to Use Dictionaries 00:05:28
  4. Scripting Vim
    1. User-Defined Functions 00:16:48
    2. Functions and Maps 00:05:04
    3. Variadic Argument Lists 00:08:10
    4. Function References 00:06:24
    5. A Useful Example 00:07:44
    6. Another Useful Example 00:18:30
    7. Exceptions 00:06:24
    8. Debugging 00:14:37
    9. Autocommands 00:11:32
    10. A Skeletal Example 00:05:40
    11. Timeouts 00:02:34
    12. Tidying Your Files 00:01:12
    13. Removing Autocommands 00:03:18
    14. Autocommand Groups 00:12:17
    15. Using Embedded Languages 00:00:36
    16. Perl 00:03:38
    17. Perl API 00:03:10
    18. Filtering with Perl 00:03:18
    19. Python 00:03:11
    20. Python API 00:04:27
    21. Python 3 00:01:40
    22. Other Languages 00:01:17
    23. Conclusion 00:03:51