Based on a few weeks of using vim-copilot
, I recommend the
following:
-
Enable Copilot for the
gitcommit
,markdown
andyaml
filetypes:let g:copilot_filetypes = { \ 'gitcommit': v:true, \ 'markdown': v:true, \ 'yaml': v:true \ }
By default, these and few others are disabled but I’ve found them to be useful. It’s often amusing to see Copilot’s attempts to complete your commit messages.
-
Disable Copilot for large files as it can be slow and impair the editing experience:
autocmd BufReadPre * \ let f=getfsize(expand("<afile>")) \ | if f > 100000 || f == -2 \ | let b:copilot_enabled = v:false \ | endif
This autocommand disables Copilot for files larger than 100KB. See my related TIL post for more details on this.