This document is no longer maintained. Please visit https://aide.nicepkg.cn for the complete documentation.
To customize Aide's settings and tailor it to your workflow, follow these steps to access its configuration area:
-
Open the Settings editor:
- Press
Ctrl+,
(Windows/Linux) orCmd+,
(macOS) - Or click on the gear icon in the lower-left corner of the window to open the Settings menu. From the dropdown menu, select "Settings"
- Press
-
In the Settings window, type "aide" in the search bar at the top.You should now see all Aide-specific settings in the main panel.
This command copies selected files' contents into the clipboard, formatted as a prompt for AI interaction.
You can select some files or folders in the Explorer and right-click, then select ✨ Aide: Copy As AI Prompt
. The file content will be copied to your clipboard in the configured format.
This setting allows you to specify the template for AI prompts. The template can include some placeholders:
Template Parameters:
Parameter | Description | Usage Example |
---|---|---|
#{content} |
Placeholder for the full content of files |
|
Usage Examples:
-
Default Template:
#{content}
-
Case Example:
Here is the code snippet: #{content} Please answer the following question:
This setting allows you to specify file patterns to exclude from the AI prompt. Supports glob rules.
-
Default Value:
{ "aide.ignorePatterns": [ "**/node_modules/**", "**/.git/**", "**/__pycache__/**", "**/.Python/**", "**/.DS_Store/**", "**/.cache/**", "**/.next/**", "**/.nuxt/**", "**/.out/**", "**/dist/**", "**/.serverless/**", "**/.parcel-cache/**" ] }
-
Usage Example:
For example, to exclude the
node_modules
,.git
,dist
, andbuild
folders from the AI prompt, you can update the setting as follows:{ "aide.ignorePatterns": ["**/node_modules", "**/.git", "**/dist", "**/build"] }
This setting allows you to specify whether to respect the .gitignore
file to exclude files when copying files. default is true
.
This command prepares a custom AI command based on selected files and user input, then executes the command.
You can select some files or folders in the Explorer and right-click, then select ✨ Aide: Ask AI
. If prompted, enter your question. The configured AI command will be executed with the selected files path.
This setting allows you to specify the template for the AI command execution. The template can include some placeholders:
Template Parameters:
Parameter | Description | Usage Example |
---|---|---|
#{filesRelativePath} |
Placeholder for files' relative paths | "./src/index.ts" "./src/utils.ts" |
#{filesFullPath} |
Placeholder for files' full paths | "/project/src/index.ts" "/project/src/utils.ts" |
#{question} |
Placeholder for user input question | "What is the purpose of this code? " |
#{content} |
Placeholder for the full content of files |
|
Usage Examples:
-
Default Template:
Empty, you need to provide a custom template.
-
Case Example:
Recommended use aider (A widely acclaimed command line tool for AI) command to ask AI about the selected files:
aider #{filesRelativePath}
This setting allows you to specify whether to copy the AI command before execution.
-
Default Value:
{ "aide.aiCommandCopyBeforeRun": true }
The same as the ✨ Aide: Copy As AI Prompt
command's aide.ignorePatterns
configuration.
This setting allows you to specify file patterns to exclude from the AI prompt. Supports glob rules.
This setting allows you to specify whether to respect the .gitignore
file to exclude files when run ask ai. default is true
.
This command converts the selected code from one programming language to another using AI.
You can click on a paper-like icon in the top right corner of VS Code or right-click in the editor and select ✨ Aide: Code Convert
. You can also select specific code snippets and execute the above operations.
vscode will open a temporary text to show you the converted code.
This setting allows you to specify whether to automatically remember the language pairs used for code conversion. Default is true
.
This setting allows you to specify the language mapping for code conversion. The mapping should be in the form of sourceLanguage: targetLanguage
.
By default, the editor will remember your language mapping in the .vscode/settings.json
file under the aide.convertLanguagePairs
configuration. You can modify or add new language mappings here, such as:
{
//other settings...
"aide.convertLanguagePairs": {
"javascript": "python", // Convert javascript to python
"json": "yaml" // Convert json to yaml
}
}
Your language name should follow VSCode Language Identifiers, here are some VSCode Language Identifiers you may need:
VSCode Language Identifiers List
- abap
- bat
- bibtex
- clojure
- coffeescript
- c
- cpp
- csharp
- dockercompose
- css
- cuda-cpp
- d
- pascal
- diff
- dockerfile
- erlang
- fsharp
- git-commit
- git-rebase
- go
- groovy
- handlebars
- haml
- haskell
- html
- ini
- java
- javascript
- javascriptreact
- json
- jsonc
- julia
- latex
- less
- lua
- makefile
- markdown
- objective-c
- objective-cpp
- ocaml
- perl
- perl6
- php
- plaintext
- powershell
- jade
- pug
- python
- r
- razor
- ruby
- rust
- scss
- sass
- shaderlab
- shellscript
- slim
- sql
- stylus
- svelte
- swift
- typescript
- typescriptreact
- tex
- vb
- vue
- vue-html
- xml
- xsl
- yaml
This command adds comments to the selected code to make it readable for beginners, using AI.
Sometimes even senior developers can't understand a pile of code at once. At this time, you need some comments to help you understand. This command is to add comments to the code as much as possible to make it easier to understand.
You can click on a book-like icon in the top right corner of VS Code or right-click in the editor and select ✨ Aide: Code Viewer Helper
. You can also select specific code snippets and execute the above operations.
vscode will open a temporary text to show you the commented code.
This setting allows you to specify the template for the code viewer helper prompt. The template can include some placeholders:
Template Parameters:
Parameter | Description | Usage Example |
---|---|---|
#{sourceLanguage} |
Placeholder for the source code language | javascript |
#{locale} |
Placeholder for the user's locale/language | en |
#{content} |
Placeholder for the full content of files | const bar = "hello, aide";console.log(bar); |
Usage Examples:
-
Default Template:
You are a programming language commentator. You need to help me add comments to #{sourceLanguage} code as much as possible to make it readable for beginners. Do not change the original code, just add as detailed comments as possible, because my purpose is only to understand and read. Please use my native language #{locale} as the commenting language. Please do not reply with any text other than the code, and do not use markdown syntax. Here is the code you need to comment on: #{content}
-
Case Example:
Provide detailed comments for the following #{sourceLanguage} code, using #{locale}: #{content}
This command allows you to rename variables using AI-suggested variable names.
You can select a variable in the editor, right-click, and choose ✨ Aide: Rename Variable
. Then, you can select a suggested variable name from the list.
It uses the built-in rename symbol
feature of vscode
, which renames all references to the variable together.
This setting allows you to specify your OpenAI API key. You can get your API key from the OpenAI website
-
Default Value:
{ "aide.openaiKey": "" }
This setting allows you to specify the OpenAI model to use for AI interactions.
-
Default Value:
{ "aide.openaiModel": "gpt-4o" }
This setting allows you to specify the base URL for the OpenAI API.
-
Default Value:
{ "aide.openaiBaseUrl": "https://api.openai.com/v1" }
The commands marked with ✨ above are built-in commands of the Aide VSCode extension. It allows you to customize keyboard shortcuts to invoke these commands, which can improve your productivity in VSCode.
You can customize keyboard shortcuts for the commands in this extension to streamline your workflow. Follow these steps to set up your preferred shortcuts:
-
Open the Keyboard Shortcuts editor:
- Press
Ctrl+K Ctrl+S
(Windows/Linux) orCmd+K Cmd+S
(Mac) - Or go to File > Preferences > Keyboard Shortcuts
- Press
-
In the Keyboard Shortcuts editor, search for the command you want to customize:
- "Aide: Copy as Prompt"
- "Aide: Ask AI"
- "Aide: Code Convert"
- "Aide: Code Viewer Helper"
- ...maybe more
-
Click on the plus icon next to the command you want to assign a shortcut to.
-
Press the desired key combination for your new shortcut.
-
If there's a conflict with an existing shortcut, VSCode will notify you. You can choose to overwrite the existing shortcut or try a different combination.
Here are the default commands you can customize:
aide.copyAsPrompt
: Copy as Promptaide.askAI
: Ask AIaide.codeConvert
: Code Convertaide.codeViewerHelper
: Code Viewer Helperaide.renameVariable
: Rename Variable- ...maybe more
Example:
To set Ctrl+Shift+A
(Windows/Linux) or Cmd+Shift+A
(Mac) for the "Ask AI" command:
- Search for "Aide:Ask AI" in the Keyboard Shortcuts editor
- Click the plus icon next to the "aide.askAI" command
- Press
Ctrl+Shift+A
orCmd+Shift+A
- The new shortcut will be saved automatically
Repeat this process for any other commands you wish to customize.
Note: If you prefer to edit the keybindings.json
file directly, you can add entries like this:
{
"key": "ctrl+shift+a",
"command": "aide.askAI",
"when": "editorTextFocus"
}
Replace "ctrl+shift+a"
with your desired key combination and "aide.askAI"
with the command you want to assign.
By customizing these shortcuts, you can quickly access the extension's features and improve your productivity in VSCode.