From f5e8feff62424add7fce46349d1ae86d292f4658 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Mon, 27 Nov 2023 14:01:56 +0800 Subject: [PATCH] docs(config): two branch components (#161) * Update README.md * Update README.md --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c755b58..b2a5171 100644 --- a/README.md +++ b/README.md @@ -320,6 +320,8 @@ To fully customize url generation, please refer to the implementation of [router - `user`: `linrongbin16` (for this plugin), `neovim` (for [neovim](https://github.com/neovim/neovim)), etc. - `repo`: `gitlinker.nvim.git`, `neovim.git`, etc. - `rev`: git commit, e.g. `dbf3922382576391fbe50b36c55066c1768b08b6`. +- `default_branch`: git default branch, `master`, `main`, etc, retrieved from `git rev-parse --abbrev-ref origin/HEAD`. +- `current_branch`: git current branch, `feat-router-types`, etc, retrieved from `git rev-parse --abbrev-ref HEAD`. - `file`: file name, e.g. `lua/gitlinker/routers.lua`. - `lstart`/`lend`: start/end line numbers, e.g. `#L37-L156`. @@ -397,6 +399,8 @@ The available variables are the same with the `lk` parameter passing to hook fun - `_A.REPO`: `gitlinker.nvim`, `neovim`, etc. - **Note:** for easier writing, the `.git` suffix has been removed. - `_A.REV`: git commit, e.g. `dbf3922382576391fbe50b36c55066c1768b08b6`. +- `_A.DEFAULT_BRANCH`: git default branch, `master`, `main`, etc, retrieved from `git rev-parse --abbrev-ref origin/HEAD`. +- `_A.CURRENT_BRANCH`: git current branch, `feat-router-types`, etc, retrieved from `git rev-parse --abbrev-ref HEAD`. - `_A.FILE`: file name, e.g. `lua/gitlinker/routers.lua`. - `_A.LSTART`/`_A.LEND`: start/end line numbers, e.g. `#L37-L156`. @@ -459,11 +463,6 @@ GitLink default_branch GitLink current_branch ``` -Two more components are provided: - -- `lk.default_branch`(`_A.DEFAULT_BRANCH`): retrieved from `git rev-parse --abbrev-ref origin/HEAD`. -- `lk.current_branch`(`_A.CURRENT_BRANCH`): retrieved from `git rev-parse --abbrev-ref HEAD`. - ## Highlight Group | Highlight Group | Default Group | Description |