diff options
author | Teddy Wing | 2023-12-07 22:34:35 +0100 |
---|---|---|
committer | Teddy Wing | 2023-12-07 22:40:24 +0100 |
commit | dd6f787ea345e47f2aecb49e07439e688867dc85 (patch) | |
tree | 30d234df5cd8e3323a101fc4c8454558f8681cc2 | |
parent | b988faedc985ed08aaf5bb34f67af2b2f270cf16 (diff) | |
download | dotvim-dd6f787ea345e47f2aecb49e07439e688867dc85.tar.bz2 |
after/plugin/copilot.vim: Add mappings for GitHub Copilot
Set up custom insert mappings for GitHub Copilot based on what makes
sense to me and inspired by the existing i_^x Vim completion mappings.
-rw-r--r-- | after/plugin/copilot.vim | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/after/plugin/copilot.vim b/after/plugin/copilot.vim new file mode 100644 index 0000000..ac5ade6 --- /dev/null +++ b/after/plugin/copilot.vim @@ -0,0 +1,23 @@ +if !exists('g:loaded_copilot') + finish +endif + +imap <silent><script><expr> <C-g><C-y> copilot#Accept("\<CR>") + +imap <C-g>e <Plug>(copilot-dismiss) +imap <C-g><C-e> <Plug>(copilot-dismiss) + +imap <C-g>n <Plug>(copilot-next) +imap <C-g><C-n> <Plug>(copilot-next) + +imap <C-g>p <Plug>(copilot-previous) +imap <C-g><C-p> <Plug>(copilot-previous) + +imap <C-g>g <Plug>(copilot-suggest) +imap <C-g><C-g> <Plug>(copilot-suggest) + +imap <C-g>w <Plug>(copilot-accept-word) +imap <C-g><C-w> <Plug>(copilot-accept-word) + +imap <C-g>l <Plug>(copilot-accept-line) +imap <C-g><C-l> <Plug>(copilot-accept-line) |