1
0
Fork 0
mirror of https://github.com/NotAShelf/neovim-flake.git synced 2024-12-27 18:39:48 +01:00
neovim-flake/modules/plugins/assistant/chatgpt/chatgpt.nix
2024-04-21 05:20:31 +03:00

25 lines
1.3 KiB
Nix

{lib, ...}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.binds) mkMappingOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.assistant.chatgpt = {
enable = mkEnableOption "ChatGPT AI assistant. Requires the environment variable OPENAI_API_KEY to be set";
setupOpts = mkPluginSetupOption "chatgpt" {};
mappings = {
chatGpt = mkMappingOption "ChatGPT" "<leader>ac";
editWithInstructions = mkMappingOption "[ChatGPT] Edit with instructions" "<leader>ae";
grammarCorrection = mkMappingOption "[ChatGPT] Grammar correction" "<leader>ag";
translate = mkMappingOption "[ChatGPT] Translate" "<leader>at";
keyword = mkMappingOption "[ChatGPT] Keywords" "<leader>ak";
docstring = mkMappingOption "[ChatGPT] Docstring" "<leader>ad";
addTests = mkMappingOption "[ChatGPT] Add tests" "<leader>aa";
optimize = mkMappingOption "[ChatGPT] Optimize code" "<leader>ao";
summarize = mkMappingOption "[ChatGPT] Summarize" "<leader>as";
fixBugs = mkMappingOption "[ChatGPT] Fix bugs" "<leader>af";
explain = mkMappingOption "[ChatGPT] Explain code" "<leader>ax";
roxygenEdit = mkMappingOption "[ChatGPT] Roxygen edit" "<leader>ar";
readabilityanalysis = mkMappingOption "[ChatGPT] Code reability analysis" "<leader>al";
};
};
}