Skip to content

Commit 02d7af1

Browse files
committed
feat(readme): add lazy.nvim usage
1 parent 9cd598c commit 02d7af1

File tree

3 files changed

+30
-3
lines changed

3 files changed

+30
-3
lines changed

README.md

+28-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,29 @@
11
# glpi.nvim
2-
Acces GLPI direclty throught nvim
2+
3+
Access GLPI direclty throught nvim
4+
5+
This is my first attempt to write something in LUA and nvim plugin
6+
7+
# Usage
8+
9+
With lazy.nvim
10+
11+
```lua
12+
{
13+
"TheoSarrazin/glpi.nvim",
14+
opts = {
15+
endpoint = "http://myglpi.example.org/glpi/apirest.php/",
16+
user_token = "",
17+
app_token = "",
18+
tech_name = "my_username",
19+
tech_profile_id = {}, -- Id of profile who can be add as technician
20+
},
21+
keys = {
22+
"<space>gi",
23+
function()
24+
require("glpi").load_tickets()
25+
end,
26+
desc = "Load all tickets",
27+
},
28+
}
29+
```

lua/glpi/config.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ M.options = {}
1313
function M.setup(opts)
1414
M.options = vim.tbl_deep_extend("force", {}, defaults, opts or {})
1515
M.options.endpoint = M.options.endpoint:gsub("/$", "")
16-
M.options.base_url = M.options.endpoint:gsub("/apirest.php$", "")
16+
M.options.base_url = M.options.endpoint:gsub("/apirest.php$", "")
1717
end
1818

1919
return setmetatable(M, {

lua/glpi/init.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function M.setup(opts)
1212
config.setup(opts)
1313
end
1414

15-
function M.init()
15+
function M.load_tickets()
1616
view.open_tab()
1717
view.open_tickets(api.tickets, {
1818
on_quit = function()

0 commit comments

Comments
 (0)