Skip to content

A-23187/zed-bookmark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zed-Bookmark

Zed-bookmark is a lightweight bookmark extension for the Zed editor, let you quickly add, manage bookmarks, and jump from bookmarks to source positions.

Features

  • Add bookmarks for the current cursor positions
  • Manage bookmarks all bookmarks are stored in .zed/bookmarks.txt, manage them in the same way you edit the file
  • Go to source position to jump from a bookmark to its source position, this is done by a custom language server
  • Stale bookmark detection indicated via diagnostics (yellow squiggly underline) when a bookmark cannot be resolved

zed-bookmark

Setup

  1. Install the extension from the Zed extension marketplace
  2. Enable the bookmark language server by adding the following to your .zed/settings.json (or ~/.config/zed/settings.json for all workspaces)
{
  "languages": {
    "Plain Text": {
      "language_servers": ["bookmark-language-server"]
    }
  },
}
  1. Add the following tasks to your .zed/tasks.json (or ~/.config/zed/tasks.json for all workspaces)
[
  {
    "label": "Bookmark: Add bookmark",
    "command": "read -e -i \"$(sed -n \"${ZED_ROW}p\" \"${ZED_RELATIVE_FILE}\")\" && echo -e \"\\n$REPLY\\n${ZED_RELATIVE_FILE}:$((${ZED_ROW} - 1)):$((${ZED_COLUMN} - 1))\" >> .zed/bookmarks.txt",
    "env": {},
    "hide": "on_success",
    "reveal": "always"
  },
  {
    "label": "Bookmark: Find bookmark",
    "command": "zed",
    "args": [".zed/bookmarks.txt"],
    "env": {},
    "hide": "always",
    "reveal": "never"
  }
]
  1. (Optional) Bind your custom key bindings to the tasks added previously, by editing .zed/keymap.json (or ~/.config/zed/keymap.json for all workspaces). For example:
[
  {
    "context": "Workspace",
    "bindings": {
      "alt-m": ["task::Spawn", { "task_name": "Bookmark: Add bookmark" }]
    }
  }
]

License

Apache 2.0

About

zed bookmark extension

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published