[[TOC]]
A Lua based plugin for Neovim that offers GitLab Duo Code Suggestions.
All feedback can be submitted in the [Feedback] GitLab for Neovim issue.
If you're interested in contributing check out the development process.
Software | Version |
---|---|
GitLab SaaS | 16.1+ |
GitLab self-managed | 16.1+ |
Neovim | 0.9+ |
-
Follow the installation steps for your chosen plugin manager.
- Optional: Configure GitLab Duo Code Suggestions as an Omni completion provider.
-
Setup helptags using
:helptags ALL
for access to:help gitlab.txt
.
To install the GitLab Vim plugin:
-
Clone Neovim's packpath which is included by packadd on startup.
git clone git@gitlab.com:gitlab-org/editor-extensions/gitlab.vim.git ~/.local/share/nvim/site/pack/gitlab/start/gitlab.vim
-
Add the following plugin to your lazy.nvim configuration:
{ url = "git@gitlab.com:gitlab-org/editor-extensions/gitlab.vim.git", lazy = false, }
-
Declare the plugin in your packer.nvim configuration:
use { "git@gitlab.com:gitlab-org/editor-extensions/gitlab.vim.git", }
- Manual installation:
-
Clone this repository into your
pack
directory:rm -r ~/.local/share/nvim/site/pack/gitlab/start/gitlab.vim rm ~/.local/share/nvim/gitlab-code-suggestions-language-server-*
-
To enable omni completion using GitLab Duo Code Suggestions:
- Follow the steps to enable GitLab Duo Code Suggestions for your GitLab instance (SaaS or self-managed).
- Enable Code Suggestions for your GitLab group/user.
- Create a Personal Access Token with the
api
scope. - Install the GitLab Duo Code Suggestions language server.
You may find it helpful to configure omni completion's popup menu even for a single suggestion:
vim.o.completeopt = 'menu,menuone'
- Use
ctrl-x ctrl-o
to open the Omni completion popup menu inside of supported filetypes.
Module | Key Bindings | Mode | Description |
---|---|---|---|
code_suggestions |
ctrl-x ctrl-o |
NORMAL |
Requests completions from GitLab Duo Code Suggestions through the language server. |
Enabling gitlab.statusline
will indicate the status of the GitLab Duo Code Suggestions integration.
For help troubleshooting please refer to the troubleshooting guide.
Write code more efficiently by using generative AI to suggest code while you’re developing. To learn more about this feature, see the GitLab Duo Code Suggestions documentation
This feature is in Beta GitLab Duo Code Suggestions is a generative artificial intelligence (AI) model. GitLab currently leverages Google Cloud’s Vertex AI Codey API models
No new additional data is collected to enable this feature. Private non-public GitLab customer data is not used as training data. Learn more about Google Vertex AI Codey APIs Data Governance
Beta users should read about the known limitations
Languages supported by GitLab Duo Code Suggestions can be found in the documentation.
For your convenience this plugin provides Vim auto-commands to start the LSP integration for some supported filetypes.
That is Ruby is a supported language so the plugin will add a FileType ruby
auto-command.
You can configure this behavior for additional filetypes through the code_suggestions.auto_filetypes
setup option.
-
Review whether each merge request since the last release has/requires a changelog entry.
-
Create a new merge request to increment the plugin version.
-
Update
PLUGIN_VERSION
inlua/gitlab/globals.lua
. -
Add a new
## vX.Y.Z
header above the previous CHANGELOG.md entry.
-
-
Merge the merge request once it has been approved.
-
Create a new signed git tag off of the
main
branch.
Report issues in the feedback issue.
This extension is open source and hosted on GitLab. Contributions are more than welcome. Feel free to fork and add new features or submit bug reports. See CONTRIBUTING for more information.
A list of the great people who contributed this project, and made it even more awesome, is available. Thank you all! 🎉
See LICENSE.