Skip to content

Instantly share code, notes, and snippets.

@yegappan
yegappan / VimScriptForPythonDevelopers.MD
Last active September 29, 2024 19:06
Vim script for Python Developers

Vim Script for Python Developers

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

@yegappan
yegappan / VimDevelopmentProcess
Last active April 19, 2022 00:15
My development process for contributing to Vim
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
@yegappan
yegappan / gist:3b50ec9ea86ad4511d3a213ee39f1ee0
Last active April 11, 2023 00:03
Updating a quickfix/location list asynchronously without interfering with another plugin
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.