This is a guide to Vim Script development for Python developers. Sample code for the various expressions, statements, functions and programming constructs is shown in both Python and Vim Script. This is not intended to be a tutorial for developing Vim scripts. It is assumed that the reader is familiar with Python programming.
For an introduction to Vim Script development, refer to usr_41.txt, eval.txt and Learn Vimscript the Hard Way
For a guide similar to this one for JavaScript developers, refer to Vim Script for the JavaScripter
This guide only describes the programming constructs that are present in both Python and Vim. The constructs that are unique to Vim (e.g. autocommands, [key-mapping](https://vimhelp.org/map.txt.html#key-m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I use the below described development process and tools for developing Vim features. | |
I use a Ubuntu system for most of the development. But the tools mentioned below | |
are also available on MacOS. | |
1. Clone the Vim source code from https://github.com/vim/vim.git. | |
2. Modify src/Makefile to enable additional compiler diagnostics: | |
CFLAGS=-Wall -Wextra -pedantic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vim has many plugins (vim-go, ale, etc.) that use the quickfix/location list | |
feature. Some of these plugins process the output of an external command and | |
update the quickfix list asynchronously as the output becomes available. | |
Updating a quickfix or location list asynchronously opens up the possibility | |
that two or more plugins may try to update the same quickfix list with | |
different output. Also when a plugin is updating a quickfix list in the | |
background, the user may issue a command that creates or updates a quickfix | |
list. The plugin may then incorrectly use this new list to add the entries. |