β‘ Neural
A ChatGPT Vim plugin, an OpenAI Neovim plugin, and so much more! Neural integrates various machine learning tools so you can let AI write code for you in Vim/Neovim, among other helpful things.
π Features
- Generate text easily
:Neural write a story
- Support for multiple machine learning models
- Compatible with Vim 8.0+ & Neovim 0.8+
- Supported on Linux, Mac OSX, and Windows
- Only dependency is Python 3.7+
Experience lightning-fast code generation and completion with asynchronous streaming.
Edit any kind of text document. It can be used to generate Python docstrings, fix comments spelling/grammar mistakes, generate ideas and much more. See examples from OpenAI for a start.
π Plugin Integrations
If the following plugins are installed, Neural will detect them and start using them for a better experience.
- nui.nvim - for Neovim UI support
- significant.nvim - for Neovim animated signs
- ALE - For correcting problems with generated code
πͺ Installation
Add Neural to your runtime path in the usual ways.
If you have trouble reading :help neural
, try the following.
packloadall | silent! helptags ALL
packload
:
Vim git clone --depth 1 https://github.com/dense-analysis/neural.git ~/.vim/pack/git-plugins/start/neural
packload
:
Neovim git clone --depth 1 https://github.com/dense-analysis/neural.git ~/.local/share/nvim/site/pack/git-plugins/start/neural
packload
:
Windows git clone --depth 1 https://github.com/dense-analysis/neural.git ~/vimfiles/pack/git-plugins/start/neural
vim-plug
Plug 'dense-analysis/neural'
Plug 'muniftanjim/nui.nvim'
Plug 'elpiloto/significant.nvim'
Vundle
Plugin 'dense-analysis/neural'
π Usage
You will need to configure a third party machine learning tool for Neural to interact with. OpenAI is Neural's default data source, and one of the easiest to configure.
You will need to obtain an OpenAI API key. Once you have your key, configure Neural to use that key, whether in a Vim script or in a Lua config.
" Configure Neural like so in Vimscript
let g:neural = {
\ 'source': {
\ 'openai': {
\ 'api_key': $OPENAI_API_KEY,
\ },
\ },
\}
-- Configure Neural like so in Lua
require('neural').setup({
source = {
openai = {
api_key = vim.env.OPENAI_API_KEY,
},
},
})
Try typing :Neural say hello
, and if all goes well the machine learning
tool will say "hello" to you in the current buffer. Type :help neural
to
see the full documentation.
π Acknowledgements
Neural was created by Anexon, and is maintained by the Dense Analysis team.
Special thanks are due for the following individuals:
- w0rp for providing guidance and golden nuggets from invaluable experience creating & maintaining ALE.
- Munif Tanjim for creating an awesome UI component library nui.nvim.
- Luis Poloto for creating an underrated sign animations plugin significant.nvim.
βΉοΈ Disclaimer
All input data will be sent to third party servers in order to query the machine learning models.
Language generation models based on the transformer architecture have shown strong performance on a variety of natural language tasks such as summarization, language translation and generating human-like text.
Open AI's Codex model has been fine-tuned for code generation tasks and can generate patterns and structures of programming languages using attention mechanisms to focus on specific parts of the input sequence.
π¨ Use generated code in production systems at your own risk!
Although the resulting output is usually syntactically valid, it must be carefully evaluated for correctness. Use a linting tool such as ALE to check your code for correctness.
π License
Neural is released under the MIT license. See LICENSE for more information.