summaryrefslogtreecommitdiff
path: root/lua/lvim/core
diff options
context:
space:
mode:
authorJames L <[email protected]>2022-11-08 03:52:51 +0000
committerGitHub <[email protected]>2022-11-07 22:52:51 -0500
commit1a1ab91ed033a0449dff582797fce6873556ec63 (patch)
tree7f299d55afc760a6b6425414c504507aa53311c1 /lua/lvim/core
parent222a872dccea6c56783a3e3728d5bb4f5ab3447c (diff)
feat: add command & keybind to view docs (#3426)
Diffstat (limited to 'lua/lvim/core')
-rw-r--r--lua/lvim/core/commands.lua15
-rw-r--r--lua/lvim/core/which-key.lua1
2 files changed, 16 insertions, 0 deletions
diff --git a/lua/lvim/core/commands.lua b/lua/lvim/core/commands.lua
index 65f01355..2714838a 100644
--- a/lua/lvim/core/commands.lua
+++ b/lua/lvim/core/commands.lua
@@ -30,6 +30,21 @@ M.defaults = {
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()
require("lvim.utils.hooks").reset_cache()
diff --git a/lua/lvim/core/which-key.lua b/lua/lvim/core/which-key.lua
index 5941904b..223184db 100644
--- a/lua/lvim/core/which-key.lua
+++ b/lua/lvim/core/which-key.lua
@@ -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",