Skip to content

Commit

Permalink
Chore: Improve README for custom handler
Browse files Browse the repository at this point in the history
  • Loading branch information
chrishrb committed Mar 13, 2024
1 parent 5ee4aa2 commit 2237fa3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,17 @@ require("lazy").setup({
end
end,
},
},
rust = { -- custom handler to open rust's cargo packages
filetype = { "toml" }, -- you can also set the required filetype for this handler
filename = "Cargo.toml", -- or the necessary filename
handle = function(mode, line, _)
local crate = require("gx.helper").find(line, mode, "(%w+)%s-=%s")

if crate then
return "https://crates.io/crates/" .. crate
end
end,
},
},
handler_options = {
search_engine = "google", -- you can select between google, bing, duckduckgo, and ecosia
Expand Down

0 comments on commit 2237fa3

Please sign in to comment.