343343" - options.request_timeout: request timeout in seconds
344344" - options.auth_type: API authentication method (bearer, api-key, none)
345345" - options.token_file_path: override global token configuration
346+ " - options.token_load_fn: expression/vim function to load token
346347" - options.selection_boundary: selection prompt wrapper (eliminates empty responses, see #20)
347348" - ui.paste_mode: use paste mode (see more info in the Notes below)
348349let g:vim_ai_complete = {
@@ -358,6 +359,7 @@ let g:vim_ai_complete = {
358359\ "stream": 1,
359360\ "auth_type": "bearer",
360361\ "token_file_path": "",
362+ \ "token_load_fn": "",
361363\ "selection_boundary": "#####",
362364\ "initial_prompt": s:initial_complete_prompt,
363365\ },
@@ -375,6 +377,7 @@ let g:vim_ai_complete = {
375377" - options.request_timeout: request timeout in seconds
376378" - options.auth_type: API authentication method (bearer, api-key, none)
377379" - options.token_file_path: override global token configuration
380+ " - options.token_load_fn: expression/vim function to load token
378381" - options.selection_boundary: selection prompt wrapper (eliminates empty responses, see #20)
379382" - ui.paste_mode: use paste mode (see more info in the Notes below)
380383let g:vim_ai_edit = {
@@ -390,6 +393,7 @@ let g:vim_ai_edit = {
390393\ "stream": 1,
391394\ "auth_type": "bearer",
392395\ "token_file_path": "",
396+ \ "token_load_fn": "",
393397\ "selection_boundary": "#####",
394398\ "initial_prompt": s:initial_complete_prompt,
395399\ },
415419" - options.request_timeout: request timeout in seconds
416420" - options.auth_type: API authentication method (bearer, api-key, none)
417421" - options.token_file_path: override global token configuration
422+ " - options.token_load_fn: expression/vim function to load token
418423" - options.selection_boundary: selection prompt wrapper (eliminates empty responses, see #20)
419424" - ui.open_chat_command: preset (preset_below, preset_tab, preset_right) or a custom command
420425" - ui.populate_options: dump [chat] config to the chat header
@@ -434,6 +439,7 @@ let g:vim_ai_chat = {
434439\ "stream": 1,
435440\ "auth_type": "bearer",
436441\ "token_file_path": "",
442+ \ "token_load_fn": "",
437443\ "selection_boundary": "",
438444\ "initial_prompt": s:initial_chat_prompt,
439445\ },
@@ -452,6 +458,7 @@ let g:vim_ai_chat = {
452458" - options.request_timeout: request timeout in seconds
453459" - options.auth_type: API authentication method (bearer, api-key, none)
454460" - options.token_file_path: override global token configuration
461+ " - options.token_load_fn: expression/vim function to load token
455462" - options.download_dir: path to image download directory, `cwd` if not defined
456463let g:vim_ai_image = {
457464\ "provider": "openai",
@@ -465,6 +472,7 @@ let g:vim_ai_image = {
465472\ "request_timeout": 40,
466473\ "auth_type": "bearer",
467474\ "token_file_path": "",
475+ \ "token_load_fn": "",
468476\ },
469477\ "ui": {
470478\ "download_dir": "",
@@ -477,6 +485,9 @@ let g:vim_ai_roles_config_file = s:plugin_root . "/roles-example.ini"
477485" custom token file location
478486let g:vim_ai_token_file_path = "~/.config/openai.token"
479487
488+ " custom fn to load token, e.g. "g:GetAIToken()"
489+ let g:vim_ai_token_load_fn = ""
490+
480491" enables/disables full markdown highlighting in aichat files
481492" NOTE: code syntax highlighting works out of the box without this option enabled
482493" NOTE: highlighting may be corrupted when using together with the `preservim/vim-markdown`
0 commit comments