Skip to content

A vscode extension inspired by the neovim plugin Harpoon created by The Primeagen

License

Notifications You must be signed in to change notification settings

petkaantonov/vscode-harpoon

 
 

Repository files navigation

VS Code Harpoon

VS Code Harpoon is inspired by The Primeagen's Harpoon plugin for neovim. It supports the basic use case of file navigation just like with Harpoon.

GitHub License: MIT

Features

VSCode Harpoon is a file navigation tool, which lets you mark editors and jump to your marked editors.

When adding your first editor, it will be set as editor 1, the next editor 2 and so on.

You are then able to jump to editor 1 or editor 2 from anywhere in your workspace.

Navigation Example

Available Commands

  • VSCode Harpoon: Add Editor (vscode-harpoon.addEditor) adds the current editor to your workspace
  • VSCode Harpoon: Add Editor [1-9] (vscode-harpoon.addEditor[1-9]) adds the editor at the specified index
  • VSCode Harpoon: Go to editor [1-9] (vscode-harpoon.gotoEditor[1-9]) Goes to workspace editor [1-9]
  • VSCode Harpoon: Edit Editors (vscode-harpoon.editEditors) Opens an editor for you do delete or move added editors around.
  • VSCode Harpoon: Editor Quick Pick (vscode-harpoon.editorQuickPick) Opens a quick pick menu to pick between your current workspace editors
  • VSCode Harpoon: Add Global Editor (vscode-harpoon.addGlobalEditor) adds the current editor globally
  • VSCode Harpoon: Add Global Editor [1-9] (vscode-harpoon.addGlobalEditor[1-9]) adds the editor globally at the specified index
  • VSCode Harpoon: Go to global editor [1-9] (vscode-harpoon.gotoGlobalEditor[1-9]) Goes to global editor [1-9]
  • VSCode Harpoon: Edit Global Editors (vscode-harpoon.editGlobalEditors) Opens an editor for you do delete or move added editors around.
  • VSCode Harpoon: Editor Global Quick Pick (vscode-harpoon.editorGlobalQuickPick) Opens a quick pick menu to pick between your global editors

Troubleshooting

If desired the extension does support jumping to already open editors in different split panes. However, for this to work you need to add a property to your settings.json:

{
  "workbench.editor.revealIfOpen": true
}

Example Keybinds

VSCode (keybindings.json)

[
  {
    "key": "alt+a",
    "commands": ["vscode-harpoon.addEditor"]
  },
  {
    "key": "alt+e",
    "commands": ["vscode-harpoon.editEditors"]
  },
  {
    "key": "alt+p",
    "commands": ["vscode-harpoon.editorQuickPick"]
  },
  {
    "key": "alt+1",
    "command": "vscode-harpoon.gotoEditor1"
  }
]

VSCode Vim (settings.json)

{
  "vim.leader": " ",
  "vim.normalModeKeyBindings": [
    {
      "before": ["<leader>", "a"],
      "commands": ["vscode-harpoon.addEditor"]
    },
    {
      "before": ["<leader>", "e"],
      "commands": ["vscode-harpoon.editEditors"]
    },
    {
      "before": ["<leader>", "p", "e"],
      "commands": ["vscode-harpoon.editorQuickPick"]
    },
    {
      "before": ["<leader>", "1"],
      "commands": ["vscode-harpoon.gotoEditor1"]
    }
  ]
}

Issues

Looking to contribute? Please read the CONTRIBUTING.md file, which contains information about making a PR.

Any feedback is very appreciated!

🪲 Bugs

Please file an issue for bugs, missing documentation, unexpected behavior etc.

Create bug report

🕯 Feature Requests

Please file an issue to suggest new features. Vote on feature requests by adding a 👍.

Create Feature Requests

About

A vscode extension inspired by the neovim plugin Harpoon created by The Primeagen

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 87.4%
  • JavaScript 12.4%
  • Shell 0.2%