mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-01 04:44:31 +02:00
plugins/chatgpt: init
This commit is contained in:
parent
9b25eaaa6f
commit
92e9f5466d
3 changed files with 356 additions and 0 deletions
78
plugins/ai/chatgpt.nix
Normal file
78
plugins/ai/chatgpt.nix
Normal file
|
@ -0,0 +1,78 @@
|
|||
{
|
||||
lib,
|
||||
helpers,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
helpers.neovim-plugin.mkNeovimPlugin config {
|
||||
name = "chatgpt";
|
||||
originalName = "ChatGPT.nvim";
|
||||
defaultPackage = pkgs.vimPlugins.ChatGPT-nvim;
|
||||
|
||||
maintainers = [ maintainers.GaetanLepage ];
|
||||
|
||||
extraOptions = {
|
||||
curlPackage = helpers.mkPackageOption {
|
||||
name = "curl";
|
||||
default = pkgs.curl;
|
||||
};
|
||||
};
|
||||
|
||||
extraConfig = cfg: { extraPackages = [ cfg.curlPackage ]; };
|
||||
|
||||
settingsOptions = {
|
||||
api_key_cmd = helpers.defaultNullOpts.mkStr null ''
|
||||
The path and arguments to an executable that returns the API key via stdout.
|
||||
'';
|
||||
|
||||
yank_register = helpers.defaultNullOpts.mkStr "+" ''
|
||||
Which register to use for copying.
|
||||
'';
|
||||
|
||||
extra_curl_params = helpers.defaultNullOpts.mkListOf' {
|
||||
type = types.str;
|
||||
pluginDefault = null;
|
||||
description = ''
|
||||
Custom cURL parameters can be passed using this option.
|
||||
It can be useful if you need to include additional headers for requests.
|
||||
'';
|
||||
example = [
|
||||
"-H"
|
||||
"Origin: https://example.com"
|
||||
];
|
||||
};
|
||||
|
||||
show_line_numbers = helpers.defaultNullOpts.mkBool true ''
|
||||
Whether to show line numbers in the ChatGPT window.
|
||||
'';
|
||||
};
|
||||
|
||||
settingsExample = {
|
||||
welcome_message = "Hello world";
|
||||
loading_text = "loading";
|
||||
question_sign = "";
|
||||
answer_sign = "ﮧ";
|
||||
max_line_length = 120;
|
||||
yank_register = "+";
|
||||
chat_layout = {
|
||||
relative = "editor";
|
||||
position = "50%";
|
||||
};
|
||||
openai_params = {
|
||||
model = "gpt-3.5-turbo";
|
||||
frequency_penalty = 0;
|
||||
presence_penalty = 0;
|
||||
max_tokens = 300;
|
||||
};
|
||||
openai_edit_params = {
|
||||
model = "code-davinci-edit-001";
|
||||
temperature = 0;
|
||||
};
|
||||
keymaps = {
|
||||
close = [ "<C-c>" ];
|
||||
submit = "<C-s>";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue