Skip to content

lovebirdsx/efficiency

Repository files navigation

README

Some useful functions for efficiency.

1. English & Chinese Punctuation

  • Efficiency: Convert To English Punctuation: Converts all punctuation to English punctuation
  • Efficiency: Convert To Chinese Punctuation: Converts all punctuation to Chinese punctuation

2. Markdown Helper

  • Efficiency: Generate Markdown Table:

Convert selected text to a Markdown table or generate a default table. e.g., Select Text Name, Age will change it to the following:

| Name | Age |
| ---- | --- |
|      |     |

3. File Merge

  • Merge multiple files into one file, which is useful for providing context for Ask AI.
  • Combined with this Google Chrome extension chatgpt-cli-extension to query ChatGPT with multiple files.

Settings:

  • efficiency.openAfterMerge: Open the merged file after merging; default is true
  • efficiency.shellAfterMerge: Shell to execute after merging paths. Leave empty to disable. ${file} will be replaced with the merged file path.

Commands:

  • Efficiency: Create Merge Config File: Create a merge configuration file for the Merge Paths To Single File command.
  • Efficiency: Merge Paths To Single File: Merge all paths in the configuration file into a single file.

4. Misc

4.1. Open External Shell

Settings:

  • efficiency.defaultShell: Default shell command to open an external terminal; default is sh.exe --login -i

Commands:

  • efficiency.openExternalShellByWorkspaceFolder: Open an external shell by workspace folder
  • efficiency.openExternalShellByCurrentFile: Open an external shell by current file

4.2. Execute Shell Command

Bind a shell command to a keybinding, for example:

{
  "key": "alt+shift+1",
  "command": "efficiency.execShellCommand",
  "args": {
    "silent": true,
    "shell": "echo ${file}"
  }
}

Supported variables:

Name Description
${workspaceFolder} The workspace folder of the current file
${file} The current file path
${fileDirname} The current file’s directory
${fileBasename} The current file name
${fileBasenameNoExtension} The current file name without extension
${selectionFile} The file which contains the selected text
${selection} The selected text or the text expanded at cursor

4.3. Auto Change Windows Path Separator

Automatically change the Windows path separator when pasting paths.

Settings:

  • efficiency.pastePathConvert.enabled: Enable automatic change of the path separator when pasting paths; default is true

4.4. Custom Shell Command List

  • Configure efficiency.customShellCommands in settings. Example:
"efficiency.customShellCommands": [
  {
    "name": "Open Notepad",
    "description": "Open Notepad",
    "shell": "notepad.exe",
    "silent": true
  },
  {
    "name": "Open Shell by Current Workspace Folder",
    "description": "Open shell by current workspace folder",    
    "shell": "pwsh.exe -NoLogo -Command \"cd ${workspaceFolder};\"",
  }
]
  • Run command: Efficiency: Show Custom Shell Command List

5. Source Control Change Navigation

Quickly jump between modified files in the Source Control panel without using the mouse. Works with VS Code's built-in Git extension and covers all change groups: Merge Changes, Staged Changes, Changes (modified working-tree files), and Untracked files. Navigation wraps around when you reach either end of the list.

Commands:

  • Efficiency: Open Next Change Diff: Open the diff view of the next changed file
  • Efficiency: Open Previous Change Diff: Open the diff view of the previous changed file

Default keybindings:

Key Command
Ctrl+Alt+PageDown efficiency.openNextChangeDiff
Ctrl+Alt+PageUp efficiency.openPreviousChangeDiff

The "current file" is determined from the active editor; if the active file is not in the change list, Next starts from the first change and Previous starts from the last.

6. Claude Plans Browser

Quickly browse and open plan files generated by Claude Code. The command scans the top-level .md files under ~/.claude/plans/ (on Windows: %USERPROFILE%\.claude\plans\), lists them in a QuickPick sorted by modification time (newest first), and opens the selected one in Markdown Preview.

Commands:

  • Efficiency: Show Claude Plans: Show the QuickPick of plan files and preview the selected one.

Third-party Markdown Preview compatibility:

If a known third-party Markdown preview extension is installed, it is used to render the preview; otherwise the built-in markdown.showPreview is used. Currently recognized:

Releases

No releases published

Packages

 
 
 

Contributors