refactor(nvim): define hurl commands in ftplugin

This commit is contained in:
Price Hiller 2024-01-28 00:18:27 -06:00
parent c847748fee
commit ec2ecd2dd0
Signed by: Price
SSH Key Fingerprint: SHA256:Y4S9ZzYphRn1W1kbJerJFO6GGsfu9O70VaBSxJO7dF8
2 changed files with 24 additions and 8 deletions

View File

@ -0,0 +1,24 @@
vim.keymap.set("n", "<leader>fr", "<Cmd>Hurl<CR>", {
buffer = true,
})
vim.opt_local.commentstring = "# %s"
vim.keymap.set("n", "<leader>fr", "<cmd>HurlRunner<CR>", {
desc = "Hurl: Runner"
})
vim.keymap.set("n", "<leader>fa", "<cmd>HurlRunnerAt<CR>", {
desc = "Hurl: Run Api request"
})
vim.keymap.set("n", "<leader>fe", "<cmd>HurlRunnerToEntry<CR>", {
desc = "Hurl: Run Api request to entry"
})
vim.keymap.set("n", "<leader>fm", "<cmd>HurlToggleMode<CR>", {
desc = "Hurl: Toggle Mode"
})
vim.keymap.set("n", "<leader>rv", "<cmd>HurlVerbose<CR>", {
desc = "Hurl: Run Api in verbose mode"
})
vim.keymap.set("v", "<leader>fr", ":HurlRunner<CR>", {
desc = "Hurl: Runner"
})

View File

@ -15,13 +15,5 @@ return {
},
},
},
keys = {
{ "<leader>fr", "<cmd>HurlRunner<CR>", desc = "Hurl: Runner" },
{ "<leader>fa", "<cmd>HurlRunnerAt<CR>", desc = "Hurl: Run Api request" },
{ "<leader>fe", "<cmd>HurlRunnerToEntry<CR>", desc = "Hurl: Run Api request to entry" },
{ "<leader>fm", "<cmd>HurlToggleMode<CR>", desc = "Hurl: Toggle Mode" },
{ "<leader>rv", "<cmd>HurlVerbose<CR>", desc = "Hurl: Run Api in verbose mode" },
{ "<leader>fr", ":HurlRunner<CR>", desc = "Hurl: Runner", mode = "v" },
},
}
}