-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
does it need to be empty i see idk force update through readme chore(docs): generate vimdoc continue working towards release auto generate vimdoc retry luacheck okay ci done mayhapsd auto generate vimdoc fixup
- Loading branch information
Showing
9 changed files
with
276 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Generate documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'README.md' | ||
- 'lua/**' | ||
- 'plugin/**' | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
generate-docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Generate Vim documentation | ||
uses: kdheepak/panvimdoc@main | ||
with: | ||
vimdoc: browsher | ||
pandoc: "README.md" | ||
toc: true | ||
demojify: true | ||
|
||
- name: Commit and push changes | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: 'auto generate vimdoc' | ||
branch: ${{ github.ref }} | ||
file_pattern: doc/browsher.txt | ||
commit_user_name: 'github-actions[bot]' | ||
commit_user_email: 'github-actions[bot]@users.noreply.github.com' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
lint: | ||
name: Lint and Format Check | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Luacheck | ||
uses: lunarmodules/[email protected] | ||
with: | ||
args: lua/ plugin/ | ||
|
||
- name: Run Stylua | ||
uses: JohnnyMorganz/stylua-action@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
version: latest | ||
args: --check . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
globals = { 'vim' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
repos: | ||
- repo: local | ||
hooks: | ||
- id: stylua-system | ||
name: StyLua (system) | ||
description: An opinionated Lua code formatter | ||
entry: stylua | ||
language: system | ||
types: | ||
- lua |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,198 @@ | ||
*browsher.txt* For NVIM v0.8.0 Last change: 2024 November 24 | ||
|
||
============================================================================== | ||
Table of Contents *browsher-table-of-contents* | ||
|
||
1. browsher.nvim |browsher-browsher.nvim| | ||
2. Features |browsher-features| | ||
3. Installation |browsher-installation| | ||
4. Configuration |browsher-configuration| | ||
- Key Mappings |browsher-configuration-key-mappings| | ||
5. Usage |browsher-usage| | ||
6. Examples |browsher-examples| | ||
7. Notes |browsher-notes| | ||
|
||
============================================================================== | ||
1. browsher.nvim *browsher-browsher.nvim* | ||
|
||
`browsher.nvim` is a highly customizable Neovim plugin that opens the current | ||
file at the specified lines or range in your default browser, pinned to a | ||
specific branch, tag, commit, or the repository root in your remote Git | ||
repository. | ||
|
||
|
||
============================================================================== | ||
2. Features *browsher-features* | ||
|
||
- **Open files in the browser**Quickly open the current file in your remote Git repository’s web interface. | ||
- **Line and Range Support**Supports opening specific lines or ranges, including multiline selections from visual mode. | ||
- **Customizable providers**Support for GitHub, GitLab, and the ability to specify custom git web interfaces. | ||
- **Custom open commands**Specify custom commands to open URLs (e.g., use a specific browser). | ||
|
||
|
||
============================================================================== | ||
3. Installation *browsher-installation* | ||
|
||
Using lazy.nvim <https://github.com/folke/lazy.nvim> | ||
|
||
>lua | ||
{ | ||
'claydugo/browsher.nvim', | ||
event = "VeryLazy", | ||
config = function() | ||
-- Specify empty to use below default options | ||
require('browsher').setup() | ||
end | ||
} | ||
< | ||
|
||
Using packer.nvim <https://github.com/wbthomason/packer.nvim> | ||
|
||
>lua | ||
use { 'claydugo/browsher.nvim' } | ||
< | ||
|
||
|
||
============================================================================== | ||
4. Configuration *browsher-configuration* | ||
|
||
You can customize `browsher.nvim` by passing options to the setup function, | ||
below are the default options. | ||
|
||
|
||
DEFAULT OPTIONS | ||
|
||
>lua | ||
require("browsher").setup({ | ||
--- Default remote name (e.g., 'origin'). | ||
default_remote = nil, | ||
--- Default branch name. | ||
default_branch = nil, | ||
--- Default pin type ('commit', 'branch', or 'tag'). | ||
default_pin = "commit", | ||
--- Length of the commit hash to use in URLs. If nil, use full length. (40) | ||
commit_length = nil, | ||
--- Allow line numbers with uncommitted changes. | ||
allow_line_numbers_with_uncommitted_changes = false, | ||
--- Command to open URLs (e.g., 'firefox'). | ||
open_cmd = nil, | ||
--- Custom providers for building URLs. | ||
--- | ||
--- Each provider is a table with the following keys: | ||
--- - `url_template`: The URL template, where `%s` are placeholders. | ||
--- The placeholders are, in order: | ||
--- 1. Remote URL | ||
--- 2. Branch or tag | ||
--- 3. Relative file path | ||
--- - `single_line_format`: Format string for a single line (e.g., `#L%d`). | ||
--- - `multi_line_format`: Format string for multiple lines (e.g., `#L%d-L%d`). | ||
--- | ||
--- Example: | ||
--- ```lua | ||
--- providers = { | ||
--- ["mygit.com"] = { | ||
--- url_template = "%s/src/%s/%s", | ||
--- single_line_format = "?line=%d", | ||
--- multi_line_format = "?start=%d&end=%d", | ||
--- }, | ||
--- } | ||
providers = { | ||
["github.com"] = { | ||
url_template = "%s/blob/%s/%s", | ||
single_line_format = "#L%d", | ||
multi_line_format = "#L%d-L%d", | ||
}, | ||
["gitlab.com"] = { | ||
url_template = "%s/-/blob/%s/%s", | ||
single_line_format = "#L%d", | ||
multi_line_format = "#L%d-%d", | ||
}, | ||
}, | ||
}) | ||
< | ||
|
||
|
||
KEY MAPPINGS *browsher-configuration-key-mappings* | ||
|
||
Add the following key mappings to your Neovim configuration to quickly open | ||
files in the browser: | ||
|
||
>lua | ||
-- Open from the latest commit, the recommended default operation | ||
vim.api.nvim_set_keymap('n', '<leader>b', '<cmd>Browsher commit<CR>', { noremap = true, silent = true }) | ||
vim.api.nvim_set_keymap('v', '<leader>b', ":'<,'>Browsher commit<CR>gv", { noremap = true, silent = true }) | ||
|
||
-- Open from the latest tag, for more human readable urls (with risk of outdated line numbers) | ||
vim.api.nvim_set_keymap('n', '<leader>B', '<cmd>Browsher tag<CR>', { noremap = true, silent = true }) | ||
vim.api.nvim_set_keymap('v', '<leader>B', ":'<,'>Browsher tag<CR>gv", { noremap = true, silent = true }) | ||
< | ||
|
||
|
||
============================================================================== | ||
5. Usage *browsher-usage* | ||
|
||
Use the `:Browsher` command to open the current file in your browser: | ||
|
||
> | ||
:Browsher [pin_type] [commit_hash] | ||
< | ||
|
||
- `pin_type` (optional): Specifies how to pin the file in the URL. Can be `branch`, `tag`, or `commit`. | ||
If omitted, uses the default pin type from the configuration (`commit` by default). | ||
- `commit_hash` (optional): Specific commit hash to use when `pin_type` is `commit`. | ||
|
||
|
||
============================================================================== | ||
6. Examples *browsher-examples* | ||
|
||
Open current file at the latest commit: | ||
|
||
> | ||
:Browsher | ||
< | ||
|
||
Open the repository root URL: | ||
|
||
> | ||
:Browsher root | ||
< | ||
|
||
Open current file at the current branch: | ||
|
||
> | ||
:Browsher branch | ||
< | ||
|
||
Open current file at the latest tag: | ||
|
||
> | ||
:Browsher tag | ||
< | ||
|
||
Open current file at a specific commit: | ||
|
||
> | ||
:Browsher commit 123abc | ||
< | ||
|
||
Open a visual selection of lines: | ||
|
||
> | ||
:'<,'>Browsher commit | ||
< | ||
|
||
Select lines in visual mode and run: | ||
|
||
> | ||
:Browsher | ||
< | ||
|
||
|
||
============================================================================== | ||
7. Notes *browsher-notes* | ||
|
||
- **Uncommitted Changes**If the current file has uncommitted changes, line numbers may not correspond to what’s on the remote repository. By default, line numbers are omitted when there are uncommitted changes unless `allow_line_numbers_with_uncommitted_changes` is set to true. | ||
|
||
Generated by panvimdoc <https://github.com/kdheepak/panvimdoc> | ||
|
||
vim:tw=78:ts=8:noet:ft=help:norl: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters