# windsurf.vim: AI Code Completion for Vim and Neovim

> windsurf.vim brings Windsurf's AI-assisted code completion to Vim and Neovim, offering inline suggestions, cycling between alternatives, and per-filetype enable controls without requiring VS Code or a JetBrains IDE. It requires Vim 9.0.0185 or later, or Neovim 0.6 or later, and authenticates through the same Codeium account as the other Windsurf clients.

**Exafunction/windsurf.vim** — Free, ultrafast Copilot alternative for Vim and Neovim

- Repository: https://github.com/Exafunction/windsurf.vim
- Website: https://codeium.com
- Stars: 5,142 · Forks: 196
- Language: Vim Script
- License: MIT
- Published: 2026-09-23 · Updated: 2026-09-23 · Language: en
- Canonical page: https://hysenlabs.com/projects/exafunction-windsurf-vim

## What windsurf.vim does and who should use it

windsurf.vim is a Vim Script and Vimscript plugin that connects Vim and Neovim to the Windsurf AI completion service. When you type in insert mode, the plugin sends the current buffer context to Windsurf and displays an inline suggestion as gray text. Pressing Tab accepts the full suggestion. Other keybindings let you cycle forward and backward through alternatives, accept only the next word, or accept only the next line.

The plugin targets developers who prefer Vim or Neovim as their primary editor and do not want to maintain a separate VS Code or JetBrains environment just for AI assistance. Windsurf already provides extensions for VS Code, JetBrains, and a Chrome extension, listed in the README's badge section. windsurf.vim fills the same role for terminal-based workflows.

Installation requires at least Vim 9.0.0185 or Neovim 0.6. Older versions of Vim do not have the necessary APIs. After installing through a plugin manager, running `:Codeium Auth` connects the plugin to your Windsurf account. The README links to a tutorial at windsurf.com/vim_tutorial for users who want a guided walkthrough.

## Installing windsurf.vim through a plugin manager

The README supports any standard Vim plugin manager. For users of vim-plug, adding `Exafunction/windsurf.vim` to the plugin list and running `:PlugInstall` is sufficient. For Neovim users with packer.nvim or lazy.nvim, the README provides a configuration snippet that maps custom keys at load time:

```lua
use {
  'Exafunction/windsurf.vim',
  config = function ()
    -- Change '<C-g>' here to any keycode you like.
    vim.keymap.set('i', '<C-g>', function () return vim.fn['codeium#Accept']() end, { expr = true, silent = true })
    vim.keymap.set('i', '<c-;>', function() return vim.fn['codeium#CycleCompletions'](1) end, { expr = true, silent = true })
    vim.keymap.set('i', '<c-,>', function() return vim.fn['codeium#CycleCompletions'](-1) end, { expr = true, silent = true })
    vim.keymap.set('i', '<c-x>', function() return vim.fn['codeium#Clear']() end, { expr = true, silent = true })
  end
}
```

After installation, run `:Codeium Auth` to authenticate. Without authentication, the plugin sends no requests and produces no suggestions.

## Default keybindings and how to remap them

