From 5493b53a1b4ba997d1b7617cfe425268d7e14795 Mon Sep 17 00:00:00 2001 From: Ali Almohaya Date: Tue, 27 Sep 2022 02:22:34 +0300 Subject: [PATCH] chore: update readme.md --- README.md | 42 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 40df470..a4fdf64 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,46 @@ -# Open in github for neovim written in lua (WIP) +# openingh.nvim :octocat: +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 -## Install +## Requirements + + - Neovim 0.7.2+ + +## Installation + +[packer](https://github.com/wbthomason/packer.nvim) + +```lua + use "almo7aya/neogruvbox.nvim" +``` ## Commands + - `:OpenInGHRepo` - - Opens the git repository page in github.com + - Opens the project's git repository page in GitHub. - `:OpenInGHFile` - - Opens the file page in github.com + - Opens the current file page in GitHub. -## Contributions +## Usage +You can call the commands directly or define mappings them: + +```lua +-- for repository page +vim.api.nvim_set_keymap("n", "gr", ":OpenInGHRepo ", { expr = true, noremap = true }) + +-- for current file page +vim.api.nvim_set_keymap("n", "gf", ":OpenInGHFile ", { expr = true, noremap = true }) +``` + +## TODO + - [x] Support the current file cursor position + - [ ] Support visual mode to open a file in range selection + +## License +[MIT](./LICENSE)