-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace ChatGPT with CopilotChat in Neovim
- Loading branch information
1 parent
87d4983
commit d0ed10f
Showing
4 changed files
with
104 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
local select = require('CopilotChat.select') | ||
local actions = require("CopilotChat.actions") | ||
-- local prompts = require("CopilotChat.prompts") | ||
|
||
|
||
require("CopilotChat").setup { | ||
debug = true, -- Enable debugging | ||
|
||
model = 'gpt-4', -- GPT model to use, 'gpt-3.5-turbo' or 'gpt-4' | ||
temperature = 0.1, -- GPT temperature | ||
|
||
prompts = { | ||
Explain = { | ||
prompt = '/COPILOT_EXPLAIN カーソル上のコードの説明を段落をつけて書いてください。', | ||
}, | ||
Tests = { | ||
prompt = '/COPILOT_TESTS カーソル上のコードの詳細な単体テスト関数を書いてください。', | ||
}, | ||
Fix = { | ||
prompt = '/COPILOT_FIX このコードには問題があります。バグを修正したコードに書き換えてください。', | ||
}, | ||
Optimize = { | ||
prompt = '/COPILOT_REFACTOR 選択したコードを最適化し、パフォーマンスと可読性を向上させてください。', | ||
}, | ||
Docs = { | ||
prompt = '/COPILOT_REFACTOR 選択したコードのドキュメントを書いてください。ドキュメントをコメントとして追加した元のコードを含むコードブロックで回答してください。使用するプログラミング言語に最も適したドキュメントスタイルを使用してください(例:JavaScriptのJSDoc、Pythonのdocstringsなど)', | ||
}, | ||
FixDiagnostic = { | ||
prompt = 'ファイル内の次のような診断上の問題を解決してください:', | ||
selection = select.diagnostics, | ||
} | ||
}, | ||
|
||
-- default window options | ||
window = { | ||
layout = 'vertical', -- 'vertical', 'horizontal', 'float', 'replace' | ||
width = 0.3, -- fractional width of parent, or absolute width in columns when > 1 | ||
height = 0.3, -- fractional height of parent, or absolute height in rows when > 1 | ||
-- Options below only apply to floating windows | ||
relative = 'editor', -- 'editor', 'win', 'cursor', 'mouse' | ||
border = 'single', -- 'none', single', 'double', 'rounded', 'solid', 'shadow' | ||
row = nil, -- row position of the window, default is centered | ||
col = nil, -- column position of the window, default is centered | ||
title = 'Copilot Chat', -- title of chat window | ||
footer = nil, -- footer of chat window | ||
zindex = 1, -- determines if window is on top or below other floating windows | ||
}, | ||
|
||
-- default mappings | ||
mappings = { | ||
complete = { | ||
detail = 'Use @<Tab> or /<Tab> for options.', | ||
insert = '<Tab>', | ||
}, | ||
close = { | ||
normal = 'q', | ||
insert = '<C-c>' | ||
}, | ||
reset = { | ||
normal = '<C-l>', | ||
insert = '<C-l>' | ||
}, | ||
submit_prompt = { | ||
normal = '<CR>', | ||
insert = '<C-m>' | ||
}, | ||
accept_diff = { | ||
normal = '<C-y>', | ||
insert = '<C-y>' | ||
}, | ||
yank_diff = { | ||
normal = 'gy', | ||
}, | ||
show_diff = { | ||
normal = 'gd' | ||
}, | ||
show_system_prompt = { | ||
normal = 'gp' | ||
}, | ||
show_user_selection = { | ||
normal = 'gs' | ||
}, | ||
}, | ||
|
||
} | ||
|
||
function ShowCopilotChatActionPrompt() | ||
require("CopilotChat.integrations.telescope").pick(actions.prompt_actions()) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters