local bind = require("keymap.bind") local map_callback = bind.map_callback local crates = require("crates") local crates_keymap = { ["n|ct"] = map_callback(function() crates.toggle() end) :with_noremap() :with_silent() :with_buffer(0) :with_desc("crates: Toggle spec activities"), ["n|cr"] = map_callback(function() crates.reload() end) :with_noremap() :with_silent() :with_buffer(0) :with_desc("crates: Reload crate specs"), ["n|cs"] = map_callback(function() crates.show_popup() end) :with_noremap() :with_silent() :with_buffer(0) :with_desc("crates: Toggle pop-up window"), ["n|cv"] = map_callback(function() crates.show_versions_popup() crates.show_popup() end) :with_noremap() :with_silent() :with_buffer(0) :with_desc("crates: Select spec versions"), ["n|cf"] = map_callback(function() crates.show_features_popup() crates.show_popup() end) :with_noremap() :with_silent() :with_buffer(0) :with_desc("crates: Select spec features"), ["n|cd"] = map_callback(function() crates.show_dependencies_popup() crates.show_popup() end) :with_noremap() :with_silent() :with_buffer(0) :with_desc("crates: Show project dependencies"), ["n|cu"] = map_callback(function() crates.update_crate() end) :with_noremap() :with_silent() :with_buffer(0) :with_desc("crates: Update current crate's spec"), ["v|cu"] = map_callback(function() crates.update_crates() end) :with_noremap() :with_silent() :with_buffer(0) :with_desc("crates: Update selected crate's spec"), ["n|ca"] = map_callback(function() crates.update_all_crates() end) :with_noremap() :with_silent() :with_buffer(0) :with_desc("crates: Update all crates' specs"), ["n|cU"] = map_callback(function() crates.upgrade_crate() end) :with_noremap() :with_silent() :with_buffer(0) :with_desc("crates: Upgrade current crate"), ["v|cU"] = map_callback(function() crates.upgrade_crates() end) :with_noremap() :with_silent() :with_buffer(0) :with_desc("crates: Upgrade selected crates"), ["n|cA"] = map_callback(function() crates.upgrade_all_crates() end) :with_noremap() :with_silent() :with_buffer(0) :with_desc("crates: Upgrade all crates"), ["n|cH"] = map_callback(function() crates.open_homepage() end) :with_noremap() :with_silent() :with_buffer(0) :with_desc("crates: Open current crate's homepage"), ["n|cR"] = map_callback(function() crates.open_repository() end) :with_noremap() :with_silent() :with_buffer(0) :with_desc("crates: Open current crate's repository"), ["n|cD"] = map_callback(function() crates.open_documentation() end) :with_noremap() :with_silent() :with_buffer(0) :with_desc("crates: Open current crate's documentation"), ["n|cC"] = map_callback(function() crates.open_crates_io() end) :with_noremap() :with_silent() :with_buffer(0) :with_desc("crates: Browse current crate on crates.io"), } bind.nvim_load_mapping(crates_keymap)