task: Add ZED_DIRNAME and ZED_RELATIVE_FILE task variables (#12245)

Release Notes:

- Added ZED_RELATIVE_FILE (path to current file relative to worktree
root) and ZED_DIRNAME (path to the directory containing current file)
task variables.
This commit is contained in:
Piotr Osiewicz 2024-05-24 16:04:24 +02:00 committed by GitHub
parent b0d89d6f34
commit 0eff1eae76
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 45 additions and 16 deletions

View file

@ -45,6 +45,8 @@ These variables allow you to pull information from the current editor and use it
- `ZED_ROW`: current line row
- `ZED_FILE`: absolute path of the currently opened file (e.g. `/Users/my-user/path/to/project/src/main.rs`)
- `ZED_FILENAME`: filename of the currently opened file (e.g. `main.rs`)
- `ZED_DIRNAME`: absolute path of the currently opened file with file name stripped (e.g. `/Users/my-user/path/to/project/src`)
- `ZED_RELATIVE_FILE`: path of the currently opened file, relative to `ZED_WORKTREE_ROOT` (e.g. `src/main.rs`)
- `ZED_STEM`: stem (filename without extension) of the currently opened file (e.g. `main`)
- `ZED_SYMBOL`: currently selected symbol; should match the last symbol shown in a symbol breadcrumb (e.g. `mod tests > fn test_task_contexts`)
- `ZED_SELECTED_TEXT`: currently selected text