Skip to content

Commit

Permalink
Add new variable: g:codeium_filetypes_disabled_by_default.
Browse files Browse the repository at this point in the history
Enables finer control of when to enable codeium.
  • Loading branch information
zArubaru authored and MissLov3ly committed Feb 13, 2024
1 parent 27eee46 commit 0d9b138
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ let g:codeium_disable_bindings = 1

or in Neovim:

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

Expand All @@ -91,10 +91,10 @@ use {
'Exafunction/codeium.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 })
vim.keymap.set('i', '<C-g>', function () return vim.fn['codeium#Accept']() end, { expr = true })
vim.keymap.set('i', '<c-;>', function() return vim.fn['codeium#CycleCompletions'](1) end, { expr = true })
vim.keymap.set('i', '<c-,>', function() return vim.fn['codeium#CycleCompletions'](-1) end, { expr = true })
vim.keymap.set('i', '<c-x>', function() return vim.fn['codeium#Clear']() end, { expr = true })
end
}
```
Expand All @@ -116,31 +116,36 @@ let g:codeium_filetypes = {

Codeium is enabled by default for most filetypes.

You can also _disable_ codeium by default with the `g:codeium_enabled`
variable:
You can also _disable_ codeium by default with the `g:codeium_enabled` variable,
and enable it manually per buffer by running `:CodeiumEnable`:

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

or in Neovim:
Or you can disable codeium for _all filetypes_ with the `g:codeium_filetypes_disabled_by_default` variable,
and use the `g:codeium_filetypes` variable to selectively enable codeium for specified filetypes:

```lua
vim.g.codeium_enabled = false
```vim
" let g:codeium_enabled = v:true
let g:codeium_filetypes_disabled_by_default = v:true
let g:codeium_filetypes = {
\ "rust": v:true,
\ "typescript": v:true,
\ }
```

Instead, if you would like to just disable the automatic triggering of
completions:
If you would like to just disable the automatic triggering of completions:

```vim
let g:codeium_manual = v:true
```

### Show Codeium status in statusline

Codeium status can be generated by calling the `codeium#GetStatusString()` function. In
Neovim, you can use `vim.api.nvim_call_function("codeium#GetStatusString", {})` instead.
It produces a 3 char long string with Codeium status:
Codeium status can be generated by calling `codeium#GetStatusString()` function.
It produce 3 char long string with status:
- `'3/8'` - third suggestion out of 8
- `'0'` - Codeium returned no suggestions
- `'*'` - waiting for Codeium response
Expand Down

0 comments on commit 0d9b138

Please # to comment.