Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

The Kite plugin for Vim.

License

NotificationsYou must be signed in to change notification settings

kiteco/vim-plugin

Repository files navigation

Report an issue

Kite is an AI-powered programming assistant that helps you write Python code inside Vim. Kite helps you write code faster by showing you the right information at the right time. Learn more about how Kite helps you while you're using Vim athttps://kite.com/integrations/vim/.

At a high level, Kite provides you with:

Requirements

  • macOS 10.10+ or Windows 7+ or Linux (Ubuntu, Debian, Fedora, Arch Linux, Linux Mint, openSUSE, KDE, XFCE, Gnome 2, Gnome 3)
  • Vim 8 or Neovim
  • Kite Engine

Use another editor? Check outKite’s other editor integrations.

Installation

Installing the Kite Engine

TheKite Engine needs to be installed and running on your computer in order for the package to work properly. The package itself provides the frontend that interfaces with the Kite Engine, which performs all the code analysis and machine learning 100% locally on your computer (no code is sent to a cloud server).

macOS Instructions

  1. Download theinstaller and open the downloaded.dmg file.
  2. Drag the Kite icon into theApplications folder.
  3. RunKite.app to start the Kite Engine.

Windows Instructions

  1. Download theinstaller and run the downloaded.exe file.
  2. The installer should run the Kite Engine automatically after installation is complete.

Linux Instructions

  1. Visithttps://kite.com/linux/ to learn how to install Kite.
  2. The installer should run the Kite Engine automatically after installation is complete.

Installing the Kite plugin for Vim/Neovim

When running the Kite Engine for the first time, you'll be guided through a setup process which will allow you to install the Vim/Neovim plugin. You can also install or uninstall the Vim plugin at any time using the Kite Engine'splugin manager.

Once installed, the plugin will be automatically updated by Kite when necessary.

Configuring supported languages

Kite supports 12 languages and counting. By default only Python is enabled. You can configure the languages for which Kite is enabled:

" Python, JavaScript, Goletg:kite_supported_languages= ['python','javascript','go']" All the languages Kite supportsletg:kite_supported_languages= ['*']" Turn off Kiteletg:kite_supported_languages= []

Learn more about why Kite is the best autocomplete for Vim.

Features

Kite's Vim/Neovim plugin provides a number of features to help you code better and faster.

Line-of-Code Completions

Kite's ranked completions are integrated with Vim's insert-mode completion, specifically the user-defined completion. Kite shows normal completions or signature-completions as appropriate for the cursor position.

By default Kite's completions will show up automatically as you type. You can opt out via:

letg:kite_auto_complete=0

You can manually invoke the completions in insert mode with<C-X><C-U>. See:h i_CTRL-X_CTRL-U for details.

You can disable Kite's completions altogether with this in your vimrc:

letg:kite_completions=0

Kite's completions include snippets by default. To opt out of the snippets, add this to your vimrc:

letg:kite_snippets=0

Normally you insert the currently selected completion option with<C-y>. If you'd like to use<Tab> instead / as well, add this to your vimrc:

letg:kite_tab_complete=1

For any kind of completion you must set 'completopt' as follows:

setcompleteopt+=menuone

For automatic completion, you also need either:

setcompleteopt+=noselect

or:

setcompleteopt+=noinsert

To see documentation in the preview window for each completion option, copy all the lines above into your vimrc and change the preview line to:

setcompleteopt+=preview

To have the preview window automatically closed once a completion has been inserted:

autocmdCompleteDone*if!pumvisible() |pclose |endif

We also recommend:

setbelloff+=ctrlg" if vim beeps during completion

Intelligent Snippets

Some completions are actually autogenerated code snippets which can be filled in. These will be highlighted with the Underline highlight group.

You can navigate between placeholders with<CTRL-J> (forward) and<CTRL-K> (backward), even after you have typed over the original placeholder text.

To change these keys:

letg:kite_previous_placeholder='<C-H>'letg:kite_next_placeholder= '<C-L>`

Signatures

Kite can show how other people used the signature you are using. By default this is off to save space.

To turn it on::KiteShowPopularPatterns.

To turn it off::KiteHidePopularPatterns.

Kite Copilot for Python Documentation

As you edit your code, theKite Copilot will automatically show examples and docs for the code under your cursor.

Alternatively, you can pressK when the cursor is on a symbol to view its documentation in Kite Copilot.

If you have mappedK already, the plugin won't overwrite your mapping. You can set an alternative mapping, e.g. togK, like this:

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

By default you need to typeK (or whatever you have mapped to<Plug>(kite-docs)) each time you want to see documentation for the keyword under the cursor. To have the documentation continually update itself as you move from keyword to keyword:

letg:kite_documentation_continual=1

Goto Definition

Use<C-]> or:KiteGotoDefinition to jump to a method's definition.

Commands

  • KiteFindRelatedCodeFromFile - search for code related to the current file in the Copilot.
  • KiteFindRelatedCodeFromLine - search for code related to the current line in the Copilot.
  • KiteDocsAtCursor - show documentation for the keyword under the cursor in the Copilot.
  • KiteOpenCopilot - open the Kite Copilot and focus on it.
  • KiteGeneralSettings - open Kite's settings in the Copilot.
  • KitePermissions - open Kite's permission settings in the Copilot.
  • KiteTutorial - show a tutorial for using Kite with Vim.
  • KiteEnableAutoStart - start Kite automatically when Vim starts.
  • KiteDisableAutoStart - do not start Kite automatically when Vim starts.
  • KiteGotoDefinition - jump to a method's definition.

Statusline

Add%{kite#statusline()} to your statusline to get an indicator of what Kite is doing. If you don't have a status line, this one matches the default when&ruler is set:

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

Debugging

Uselet g:kite_log=1 to switch on logging. Logs are written tokite-vim.log in Vim's current working directory.


About Kite

Kite is built by a team in San Francisco devoted to making programming easier and more enjoyable for all. Follow Kite onTwitter and get the latest news and programming tips on theKite Blog.Kite has been featured inWired,VentureBeat,The Next Web, andTechCrunch.


[8]ページ先頭

©2009-2025 Movatter.jp