Skip to content

Commit

Permalink
chore: auto-generate vimdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Dec 10, 2023
1 parent b5f1e86 commit 6103c28
Showing 1 changed file with 97 additions and 57 deletions.
154 changes: 97 additions & 57 deletions doc/gp.nvim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Table of Contents *gp.nvim-table-of-contents*

- Goals and Features |gp.nvim-goals-and-features|
- Install |gp.nvim-install|
- Usage |gp.nvim-usage|
- Commands |gp.nvim-commands|
- Extend functionality |gp.nvim-extend-functionality|
Gp (GPT prompt) provides you ChatGPT like sessions and instructable text/code
operations in your favorite editor.

CHATGPT LIKE SESSIONS, INSTRUCTABLE TEXT/CODE OPERATIONS, SPEECH TO TEXT AND IMAGE GENERATION IN YOUR FAVORITE EDITOR.



Expand Down Expand Up @@ -97,25 +97,23 @@ suprised at the end of the month.

The OpenAI API key can be passed to the plugin in multiple ways:

------------------------------------------------------------------------------------------
Method Example Security
Level
------------- -------------------------------------------------------------- -------------
hardcoded openai_api_key: "sk-...", Low
string
-------------------------------------------------------------------------------------------
Method Example Security
Level
-------------- -------------------------------------------------------------- -------------
hardcoded openai_api_key: "sk-...", Low
string

default env set OPENAI_API_KEY environment variable in shell config Medium
var
default env set OPENAI_API_KEY environment variable in shell config Medium
var

custom env openai_api_key = os.getenv("CUSTOM_ENV_NAME"), Medium
var
custom env var openai_api_key = os.getenv("CUSTOM_ENV_NAME"), Medium

read from openai_api_key = { "cat", "path_to_api_key" }, Medium-High
file
read from file openai_api_key = { "cat", "path_to_api_key" }, Medium-High

password openai_api_key = { "bw", "get", "password", "OAI_API_KEY" }, High
manager
------------------------------------------------------------------------------------------
password openai_api_key = { "bw", "get", "password", "OAI_API_KEY" }, High
manager
-------------------------------------------------------------------------------------------
If `openai_api_key` is a table, Gp runs it asynchronously to avoid blocking
Neovim (password managers can take a second or two).

Expand Down Expand Up @@ -145,40 +143,87 @@ your needs.
https://github.com/Robitx/gp.nvim/blob/7d802f54fb503f27fc9722656efddb05a533f4cf/lua/gp/config.lua#L8-L350


USAGE *gp.nvim-usage*


COMMANDS ~

- Have ChatGPT experience directly in neovim:
- `:GpChatNew` - open fresh chat in the current window
(either empty or with the visual selection or specified range as a context)
- `:GpChatPaste` - paste the selection or specified range to the latest chat
(simplifies adding code from multiple files into a single chat buffer)
- `:GpChatToggle` - open chat in toggleable popup window
(the last active chat or a fresh one with selection or a range as a context)
- `:GpChatFinder` - open a dialog to search through chats
- `:GpChatRespond` - request new gpt response for the current chat
- `:GpChatRespond N` - request new gpt response with only last N messages as a context
(using everything from the end up to Nth instance of `🗨:..` => `N=1` is like asking a question in a new chat)
- `:GpChatDelete` - delete the current chat
when calling `:GpChatNew` or `:GpChatPaste` and `GpChatToggle` you can also
specify where to display chat using subcommands:
- Ask GPT and get response to the specified output:
- `:GpRewrite` - answer replaces the current line, visual selection or range
- `:GpAppend` - answers after the current line, visual selection or range
- `:GpPrepend` - answers before the current line, selection or range
- `:GpEnew` - answers into a new buffer in the current window
- `:GpNew` - answers into new horizontal split window
- `:GpVnew` - answers into new vertical split window
- `:GpTabnew` - answers into new tab
- `:GpPopup` - answers into pop up window
- `:GpImplement` - default example hook command for finishing the code
based on comments provided in visual selection or specified range
all these command work either:
- as pure user commands without any other context in normal/insert mode
- with current selection (using whole lines) as a context in visual/Visual mode
- with specified range (such as `%` for the entire current buffer => `:%GpRewrite`)
COMMANDS *gp.nvim-commands*


CHAT ~

