Skip to content

Commit 263acc2

Browse files
update
1 parent 57142d1 commit 263acc2

30 files changed

Lines changed: 3371 additions & 1 deletion

lazy-lock.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"nvim-dap-go": { "branch": "main", "commit": "a5cc8dcad43f0732585d4793deb02a25c4afb766" },
2222
"nvim-dap-ui": { "branch": "master", "commit": "34160a7ce6072ef332f350ae1d4a6a501daf0159" },
2323
"nvim-lspconfig": { "branch": "master", "commit": "d0467b9574b48429debf83f8248d8cee79562586" },
24-
"nvim-treesitter": { "branch": "master", "commit": "1920285ec11654072f14d07258e73ef792ac9005" },
24+
"nvim-treesitter": { "branch": "master", "commit": "c5a7533113b2deb7db899d387b877389cc8b6113" },
2525
"nvim-treesitter-textobjects": { "branch": "master", "commit": "e69a504baf2951d52e1f1fbb05145d43f236cbf1" },
2626
"onedark.nvim": { "branch": "master", "commit": "b9acd92ded2ba155867ca5af9d618e933d96e3b0" },
2727
"plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" },
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
dist: trusty
2+
3+
env:
4+
global:
5+
- DEPS=$HOME/deps
6+
- PATH=$DEPS/bin:$PATH
7+
8+
before_install:
9+
- sudo apt-get install python-pip
10+
- pip install --user awscli
11+
- export PATH="$PATH:$HOME/.local/bin"
12+
- curl --silent -L "https://s3-us-west-1.amazonaws.com/kite-data/tensorflow/libtensorflow-cpu-linux-x86_64-1.9.0.tar.gz" | tar -C $HOME -xz
13+
- curl --silent --compressed --output "$HOME/kited-test" "https://s3-us-west-1.amazonaws.com/kited-test/linux/kited-test"
14+
- chmod u+x "$HOME/kited-test"
15+
16+
install: |
17+
git config --global user.email "[email protected]"
18+
git config --global user.name "Your Name"
19+
C_OPTS="--prefix=$DEPS --with-features=huge --disable-gui "
20+
git clone --depth 1 https://github.com/vim/vim
21+
cd vim
22+
export PATH=/usr/bin:$PATH
23+
./configure $C_OPTS
24+
make
25+
make install
26+
cd -
27+
export PATH=$DEPS/bin:$PATH
28+
export VIM="$(which vim)"
29+
30+
31+
script:
32+
- vim --version
33+
- cd test && bash test
34+
- export LD_LIBRARY_PATH="$HOME/lib:$LD_LIBRARY_PATH"
35+
- echo "Running tests with kited-local --------------" && $HOME/kited-test > ~/kite.log 2>&1 & sleep 20 && bash editor_tests && killall kited-test
36+
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Installation
2+
3+
## Manual installation
4+
5+
### Vim
6+
7+
Assuming your Vim configuration is in `~/.vim/`:
8+
9+
```sh
10+
$ mkdir -p ~/.vim/pack/kite/start/kite
11+
$ git clone https://github.com/kiteco/vim-plugin.git ~/.vim/pack/kite/start/kite/
12+
```
13+
14+
Restart Vim.
15+
16+
17+
### Neovim
18+
19+
Assuming your Neovim configuration is in `~/.config/nvim`:
20+
21+
```sh
22+
$ mkdir -p ~/.config/nvim/pack/kite/start/kite
23+
$ git clone https://github.com/kiteco/vim-plugin.git ~/.config/nvim/pack/kite/start/kite/
24+
```
25+
26+
Restart Neovim.
27+
28+
# Development
29+
30+
When working on the plugin, ensure the file `~/.kite/vim-development` (or `$LOCALAPPDATA$\Kite\vim-development` on Windows) is present. This tells the plugin to use development mode, i.e. to use the non-production key when POSTing metrics to Segment.

pack/kite/start/vim-plugin/LICENSE

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Copyright (c) 2017 Manhattan Engineering, Inc - All Rights Reserved
2+
3+
Reproduction of this material is strictly forbidden unless prior written
4+
permission is obtained from Manhattan Engineering, Inc.

