-
-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: added lazyvim reference configs #499
docs: added lazyvim reference configs #499
Conversation
README.md
Outdated
#### LazyVim | ||
|
||
plugins/rest-nvim.lua | ||
|
||
```lua | ||
return { | ||
{ | ||
"rest-nvim/tree-sitter-http", | ||
}, | ||
{ | ||
"nvim-treesitter/nvim-treesitter", | ||
opts = { | ||
ensure_installed = { | ||
"http", | ||
}, | ||
}, | ||
}, | ||
{ | ||
"folke/which-key.nvim", | ||
event = "VeryLazy", | ||
opts_extend = { "spec" }, | ||
opts = { | ||
spec = { | ||
{ | ||
mode = { "n", "v" }, | ||
{ "<leader>h", group = "rest", icon = { icon = "", color = "purple" } }, | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
"rest-nvim/rest.nvim", | ||
event = "VeryLazy", | ||
ft = { "http" }, | ||
keys = { | ||
{ | ||
"<leader>ho", | ||
"<cmd>Rest open<cr>", | ||
desc = "Open result pane", | ||
}, | ||
{ | ||
"<leader>hr", | ||
"<cmd>Rest run<cr>", | ||
desc = "Run request under the cursor", | ||
}, | ||
{ | ||
"<leader>hn", | ||
function() | ||
vim.ui.input({ prompt = "Enter request @name" }, function(input) | ||
if input and input ~= "" then | ||
vim.cmd("Rest run " .. input) | ||
else | ||
vim.notify("No input provided", vim.log.levels.ERROR) -- Show error | ||
end | ||
end) | ||
end, | ||
desc = "Run request with name <name>", | ||
}, | ||
{ | ||
"<leader>hh", | ||
"<cmd>Rest last<cr>", | ||
desc = "Run request under the cursor", | ||
}, | ||
{ | ||
"<leader>hl", | ||
"<cmd>Rest logs<cr>", | ||
desc = "Edit logs file", | ||
}, | ||
{ | ||
"<leader>hc", | ||
"<cmd>Rest cookies<cr>", | ||
desc = "Edit cookies file", | ||
}, | ||
{ | ||
"<leader>he", | ||
"<cmd>Rest env show<cr>", | ||
desc = "Show dotenv file registered to current .http file", | ||
}, | ||
{ | ||
"<leader>h.", | ||
"<cmd>Rest env select<cr>", | ||
desc = "Select & register .env file with vim.ui.select()", | ||
}, | ||
{ | ||
"<leader>hs", | ||
function() | ||
vim.ui.input({ prompt = "Enter env path" }, function(input) | ||
if input and input ~= "" then | ||
vim.cmd("Rest env set " .. input) | ||
else | ||
vim.notify("No input provided", vim.log.levels.ERROR) -- Show error | ||
end | ||
end) | ||
end, | ||
desc = "Register .env file to current .http file", | ||
}, | ||
}, | ||
}, | ||
} | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: enclosing the reference configs section children headers in an HTML <details>
tag could reduce the visual clutter by default, If anyone wants to see them, they can use the toggle "button" text from the tag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed, thank you!
fd07262
to
d46ab92
Compare
Thanks for the PR and for taking the time to contribute! While I appreciate the effort, I think adding reference configs to the README isn’t the best fit for rest.nvim.
I’d like to keep the README focused on core usage and let users adapt the plugin to their setups. Maybe we can add this in wiki instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it is good idea to add this in Readme. Maybe we can add this in wiki instead.
Got it, I'm closing this then. If you need help adding this to the wiki let me know, thanks! |
This adds a section called "Reference configs", under "Usage". I added the reference for LazyVim, but this could be expanded for other neovim distributions.
The reference config can give people something to start with, or even use it as is.
Let me know if I should do any formatting of it's a bad idea to add this in the README.md.