Skip to content

Commit d5976a5

Browse files
committed
docs: {g,b}:ollama_enabled
Document both global and buffer local `ollama_enabled` variables.
1 parent dfe292c commit d5976a5

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

doc/vim-ollama.txt

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,49 @@ Other Maps ~
200200

201201
You can configure vim-ollama using the following variables in your .vimrc:
202202

203+
*g:ollama_enabled*
204+
g:ollama_enabled
205+
- Description: When set to `1` (or 'v:true') enables vim-ollama
206+
autocompletion for all buffers, by default. But also see
207+
`b:ollama_enabled`. If set to any other value, vim-ollama
208+
autocompletion will be disabled by default for all buffers.
209+
210+
Can be modified either directly, or via the `:Ollama enable`,
211+
`:Ollama disable`, and `:Ollama toggle` commands.
212+
- Default: 'v:true'
213+
- Example:
214+
>
215+
let g:ollama_enabled = 0
216+
<
217+
*b:ollama_enabled*
218+
b:ollama_enabled
219+
- Description: Similar to `g:ollama_enabled`, but affects a single buffer.
220+
When unset, `g:ollama_enabled` is used.
221+
222+
If you want to disable vim-ollama autocompletion by default, but enable
223+
it for individual buffers, you can set `g:ollama_enabled` to 'v:false',
224+
and use an 'autocmd' to set `b:ollama_enabled` to 'v:true' for
225+
individual buffers.
226+
227+
Or vice versa, you can set `g:ollama_enabled` to 'v:true', and use an
228+
'autocmd' to set `b:ollama_enabled` to 'v:false' for individual buffers.
229+
230+
- Default: unset
231+
- Example:
232+
>
233+
" Disable vim-ollama autocompletion for a specific filetype
234+
augroup DisableOllamaAutoCompletionForPerl
235+
autocmd!
236+
autocmd FileType perl let b:ollama_enabled = v:false
237+
augroup END
238+
239+
" Enable vim-ollama autocompletion only for a specific filetype
240+
let g:ollama_enabled = v:false
241+
augroup EnableOllamaAutoCompletionForPerl
242+
autocmd!
243+
autocmd FileType perl let b:ollama_enabled = v:true
244+
augroup END
245+
<
203246
*g:ollama_host*
204247
g:ollama_host
205248
- Description: Sets the Ollama host address and port.

0 commit comments

Comments
 (0)