Skip to content

Commit f29a874

Browse files
authored
Chore: Improve README for custom handler (#51)
1 parent 5ee4aa2 commit f29a874

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,17 @@ require("lazy").setup({
5959
end
6060
end,
6161
},
62-
},
62+
rust = { -- custom handler to open rust's cargo packages
63+
filetype = { "toml" }, -- you can also set the required filetype for this handler
64+
filename = "Cargo.toml", -- or the necessary filename
65+
handle = function(mode, line, _)
66+
local crate = require("gx.helper").find(line, mode, "(%w+)%s-=%s")
67+
68+
if crate then
69+
return "https://crates.io/crates/" .. crate
70+
end
71+
end,
72+
},
6373
},
6474
handler_options = {
6575
search_engine = "google", -- you can select between google, bing, duckduckgo, and ecosia

0 commit comments

Comments
 (0)