如果您按照官方说明安装了副本neovim插件,则它是always,当您键入-say-
pass edit www.mybank.com/credentials
当您解密gpg加密文件时,将其放入 /dev /shm中进行编辑 - 哦,和Copilot现在将其通过网络的内容发送到AI。您告诉您可以使用您的东西进行培训是可以的。
,除了删除副驾驶插件,再也不会使用它;有没有办法确保这种情况再也不会发生?
PS这是相关的:
您可以每项项目选择GitHub Copilot吗?~/.config/nvim/pack/github/start/copilot.vim
~/.config/nvim/pack/github/opt/copilot.vim
-在正常情况下在所有情况下阻止其加载。
然后,我将以下内容添加到
~/.config/nvim/init.vim
的底部:
" Only load Copilot if COPILOT_EXTENSIONS is set and contains the file extension used.
function! ShouldLoadCopilot()
" Check if environment variable exists
if empty($COPILOT_EXTENSIONS)
return 0
endif
" Convert space-separated list of extensions into dictionary.
let allowed_extensions = {}
for ext in split($COPILOT_EXTENSIONS)
let allowed_extensions[ext] = 1
endfor
" Check current file extension.
let ext = expand('%:e')
return get(allowed_extensions, ext, 0)
endfunction
command! LoadCopilot call LoadCopilotIfAllowed()
let g:copilot_loaded = 0
" Add Copilot status to statusline.
function! CopilotStatus()
return get(b:, 'copilot_enabled', 0) ? ' Copilot:ON' : ''
endfunction
" Construct statusline.
set statusline=%<%f\ %h%m%r
set statusline+=%=%{CopilotStatus()}\ \
set statusline+=%-14.(%l,%c%V%)\ %P
function! LoadCopilotIfAllowed()
if !g:copilot_loaded
if ShouldLoadCopilot()
packadd copilot.vim
Copilot auth
let g:copilot_loaded = 1
else
echo "Copilot not loaded."
return
endif
endif
if ShouldLoadCopilot()
Copilot enable
let b:copilot_enabled = 1
else
Copilot disable
let b:copilot_enabled = 0
endif
endfunction
" Auto-check loading of Copilot on file open.
autocmd BufRead,BufNewFile * LoadCopilot
现在需要设置环境变量,即(例如)
export COPILOT_EXTENSIONS="c h cpp hpp cxx hxx"
在加载副标题插件之前,在空间分开的文件扩展名之前。
同样,在会话中的文件之间切换时,如果扩展名不匹配,则禁用插件(尽管插件未卸载)。
I通过使用
CDEH可以很好地控制我的环境,这意味着将环境变量设置并取消设置为我所在的当前目录的函数。例如,我将
export COPILOT_EXTENSIONS="c h cpp hpp cxx hxx"
添加到
/home/carlo/projects/env.source