Update README.md with installation, usage, and configuration details
This commit is contained in:
parent
6e72a16f7b
commit
ddcca1077d
56
README.md
56
README.md
@ -9,12 +9,62 @@ A Neovim plugin to provide `mini.diff`-like functionality for Jujutsu (`jj`) rep
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
(TODO: Provide installation instructions using popular Neovim plugin managers like `packer.nvim`, `lazy.nvim`, or `vim-plug`.)
|
You can install `jj-mini.diff` using your favorite Neovim plugin manager.
|
||||||
|
|
||||||
|
**lazy.nvim:**
|
||||||
|
|
||||||
|
```lua
|
||||||
|
{
|
||||||
|
"your-github-username/jj-mini.diff", -- Replace with the actual repository path
|
||||||
|
config = function()
|
||||||
|
require("jj_mini_diff").setup({
|
||||||
|
-- Your configuration options here
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
(TODO: Explain how to activate and use the plugin, including any commands or keybindings.)
|
To activate the plugin, call the `setup()` function in your Neovim configuration:
|
||||||
|
|
||||||
|
```lua
|
||||||
|
require("jj_mini_diff").setup({
|
||||||
|
-- Optional: Customize signs or autocmd events
|
||||||
|
-- signs = {
|
||||||
|
-- add = { text = "++", texthl = "DiffAdd", numhl = "DiffAdd" },
|
||||||
|
-- change = { text = "//", texthl = "DiffChange", numhl = "DiffChange" },
|
||||||
|
-- delete = { text = "--", texthl = "DiffDelete", numhl = "DiffDelete" },
|
||||||
|
-- },
|
||||||
|
-- autocmd_events = { "BufReadPost", "BufWritePost", "CursorHold", "InsertLeave" },
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
The plugin will automatically place and update signs in files within a Jujutsu repository on `BufReadPost`, `BufWritePost`, and `CursorHold` events by default.
|
||||||
|
|
||||||
|
You can also manually refresh the signs for the current buffer at any time:
|
||||||
|
|
||||||
|
```lua
|
||||||
|
:lua require("jj_mini_diff").refresh_signs()
|
||||||
|
```
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
(TODO: Document available configuration options for customizing signs, colors, and behavior.)
|
The `setup()` function accepts an optional table for configuration.
|
||||||
|
|
||||||
|
```lua
|
||||||
|
require("jj_mini_diff").setup({
|
||||||
|
signs = {
|
||||||
|
add = { text = "│", texthl = "JjDiffAdd", numhl = "JjDiffAdd" },
|
||||||
|
change = { text = "│", texthl = "JjDiffChange", numhl = "JjDiffChange" },
|
||||||
|
delete = { text = "─", texthl = "JjDiffDelete", numhl = "JjDiffDelete" },
|
||||||
|
},
|
||||||
|
autocmd_events = { "BufReadPost", "BufWritePost", "CursorHold" },
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
* **`signs`**: A table to customize the text, text highlight group (`texthl`), and number highlight group (`numhl`) for each sign type.
|
||||||
|
* `add`: For added lines.
|
||||||
|
* `change`: For changed lines.
|
||||||
|
* `delete`: For deleted lines.
|
||||||
|
* **`autocmd_events`**: A list of Neovim autocommand events that will trigger a sign refresh.
|
||||||
Loading…
Reference in New Issue
Block a user