Skip to content

Commit 0d9b138

Browse files
zArubaruMissLov3ly
authored andcommitted
Add new variable: g:codeium_filetypes_disabled_by_default.
Enables finer control of when to enable codeium.
1 parent 27eee46 commit 0d9b138

1 file changed

Lines changed: 20 additions & 15 deletions

File tree

README.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ let g:codeium_disable_bindings = 1
6666

6767
or in Neovim:
6868

69-
```lua
69+
```vim
7070
vim.g.codeium_disable_bindings = 1
7171
```
7272

@@ -91,10 +91,10 @@ use {
9191
'Exafunction/codeium.vim',
9292
config = function ()
9393
-- Change '<C-g>' here to any keycode you like.
94-
vim.keymap.set('i', '<C-g>', function () return vim.fn['codeium#Accept']() end, { expr = true, silent = true })
95-
vim.keymap.set('i', '<c-;>', function() return vim.fn['codeium#CycleCompletions'](1) end, { expr = true, silent = true })
96-
vim.keymap.set('i', '<c-,>', function() return vim.fn['codeium#CycleCompletions'](-1) end, { expr = true, silent = true })
97-
vim.keymap.set('i', '<c-x>', function() return vim.fn['codeium#Clear']() end, { expr = true, silent = true })
94+
vim.keymap.set('i', '<C-g>', function () return vim.fn['codeium#Accept']() end, { expr = true })
95+
vim.keymap.set('i', '<c-;>', function() return vim.fn['codeium#CycleCompletions'](1) end, { expr = true })
96+
vim.keymap.set('i', '<c-,>', function() return vim.fn['codeium#CycleCompletions'](-1) end, { expr = true })
97+
vim.keymap.set('i', '<c-x>', function() return vim.fn['codeium#Clear']() end, { expr = true })
9898
end
9999
}
100100
```
@@ -116,31 +116,36 @@ let g:codeium_filetypes = {
116116

117117
Codeium is enabled by default for most filetypes.
118118

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

122122
```vim
123123
let g:codeium_enabled = v:false
124124
```
125125

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

128-
```lua
129-
vim.g.codeium_enabled = false
129+
```vim
130+
" let g:codeium_enabled = v:true
131+
let g:codeium_filetypes_disabled_by_default = v:true
132+
133+
let g:codeium_filetypes = {
134+
\ "rust": v:true,
135+
\ "typescript": v:true,
136+
\ }
130137
```
131138

132-
Instead, if you would like to just disable the automatic triggering of
133-
completions:
139+
If you would like to just disable the automatic triggering of completions:
134140

135141
```vim
136142
let g:codeium_manual = v:true
137143
```
138144

139145
### Show Codeium status in statusline
140146

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

0 commit comments

Comments
 (0)