feat: add command & keybind to view docs (#3426)

This commit is contained in:
James L 2022-11-08 03:52:51 +00:00 committed by GitHub
parent 222a872dcc
commit 1a1ab91ed0
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View file

@ -29,6 +29,21 @@ M.defaults = {
require("lvim.core.info").toggle_popup(vim.bo.filetype)
end,
},
{
name = "LvimDocs",
fn = function()
local documentation_url = "https://www.lunarvim.org/docs/quick-start"
if vim.fn.has "mac" == 1 or vim.fn.has "macunix" == 1 then
vim.fn.execute("!open " .. documentation_url)
elseif vim.fn.has "win32" == 1 or vim.fn.has "win64" == 1 then
vim.fn.execute("!start " .. documentation_url)
elseif vim.fn.has "unix" == 1 then
vim.fn.execute("!xdg-open " .. documentation_url)
else
vim.notify "Opening docs in a browser is not supported on your OS"
end
end,
},
{
name = "LvimCacheReset",
fn = function()

View file

@ -186,6 +186,7 @@ M.config = function()
"<cmd>edit " .. get_config_dir() .. "/config.lua<cr>",
"Edit config.lua",
},
d = { "<cmd>LvimDocs<cr>", "View LunarVim's docs" },
f = {
"<cmd>lua require('lvim.core.telescope.custom-finders').find_lunarvim_files()<cr>",
"Find LunarVim files",