Using the Vim plugin for Python

In this article, you'll learn how to access all the features the Vim plugin has to offer for Python.


The only prerequisites are that you have Kite Engine running and the Vim plugin installed. If you don't have the Vim plugin installed, you can learn how to do so here.

Note: If you installed the Vim plugin while Vim was running, you'll need to restart Vim for the plugin to activate.

Checking the Status of Kite

To check if Kite is installed properly, add %{kite#statusline()} to your Vim status line. If you don't have a Vim status line, you can try the following:

set statusline=%<%f\ %h%m%r%{kite#statusline()}%=%-14.(%l,%c%V%)\ %P
set laststatus=2  " always display the status line

If Kite is installed properly, you should see a Kite status message.

There are a handful of possible states Kite can be in, as described in the following table:

Message Description
Kite: Not Installed Kite Engine is not installed.
Kite: Not running Kite Engine is not running.
Kite: Indexing The Kite Engine is analyzing your code.
Kite: Ready Kite is ready to go — start coding!
No message This typically means that you are coding in an unsaved file or a filetype not yet supported by Kite.
Note: If you're running Kite for the first time, it may take several minutes for Kite to finish syncing and indexing your codebase.

Writing code and Accessing Features

In the following sections, the $ character indicates the position of your editor's text cursor.

Before we start...

Your experience with the Vim plugin will be highly dependent on its settings, particularly if you've configured completeopt previously. Please view the to make sure your plugin is configured properly before continuing.


To start, open a Python file in a whitelisted directory. Make sure that this file has been saved with a .py extension. Now type the following code:

import j$

A list of suggested completions should automatically appear.

Kite can provide completions for Python keywords, name expressions or attribute expressions. The example above illustrates a name expression completion. An example of an attribute completion would be:

import json

In the case of name and attribute completions, Kite will also provide the type of value represented by the completion e.g. module or function.

Function signatures

Continuing with the example code above, complete the function call to by typing the opening and closing parentheses.

import json

Kite should show you information about how to call json.dumps.

The top half of the UI shows the arguments that the function accepts. Arguments with default values will also have their default values shown.

As you type, Kite will stay in-sync with your cursor and highlight which argument you are currently focused on.

The “How others used this” section in the bottom half of the UI shows you common ways other programmers use the function json.dumps. Kite learns these calling patterns by analyzing all the open source code available on GitHub and then ranks them from most popular to least popular. If you are calling a function that you have defined locally, Kite will extract patterns from your codebase directly instead of GitHub.

Note: The "How others used this" section is hidden by default. Use the command KiteShowPopularPatterns to show the section, and KiteHidePopularPatterns to hide it.
Note: You can also use <C-x> <C-u> while in insert mode to display the function signature information.

Kite Pro completions

If you have upgraded to Kite Pro, Kite may suggest completions that can complete multiple words at once. For example, Kite can provide snippets for calling functions. When a snippet is selected, you will be able to cycle through the arguments with the tab key and make the necessary changes.

Kite can also suggest completions for generic code structure, such as control structures and variable assignments, to name a few.

You can learn more about Kite Pro here.

Viewing documentation

Kite can also quickly retrieve documentation for the code you are working with. Position your cursor over an identifier and press K in normal mode to open the documentation in the Copilot. If K is already mapped, you can set an alternative mapping (e.g. gK) with the following command:

nmap <silent> <buffer> gK <Plug>(kite-docs)

You may also run the KiteDocsAtCursor command to view the documentation.

When triggered, the documentation shows up in the Copilot.