2022-09-27 02:23:14 +03:00
|
|
|
# openingh.nvim
|
2022-09-27 02:22:34 +03:00
|
|
|
Opens the current project or file page in GitHub.
|
|
|
|
|
- Features
|
|
|
|
|
- Supports MacOS, Linux, and maybe Windows 🤷♂️
|
|
|
|
|
- Works with detaches HEAD and support checked out branches
|
|
|
|
|
- Automatically selects the correct line number in the file page
|
2022-09-25 23:30:27 +03:00
|
|
|
|
2022-09-27 02:22:34 +03:00
|
|
|
## Requirements
|
|
|
|
|
|
|
|
|
|
- Neovim 0.7.2+
|
|
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
|
|
[packer](https://github.com/wbthomason/packer.nvim)
|
|
|
|
|
|
|
|
|
|
```lua
|
|
|
|
|
use "almo7aya/neogruvbox.nvim"
|
|
|
|
|
```
|
2022-09-25 23:30:27 +03:00
|
|
|
|
|
|
|
|
## Commands
|
2022-09-27 02:22:34 +03:00
|
|
|
|
2022-09-26 02:16:54 +03:00
|
|
|
- `:OpenInGHRepo`
|
2022-09-27 02:22:34 +03:00
|
|
|
- Opens the project's git repository page in GitHub.
|
2022-09-26 02:16:54 +03:00
|
|
|
|
|
|
|
|
- `:OpenInGHFile`
|
2022-09-27 02:22:34 +03:00
|
|
|
- Opens the current file page in GitHub.
|
|
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
|
|
You can call the commands directly or define mappings them:
|
|
|
|
|
|
|
|
|
|
```lua
|
|
|
|
|
-- for repository page
|
|
|
|
|
vim.api.nvim_set_keymap("n", "<Leader>gr", ":OpenInGHRepo <CR>", { expr = true, noremap = true })
|
|
|
|
|
|
|
|
|
|
-- for current file page
|
|
|
|
|
vim.api.nvim_set_keymap("n", "<Leader>gf", ":OpenInGHFile <CR>", { expr = true, noremap = true })
|
|
|
|
|
```
|
2022-09-25 23:30:27 +03:00
|
|
|
|
2022-09-27 02:22:34 +03:00
|
|
|
## TODO
|
|
|
|
|
- [x] Support the current file cursor position
|
|
|
|
|
- [ ] Support visual mode to open a file in range selection
|
2022-09-25 23:30:27 +03:00
|
|
|
|
2022-09-27 02:22:34 +03:00
|
|
|
## License
|
|
|
|
|
[MIT](./LICENSE)
|
2022-09-25 23:30:27 +03:00
|
|
|
|