pack/kite/start/vim-plugin/LSP.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
## Kite-LSP
2+
3+
Kite comes with a language server adapter that may be used to enable Kite
4+
completions via your favorite LSP client.
5+
Other Kite features than completions are not well-supported via LSP, so you
6+
should still install the Kite plugin for Vim.
7+
8+
The Kite-LSP adapter may be run as follows, depending on your operating system:
9+
```bash
10+
/Applications/Kite.app/Contents/MacOS/kite-lsp --editor=vim
11+
~/.local/share/kite/current/kite-lsp --editor=vim
12+
C:\Program Files\Kite\kite-lsp.exe --editor=vim
13+
```
14+
15+
If you installed Kite to a non-standard location, you may need to appropriately
16+
modify the executable path.
17+
18+
### Neovim-LSP
19+
20+
As today the [LSP integration in neovim](https://github.com/neovim/nvim-lspconfig) is just avalaible in the nightlies.
21+
To enable the support in this case:
22+
23+
```
24+
au User lsp_setup call lsp#register_server({
25+
\ 'name': 'kite',
26+
\ 'cmd': '~/.local/share/kite/current/kite-lsp --editor=vim',
27+
\ 'whitelist': ["php", "javascript", "python", "bash"],
28+
\ })
29+
```
30+
31+
### Coc.nvim
32+
33+
We have tested Kite-LSP with the full-featured
34+
[coc.nvim](https://github.com/neoclide/coc.nvim) completions plugin.
35+
However, it should likely work with most LSP client plugins.
36+
37+
In order to enable Kite-LSP, add the following to your coc.nvim configuration
38+
(`:CocConfig`):
39+
```json
40+
{
41+
"languageserver": {
42+
"kite": {
43+
"command": "/Applications/Kite.app/Contents/MacOS/kite-lsp --editor=vim",
44+
"filetypes": ["python", "go", "javascript"]
45+
}
46+
}
47+
}
48+
```
49+
50+
Add to `"filetypes"` any languages for which you would like to enable Kite
51+
completions.
52+
53+
You should also disable the Kite plugin's completions to avoid getting
54+
duplicate completions:
55+
```viml
56+
let g:kite_completions=0
57+
```
Lines changed: 222 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
1+
# Kite Python Plugin for Vim/Neovim
2+
3+
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 at https://kite.com/integrations/vim/.
4+
5+
At a high level, Kite provides you with:
6+
* 🧠 __[Line-of-Code Completions](#Line-of-Code-Completions)__ powered by machine learning models trained on the entire open source code universe
7+
* 📝 __[Intelligent Snippets](#Intelligent-Snippets)__ that automatically provide context-relevant code snippets for your function calls
8+
* 🔍 __[Instant documentation](#Kite-Copilot-for-Python-Documentation)__ for the symbol underneath your cursor so you save time searching for Python docs
9+
10+
11+
## Requirements
12+
13+
* macOS 10.10+ or Windows 7+ or Linux (Ubuntu, Debian, Fedora, Arch Linux, Linux Mint, openSUSE, KDE, XFCE, Gnome 2, Gnome 3)
14+
* Vim 8 or Neovim
15+
* [Kite Engine](https://kite.com/)
16+
17+
Use another editor? Check out [Kite’s other editor integrations](https://kite.com/integrations/).
18+
19+
20+
## Installation
21+
22+
### Installing the Kite Engine
23+
24+
The [Kite Engine](https://kite.com/) 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).
25+
26+
__macOS Instructions__
27+
1. Download the [installer](https://kite.com/download/) and open the downloaded `.dmg` file.
28+
2. Drag the Kite icon into the `Applications` folder.
29+
3. Run `Kite.app` to start the Kite Engine.
30+
31+
__Windows Instructions__
32+
1. Download the [installer](https://kite.com/download/) and run the downloaded `.exe` file.
33+
2. The installer should run the Kite Engine automatically after installation is complete.
34+
35+
__Linux Instructions__
36+
1. Visit https://kite.com/linux/ to learn how to install Kite.
37+
2. The installer should run the Kite Engine automatically after installation is complete.
38+
39+
### Installing the Kite plugin for Vim/Neovim
40+
41+
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's [plugin manager](https://help.kite.com/article/62-managing-editor-plugins).
42+
43+
Alternatively, you can follow the instructions in the [DEVELOPMENT.md](https://github.com/kiteco/vim-plugin/blob/master/DEVELOPMENT.md) file to learn how to manually install the Vim/Neovim plugin.
44+
45+
Once installed, the plugin will be automatically updated by Kite when necessary.
46+
47+
### Configuring supported languages
48+
49+
Kite supports 12 languages and counting. By default only Python is enabled. You can configure the languages for which Kite is enabled:
50+
51+
```viml
52+
" Python, JavaScript, Go
53+
let g:kite_supported_languages = ['python', 'javascript', 'go']
54+
55+
" All the languages Kite supports
56+
let g:kite_supported_languages = ['*']
57+
58+
" Turn off Kite
59+
let g:kite_supported_languages = []
60+
```
61+
62+
[Learn more about why Kite is the best autocomplete for Vim.](https://kite.com/integrations/vim/)
63+
64+
65+
## Features
66+
67+
Kite's Vim/Neovim plugin provides a number of features to help you code better and faster.
68+
69+
70+
### Line-of-Code Completions
71+
72+
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.
73+
74+
By default Kite's completions will show up automatically as you type. You can opt out via:
75+
76+
```viml
77+
let g:kite_auto_complete=0
78+
```
79+
80+
You can manually invoke the completions in insert mode with `<C-X><C-U>`. See `:h i_CTRL-X_CTRL-U` for details.
81+
82+
You can disable Kite's completions altogether with this in your vimrc:
83+
84+
```viml
85+
let g:kite_completions=0
86+
```
87+
88+
Kite's completions include snippets by default. To opt out of the snippets, add this to your vimrc:
89+
90+
```viml
91+
let g:kite_snippets=0
92+
```
93+
94+
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:
95+
96+
```viml
97+
let g:kite_tab_complete=1
98+
```
99+
100+
For any kind of completion you must set 'completopt' as follows:
101+
102+
```viml
103+
set completeopt+=menuone
104+
```
105+
106+
For automatic completion, you also need either:
107+
108+
```viml
109+
set completeopt+=noselect
110+
```
111+
112+
or:
113+
114+
```viml
115+
set completeopt+=noinsert
116+
```
117+
118+
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:
119+
120+
```viml
121+
set completeopt+=preview
122+
```
123+
124+
To have the preview window automatically closed once a completion has been inserted:
125+
126+
```viml
127+
autocmd CompleteDone * if !pumvisible() | pclose | endif
128+
```
129+
130+
We also recommend:
131+
132+
```viml
133+
set belloff+=ctrlg " if vim beeps during completion
134+
```
135+
136+
137+
### Intelligent Snippets
138+
139+
Some completions are actually autogenerated code snippets which can be filled in. These will be highlighted with the Underline highlight group.
140+
141+
You can navigate between placeholders with `<CTRL-J>` (forward) and `<CTRL-K>` (backward), even after you have typed over the original placeholder text.
142+
143+
To change these keys:
144+
145+
```viml
146+
let g:kite_previous_placeholder = '<C-H>'
147+
let g:kite_next_placeholder = '<C-L>`
148+
```
149+
150+
151+
### Signatures
152+
153+
Kite can show how other people used the signature you are using. By default this is off to save space.
154+
155+
To turn it on: `:KiteShowPopularPatterns`.
156+
157+
To turn it off: `:KiteHidePopularPatterns`.
158+
159+
160+
### Kite Copilot for Python Documentation
161+
162+
As you edit your code, the [Kite Copilot](https://kite.com/copilot/) will automatically show examples and docs for the code under your cursor.
163+
164+
Alternatively, you can press `K` when the cursor is on a symbol to view its documentation in Kite Copilot.
165+
166+
If you have mapped `K` already, the plugin won't overwrite your mapping. You can set an alternative mapping, e.g. to `gK`, like this:
167+
168+
```viml
169+
nmap <silent> <buffer> gK <Plug>(kite-docs)
170+
```
171+
172+
By default you need to type `K` (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:
173+
174+
```viml
175+
let g:kite_documentation_continual=1
176+
```
177+
178+
179+
### Goto Definition
180+
181+
Use `<C-]>` or `:KiteGotoDefinition` to jump to a method's definition.
182+
183+
184+
### Commands
185+
186+
- `KiteDocsAtCursor` - show documentation for the keyword under the cursor.
187+
- `KiteOpenCopilot` - open the Kite Copilot and focus on it.
188+
- `KiteGeneralSettings` - open Kite's settings in the Copilot.
189+
- `KitePermissions` - open Kite's permission settings in the Copilot.
190+
- `KiteTutorial` - show a tutorial for how to use Kite with Vim.
191+
- `KiteEnableAutoStart` - start Kite automatically when Vim starts.
192+
- `KiteDisableAutoStart` - do not start Kite automatically when Vim starts.
193+
- `KiteGotoDefinition` - jump to a method's definition.
194+
195+
196+
197+
### Statusline
198+
199+
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:
200+
201+
```viml
202+
set statusline=%<%f\ %h%m%r%{kite#statusline()}%=%-14.(%l,%c%V%)\ %P
203+
set laststatus=2 " always display the status line
204+
```
205+
206+
207+
### Debugging
208+
209+
Use `let g:kite_log=1` to switch on logging. Logs are written to `kite-vim.log` in Vim's current working directory.
210+
211+
212+
---
213+
214+
#### About Kite
215+
216+
Kite is built by a team in San Francisco devoted to making programming easier and more enjoyable for all. Follow Kite on
217+
[Twitter](https://twitter.com/kitehq) and get the latest news and programming tips on the
218+
[Kite Blog](https://kite.com/blog/).
219+
Kite has been featured in [Wired](https://www.wired.com/2016/04/kites-coding-asssitant-spots-errors-finds-better-open-source/),
220+
[VentureBeat](https://venturebeat.com/2019/01/28/kite-raises-17-million-for-its-ai-powered-developer-environment/),
221+
[The Next Web](https://thenextweb.com/dd/2016/04/14/kite-plugin/), and
222+
[TechCrunch](https://techcrunch.com/2019/01/28/kite-raises-17m-for-its-ai-driven-code-completion-tool/).

pack/kite/start/vim-plugin/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.0.84

0 commit comments

Comments
 (0)