mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-25 19:03:30 +04:00
renaming git_repo to repo
This commit is contained in:
parent
c0666d1219
commit
d3927d8da3
@ -12,10 +12,10 @@ ## Using variables in typed commands and mapped shortcuts
|
|||||||
| `%{basename}` or `%{b}` | The name and extension of the currently focused file. |
|
| `%{basename}` or `%{b}` | The name and extension of the currently focused file. |
|
||||||
| `%{dirname}` or `%{d}` | The absolute path of the parent directory of the currently focused file. |
|
| `%{dirname}` or `%{d}` | The absolute path of the parent directory of the currently focused file. |
|
||||||
| `%{cwd}` | The absolute path of the current working directory of Helix. |
|
| `%{cwd}` | The absolute path of the current working directory of Helix. |
|
||||||
| `%{git_repo}` | The absolute path of the git repository helix is opened in. Fallback to `cwd` if not inside a git repository|
|
| `%{repo}` | The absolute path of the VCS repository helix is opened in. Fallback to `cwd` if not inside a VCS repository|
|
||||||
| `%{filename}` or `%{f}` | The absolute path of the currently focused file. |
|
| `%{filename}` or `%{f}` | The absolute path of the currently focused file. |
|
||||||
| `%{filename:rel}` | The relative path of the file according to `cwd` (will give absolute path if the file is not a child of the current working directory) |
|
| `%{filename:rel}` | The relative path of the file according to `cwd` (will give absolute path if the file is not a child of the current working directory) |
|
||||||
| `%{filename:git_rel}` | The relative path of the file according to `git_repo` (will give absolute path if the file is not a child of the git directory or the cwd) |
|
| `%{filename:repo_rel}` | The relative path of the file according to `repo` (will give absolute path if the file is not a child of the VCS directory or the cwd) |
|
||||||
| `%{ext}` | The extension of the current file |
|
| `%{ext}` | The extension of the current file |
|
||||||
| `%{lang}` | The language of the current file |
|
| `%{lang}` | The language of the current file |
|
||||||
| `%{linenumber}` | The line number where the primary cursor is positioned. |
|
| `%{linenumber}` | The line number where the primary cursor is positioned. |
|
||||||
|
@ -53,8 +53,8 @@ pub fn expand_variable_in_string<'a>(&self, input: &'a str) -> anyhow::Result<Co
|
|||||||
.and_then(|it| it.to_str())
|
.and_then(|it| it.to_str())
|
||||||
.unwrap_or(crate::document::SCRATCH_BUFFER_NAME)
|
.unwrap_or(crate::document::SCRATCH_BUFFER_NAME)
|
||||||
.to_owned(),
|
.to_owned(),
|
||||||
"filename:git_rel" => {
|
"filename:repo_rel" => {
|
||||||
// This will get git repo root or cwd if not inside a git repo.
|
// This will get repo root or cwd if not inside a git repo.
|
||||||
let workspace_path = helix_loader::find_workspace().0;
|
let workspace_path = helix_loader::find_workspace().0;
|
||||||
doc.path()
|
doc.path()
|
||||||
.and_then(|p| {
|
.and_then(|p| {
|
||||||
@ -80,7 +80,7 @@ pub fn expand_variable_in_string<'a>(&self, input: &'a str) -> anyhow::Result<Co
|
|||||||
.and_then(std::path::Path::to_str)
|
.and_then(std::path::Path::to_str)
|
||||||
.unwrap_or(crate::document::SCRATCH_BUFFER_NAME)
|
.unwrap_or(crate::document::SCRATCH_BUFFER_NAME)
|
||||||
.to_owned(),
|
.to_owned(),
|
||||||
"git_repo" => helix_loader::find_workspace()
|
"repo" => helix_loader::find_workspace()
|
||||||
.0
|
.0
|
||||||
.to_str()
|
.to_str()
|
||||||
.unwrap_or("")
|
.unwrap_or("")
|
||||||
|
Loading…
Reference in New Issue
Block a user