The plugin ships with five default keybindings in insert mode: Tab accepts the current suggestion, Ctrl+] clears it, Alt+] moves to the next alternative, Alt+[ moves to the previous alternative, and Alt+\ triggers a suggestion manually. Two additional bindings are available but not mapped by default: `codeium#AcceptNextWord()` accepts only the next word, and `codeium#AcceptNextLine()` accepts only the next line.

To disable all default bindings and configure your own, set the global variable before the plugin loads:

```vim
let g:codeium_disable_bindings = 1
```

Or in Neovim:

```lua
vim.g.codeium_disable_bindings = 1
```

The README provides a Vim configuration example for rebinding the core actions. For example, to map accept to Ctrl+G and word-accept to Ctrl+H:

```vim
imap <script><silent><nowait><expr> <C-g> codeium#Accept()
imap <script><silent><nowait><expr> <C-h> codeium#AcceptNextWord()
imap <script><silent><nowait><expr> <C-j> codeium#AcceptNextLine()
imap <C-;>   <Cmd>call codeium#CycleCompletions(1)<CR>
imap <C-,>   <Cmd>call codeium#CycleCompletions(-1)<CR>
imap <C-x>   <Cmd>call codeium#Clear()<CR>
```

If you only want to remove the Tab binding while keeping the others, `g:codeium_no_map_tab` handles that case without disabling all bindings.

## Disabling completions per filetype or globally

The plugin is enabled by default for most filetypes. To disable it for specific filetypes, set the `g:codeium_filetypes` dictionary. The values are Vim boolean constants:

```vim
let g:codeium_filetypes = {
    \ "bash": v:false,
    \ "typescript": v:true,
    \ }
```

To disable the plugin globally and enable it per buffer as needed, set `g:codeium_enabled` to false and use `:CodeiumEnable` when you want it:

```vim
let g:codeium_enabled = v:false
```

The inverse is also supported: setting `g:codeium_filetypes_disabled_by_default` to true disables the plugin for all filetypes, and then `g:codeium_filetypes` selectively re-enables it for the filetypes you list. This gives fine-grained control without setting every filetype individually.

Disabling the automatic trigger while keeping the plugin active is done with `g:codeium_manual = v:true`. In manual mode, the plugin waits for an explicit trigger rather than showing suggestions as you type. The README suggests combining this with `CycleOrComplete()` instead of `CycleCompletions(1)` so that cycling also triggers the first suggestion when none is displayed.

## Statusline integration and the Chat command

The plugin can display its current state in the Vim statusline through the `codeium#GetStatusString()` function. In insert mode it returns a string like `3/8` indicating which suggestion is displayed out of how many alternatives, `0` when no suggestions were returned, or `*` while waiting for a response. In normal mode it returns `ON` or `OFF` depending on whether the plugin is enabled.

To add this to the statusline:

```set statusline+=%3{codeium#GetStatusString()}```

vim-airline supports the plugin natively from a specific commit mentioned in the README, so airline users get statusline integration without any configuration.

The `codeium#Chat()` function and the `:Codeium Chat` command open Codeium Chat in a new browser window. This enables search and file indexing for the current project directory. The project root is determined by Vim's current working directory. This is a heavier feature that requires a browser, so it is less integrated into the terminal workflow than the inline completion.

## Limitations and maintenance status

windsurf.vim calls the Windsurf service over the network for every completion. It is not an offline tool and does not run a local model. In environments without reliable internet access, suggestions will be slow or absent. The README does not document a local fallback.

The plugin does not support IE at all. For Vim specifically, the minimum version is 9.0.0185, and the README notes that older Vim installations will not work. Some Linux distributions ship older Vim versions, so checking the version before installing avoids confusion.

The repository does not tag releases. There is no versioned changelog, so tracking what changed between updates requires reading commit messages.

The last push to this repository was on 2026-03-31. Contributions are described as welcome in the README, and pull requests and issues are accepted. GitHub Copilot is the most direct alternative: it is also an inline completion tool with a Vim/Neovim plugin (`github/copilot.vim`), but it is a paid subscription service unlike Windsurf, which the README describes as free.

## Conclusion

windsurf.vim is the right choice for developers who use Vim or Neovim and want AI code completion without switching to VS Code or a JetBrains IDE. It is not the right choice for developers who need a self-contained offline model, because it calls the Windsurf service over the network. Before installing, verify your Vim version is at least 9.0.0185 or your Neovim is at least 0.6. The last push to this repository was on 2026-03-31, which means the codebase has not been updated in roughly six months. Run `:Codeium Auth` after installation to connect the plugin to your Windsurf account before expecting any completions.

## FAQ

### Can I use Windsurf in VS Code?

Yes. The windsurf.vim repository's README links to separate VS Code and JetBrains extensions for Windsurf. windsurf.vim is specifically the plugin for Vim and Neovim. The VS Code extension is available on the VS Code Marketplace.

### What IDE does windsurf.vim work with?

windsurf.vim works with Vim (at least version 9.0.0185) and Neovim (at least version 0.6). It is not an IDE itself but a plugin that adds AI completion to existing Vim and Neovim installations.

### How do I disable windsurf.vim for a specific filetype in Neovim?

Set the g:codeium_filetypes dictionary in your Neovim config with the filetype name as the key and false as the value. For example, to disable it for bash, add `vim.g.codeium_filetypes = { bash = false }` to your init.lua. The README also documents disabling the plugin globally with g:codeium_enabled and then enabling it per buffer.

## Sources

- [Exafunction/windsurf.vim on GitHub](https://github.com/Exafunction/windsurf.vim)
- [Issues](https://github.com/Exafunction/windsurf.vim/issues)
- [License: MIT](https://github.com/Exafunction/windsurf.vim/blob/main/LICENSE)
- [Project website](https://codeium.com)
- [README](https://github.com/Exafunction/windsurf.vim/blob/main/README.md)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/exafunction-windsurf-vim
