Skip to content

Commit 5644ac5

Browse files
authored
add vim command for invoking chat (Exafunction#457)
1 parent dfe75c6 commit 5644ac5

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,11 @@ vim-airline supports Codeium out-of-the-box since commit [3854429d](https://gith
188188

189189
### Launching Codeium Chat
190190

191-
Calling the `codeium#Chat()` function will enable search and indexing in the current project and launch Codeium Chat in a new browser window.
191+
Calling the `codeium#Chat()` function or using the `Codeium Chat` command will enable search and indexing in the current project and launch Codeium Chat in a new browser window.
192192

193193
```vim
194194
:call codeium#Chat()
195+
:Codeium Chat
195196
```
196197

197198
The project root is determined by looking in Vim's current working directory for some specific files or directories to be present and goes up to parent directories until one is found. This list of hints is user-configurable and the default value is:

autoload/codeium/command.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ function! s:commands.Auth(...) abort
137137
endif
138138
endfunction
139139

140+
function s:commands.Chat(...) abort
141+
call codeium#Chat()
142+
endfunction
143+
140144
function! s:commands.Disable(...) abort
141145
let g:codeium_enabled = 0
142146
endfunction

doc/codeium.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ COMMANDS *:Codeium*
1313
*:Codeium_Auth*
1414
:Codeium Auth Authenticate to Codeium.
1515

16+
*:Codeium_Chat*
17+
:Codeium Chat Open Codeium Chat in a browser window
18+
1619
*:Codeium_Disable*
1720
:Codeium Disable Disable Codeium completions
1821

plugin/codeium.vim

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,15 @@ endfun
108108

109109
command! CodeiumAuto :silent! call CodeiumAuto()
110110

111+
function! CodeiumChat()
112+
call codeium#Chat()
113+
endfun
114+
115+
command! CodeiumChat :silent! call CodeiumChat()
116+
111117
:amenu Plugin.Codeium.Enable\ \Codeium\ \(\:CodeiumEnable\) :call CodeiumEnable() <Esc>
112118
:amenu Plugin.Codeium.Disable\ \Codeium\ \(\:CodeiumDisable\) :call CodeiumDisable() <Esc>
113119
:amenu Plugin.Codeium.Manual\ \Codeium\ \AI\ \Autocompletion\ \(\:CodeiumManual\) :call CodeiumManual() <Esc>
114120
:amenu Plugin.Codeium.Automatic\ \Codeium\ \AI\ \Completion\ \(\:CodeiumAuto\) :call CodeiumAuto() <Esc>
115121
:amenu Plugin.Codeium.Toggle\ \Codeium\ \(\:CodeiumToggle\) :call CodeiumToggle() <Esc>
122+
:amenu Plugin.Codeium.Chat\ \Codeium\ \(\:CodeiumChat\) :call CodeiumChat() <Esc>

0 commit comments

Comments
 (0)