Skip to content

Commit 399fd15

Browse files
committed
Copilot.vim 1.0.2
1 parent e1be74e commit 399fd15

File tree

5 files changed

+39
-12
lines changed

5 files changed

+39
-12
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
At the moment we are not accepting contributions to the repository.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/tags
1+
/doc/tags

autoload/copilot.vim

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ function! s:BufferDisabled() abort
221221
return b:copilot_disabled ? 3 : 0
222222
endif
223223
if exists('b:copilot_enabled')
224-
return b:copilot_enabled ? 4 : 0
224+
return b:copilot_enabled ? 0 : 4
225225
endif
226226
let short = empty(&l:filetype) ? '.' : split(&l:filetype, '\.', 1)[0]
227227
let config = get(g:, 'copilot_filetypes', {})
@@ -237,7 +237,7 @@ function! s:BufferDisabled() abort
237237
endfunction
238238

239239
function! copilot#Enabled() abort
240-
return !get(g:, 'copilot_disabled', 0)
240+
return get(g:, 'copilot_enabled', 1)
241241
\ && s:TermsAccepted(0)
242242
\ && empty(s:BufferDisabled())
243243
\ && empty(copilot#agent#StartupError())
@@ -575,7 +575,7 @@ function! s:EnabledStatusMessage() abort
575575
return "Neovim 0.6 prerelease required to support ghost text"
576576
elseif !copilot#IsMapped()
577577
return '<Tab> map has been disabled or is claimed by another plugin'
578-
elseif get(g:, 'copilot_disabled', 0)
578+
elseif !get(g:, 'copilot_enabled', 1)
579579
return 'Disabled globally by :Copilot disable'
580580
elseif buf_disabled is# 4
581581
return 'Disabled for current buffer by b:copilot_enabled'
@@ -745,11 +745,11 @@ function! s:commands.restart(opts) abort
745745
endfunction
746746

747747
function! s:commands.disable(opts) abort
748-
let g:copilot_disabled = 1
748+
let g:copilot_enabled = 0
749749
endfunction
750750

751751
function! s:commands.enable(opts) abort
752-
let g:copilot_disabled = 0
752+
let g:copilot_enabled = 1
753753
endfunction
754754

755755
function! s:commands.split(opts) abort

copilot/dist/agent.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/copilot.txt

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,35 @@ g:copilot_filetypes A dictionary mapping file types to their enabled
4747
\ 'python': v:true,
4848
\ }
4949
<
50-
*b:copilot_disabled*
51-
b:copilot_disabled Set to v:true to disable GitHub Copilot for the
52-
current buffer. Or set to v:false force enabling it,
53-
regardless of g:copilot_filetypes.
50+
*b:copilot_enabled*
51+
b:copilot_enabled Set to v:false to disable GitHub Copilot for the
52+
current buffer. Or set to v:true to force enabling
53+
it, overriding g:copilot_filetypes.
5454

55+
MAPS *copilot-maps*
56+
57+
Copilot.vim uses <Tab> to accept the current suggestion. If you have an
58+
existing <Tab> map, that will be used as the fallback when no suggestion is
59+
displayed.
60+
61+
*copilot#Accept()*
62+
If you'd rather use a key that isn't <Tab>, define an <expr> map that calls
63+
copilot#Accept(). Here's an example with CTRL-J:
64+
>
65+
imap <silent><script><expr> <C-J> copilot#Accept("\<CR>")
66+
let g:copilot_no_tab_map = v:true
67+
<
68+
The argument to copilot#Accept() is the fallback for when no suggestion is
69+
displayed. In this example, a regular carriage return is used. If no
70+
fallback is desired, use an argument of "" (an empty string).
71+
72+
SYNTAX HIGHLIGHTING *copilot-highlighting*
73+
74+
Inline suggestions are highlighted using the CopilotSuggestion group,
75+
defaulting to a medium gray. The best place to override this is a file named
76+
after/colors/<colorschemename>.vim in your 'runtimepath' (e.g.,
77+
~/.config/nvim/after/colors/solarized.vim). Example declaration:
78+
>
79+
highlight CopilotSuggestion guifg=#555555 ctermfg=8
80+
<
5581
vim:tw=78:et:ft=help:norl:

0 commit comments

Comments
 (0)