DEV Community

John  Ajera
John Ajera

Posted on

Generating Permalinks in VS Code Using hogashi.vscode-copy-github-permalink

Generating Permalinks in VS Code Using hogashi.vscode-copy-github-permalink

If you're looking for a quick and easy way to generate GitHub permalinks without complicated setups, the hogashi.vscode-copy-github-permalink extension is a great choice. It’s lightweight, easy to use, and seamlessly integrates with Visual Studio Code, saving you time when you need to share links to specific lines or files in your GitHub repository.

Install the Extension

Follow these steps:

  1. Open VS Code.
  2. Go to the Extensions view by clicking on the Extensions icon in the Activity Bar or pressing Ctrl+Shift+X (or Cmd+Shift+X on macOS).
  3. Search for hogashi.vscode-copy-github-permalink.
  4. Click Install to add the extension to your setup.

Copy GitHub Permalinks

Here’s how to copy GitHub permalinks for files in your repository:

  1. Open a file that is tracked in your GitHub repository.
  2. Right-click inside the file and select one of the following options:
    • Copy GitHub Permalink: This generates a permalink for the selected line(s) in the file.
    • Copy GitHub Permalink (HEAD): This generates a link using the latest commit (HEAD) for the file.

Now, you can paste the generated link wherever you need it—whether in a pull request, issue, or message to colleagues.

Keyboard Shortcuts for Faster Workflow

Assigning custom keyboard shortcuts:

  1. Open the Command Palette by pressing Ctrl+Shift+P (or Cmd+Shift+P on macOS).
  2. Search for Keyboard Shortcuts and open the editor.
  3. Find Copy GitHub Permalink and Copy GitHub Permalink (HEAD) in the list.
  4. Assign a custom keyboard shortcut (e.g., Ctrl+Alt+C for faster access).

This way, you won’t even need to use the right-click menu.

Why Use This Extension?

The hogashi.vscode-copy-github-permalink extension is designed specifically for generating GitHub permalinks, and here’s why it’s a great choice:

  • Lightweight: It doesn’t come with a lot of unnecessary features, just the ability to create permalinks quickly.
  • Automatic Line Numbers: The generated permalinks automatically include the line numbers, so anyone with the link can directly access the specific code.
  • Seamless Integration: It integrates perfectly into VS Code and requires no extra manual steps or configuration.

Using this extension simplifies permalink generation in your Git workflows, saving you time and reducing friction.

With this extension, you can easily share specific lines of code from your repository without any complicated manual setup or copying URLs manually from GitHub. Whether you’re working with teammates or sharing code snippets publicly, this tool is a great productivity booster. Happy coding!

Top comments (0)