- *gp.nvim-`:GpChatNew`*
`:GpChatNew` Open a fresh chat in the current window. It can be either empty or include the visual selection or specified range as context. This command also supports subcommands for layout specification:
- *gp.nvim-`:GpChatNew-vsplit`*
`:GpChatNew vsplit` Open a fresh chat in a vertical split window.
- *gp.nvim-`:GpChatNew-split`*
`:GpChatNew split` Open a fresh chat in a horizontal split window.
- *gp.nvim-`:GpChatNew-tab`*
`:GpChatNew tab` Open a fresh chat in a new tab.
- *gp.nvim-`:GpChatNew-popup`*
`:GpChatNew popup` Open a fresh chat in a popup window.
- *gp.nvim-`:GpChatPaste`*
`:GpChatPaste` Paste the selection or specified range into the latest chat, simplifying the addition of code from multiple files into a single chat buffer. This command also supports subcommands for layout specification:
- *gp.nvim-`:GpChatPaste-vsplit`*
`:GpChatPaste vsplit` Paste into the latest chat in a vertical split window.
- *gp.nvim-`:GpChatPaste-split`*
`:GpChatPaste split` Paste into the latest chat in a horizontal split window.
- *gp.nvim-`:GpChatPaste-tab`*
`:GpChatPaste tab` Paste into the latest chat in a new tab.
- *gp.nvim-`:GpChatPaste-popup`*
`:GpChatPaste popup` Paste into the latest chat in a popup window.
- *gp.nvim-`:GpChatToggle`*
`:GpChatToggle` Open chat in a toggleable popup window, showing the last active chat or a fresh one with selection or a range as a context. This command also supports subcommands for layout specification:
- *gp.nvim-`:GpChatToggle-vsplit`*
`:GpChatToggle vsplit` Toggle chat in a vertical split window.
- *gp.nvim-`:GpChatToggle-split`*
`:GpChatToggle split` Toggle chat in a horizontal split window.
- *gp.nvim-`:GpChatToggle-tab`*
`:GpChatToggle tab` Toggle chat in a new tab.
- *gp.nvim-`:GpChatToggle-popup`*
`:GpChatToggle popup` Toggle chat in a popup window.
- *gp.nvim-`:GpChatFinder`*
`:GpChatFinder` Open a dialog to search through chats.
- *gp.nvim-`:GpChatRespond`*
`:GpChatRespond` Request a new GPT response for the current chat.
- *gp.nvim-`:GpChatRespond-N`*
`:GpChatRespond N` Request a new GPT response with only the last N messages as context, using everything from the end up to the Nth instance of `🗨:..` (N=1 is like asking a question in a new chat).
- *gp.nvim-`:GpChatDelete`*
`:GpChatDelete` Delete the current chat.


TEXT/CODE OPERATIONS ~

- *gp.nvim-`:GpRewrite`*
`:GpRewrite` Opens a dialog for entering a prompt. After providing prompt instructions into the dialog, the generated response replaces the current line in the normal/insert mode, selected lines in visual mode, or the specified range (for example `:%GpRewrite` would apply the rewrite to the entire buffer).
- *gp.nvim-`:GpRewrite-`*
`:GpRewrite {prompt}` Executes directly with specified `{prompt}` instructions, bypassing the dialog. Suitable mapping repetitive tasks to keyboard shortcuts or for automation using headless Neovim via terminal or shell scripts.
- *gp.nvim-`:GpAppend`*
`:GpAppend` Behaves like |gp.nvim-gprewrite|, but the answer is added after the current line, visual selection, or range.
- *gp.nvim-`:GpPrepend`*
`:GpPrepend` Behaves like |gp.nvim-gprewrite|, but the answer is added before the current line, visual selection, or range.
- *gp.nvim-`:GpEnew`*
`:GpEnew` Behaves like |gp.nvim-gprewrite|, but the answer is added into a new buffer in the current window.
- *gp.nvim-`:GpNew`*
`:GpNew` Behaves like |gp.nvim-gprewrite|, but the answer is added into a new horizontal split window.
- *gp.nvim-`:GpVnew`*
`:GpVnew` Behaves like |gp.nvim-gprewrite|, but the answer is added into a new vertical split window.
- *gp.nvim-`:GpTabnew`*
`:GpTabnew` Behaves like |gp.nvim-gprewrite|, but the answer is added into a new tab.
- *gp.nvim-`:GpPopup`*
`:GpPopup` Behaves like |gp.nvim-gprewrite|, but the answer is added into a pop-up window.
- *gp.nvim-`:GpImplement`*
`:GpImplement` Example hook command for finishing the code based on comments provided in the visual selection or specified range.


OTHER ~

- *gp.nvim-`:GpContext`*
`:GpContext` Provides custom context per repository by opening `.gp.md` file for a given repository in a toggleable window. If used with selection/range, it appends it to the context file. Supports display targeting subcommands just like `GpChatNew`.
- *gp.nvim-Agent-Switching-Commands*
Agent Switching Commands Commands to switch between configured agents (model + persona), including `:GpNextAgent` to cycle between available agents, `:GpAgent` to display currently used agents, and `:GpAgent XY` to choose a new agent.
- *gp.nvim-Voice-Commands-Transcribed-by-Whisper-API*
Voice Commands Transcribed by Whisper APIIncludes `:GpWhisper` for transcriptions, as well as other `GpWhisper` commands that act as editable prompts for their equivalent non-whisper commands (`GpWhisperRewrite`, `GpWhisperAppend`, etc.).
- *gp.nvim-`:GpStop`*
`:GpStop` To stop the stream of a currently running GPT response.
- *gp.nvim-`:GpInspectPlugin`*
`:GpInspectPlugin` Inspect GPT prompt plugin object.
- Provide custom context per repository with`:GpContext`
- opens`.gp.md` file for given repository in toggable window
- if used with selection/range it appends it to the context file
Expand Down Expand Up @@ -709,11 +754,6 @@ The raw plugin text editing method `Prompt` has seven aprameters:
- `whisper`
- optional string serving as a default for input prompt (for example generated from speech by Whisper)

==============================================================================
1. Links *gp.nvim-links*

1. *image*: https://github.com/Robitx/gp.nvim/assets/8431097/350b38ce-52fb-4df7-b2a5-d6e51581f0c3

Generated by panvimdoc <https://github.com/kdheepak/panvimdoc>

vim:tw=78:ts=8:noet:ft=help:norl:

0 comments on commit 6103c28

Please sign in to comment.