+25
-3
README.md
+25
-3
README.md
···
4
4
5
5
This plugin retrieves the latest revision description (commit message) from `jj` and lets you use it through a global variable. It's nice to see the description of what you are working on at the moment.
6
6
7
+
## Requirements
8
+
9
+
- Neovim 0.10 or newer
10
+
- `jj` installed and available on `PATH`
11
+
12
+
## How do I use it?
13
+
14
+
Once you connect a plugin, it will automatically set the `vim.b.jj_desc` variable, which contains the description or `nil`. If your currently open buffer is not a file, (e.g. terminal) `vim.b.jj_desc` will return `nil`. Make sure to handle that case in your configuration!
15
+
7
16
## Example with NvChad
8
17
9
18
```lua
···
21
30
jj_msg = function()
22
31
local result = vim.b.jj_desc -- The variable you need
23
32
24
-
if not result then
33
+
if not result then -- Null handling - just don't display anything
25
34
return ""
26
35
end
27
-
28
-
return "%#St_JJ_Text# " .. result .. " "
36
+
37
+
-- May look bad online - I am using a Nerd Font commit icon here
38
+
return "%#St_JJ_Text# " .. result .. " " -- Decorating the description
29
39
end,
30
40
}
31
41
}
···
34
44
35
45
```
36
46
47
+
And here comes the result!
48
+
49
+

50
+
37
51
## Setup
38
52
39
53
**Lazy**
···
45
59
```
46
60
47
61
I'll be happy to add other package manager instructions! Hit me up, open an issue, or send a PR
62
+
63
+
## Contributing?
64
+
65
+
You can do so much to help me develop this plugin:
66
+
67
+
- Try to break it and open an issue
68
+
- Try to fix it and open a PR
69
+
- Most importantly, spread the word about it
docs/assets/nvchad_statusbar.png
docs/assets/nvchad_statusbar.png
This is a binary file and will not be displayed.