From 1024ac2aa335bde886cfa303dde8178876f48c80 Mon Sep 17 00:00:00 2001 From: arthur Date: Thu, 11 Jul 2024 02:09:38 +0800 Subject: [PATCH] open official website user command --- lua/lazyvim/config/init.lua | 11 +++++++++++ lua/lazyvim/plugins/ui.lua | 1 + 2 files changed, 12 insertions(+) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 0c8bb1a4..9a71a91c 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -1,5 +1,7 @@ _G.LazyVim = require("lazyvim.util") +local LAZYVIM_DOC = "https://www.lazyvim.org" + ---@class LazyVimConfig: LazyVimOptions local M = {} @@ -186,6 +188,15 @@ function M.setup(opts) LazyVim.news.setup() LazyVim.root.setup() + -- TODO: add this to lazy or simply add it in lazyvim + -- vim.api.nvim_create_user_command("LazyDocument", function() + -- require("lazy.help").openDoc() + -- end, { desc = "Open Lazy Document" }) + + vim.api.nvim_create_user_command("LazyVimDocument", function() + require("lazy.util").open(LAZYVIM_DOC) + end, { desc = "Open LazyVim Document" }) + vim.api.nvim_create_user_command("LazyExtras", function() LazyVim.extras.show() end, { desc = "Manage LazyVim extras" }) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 14a77ce4..d4c47812 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -359,6 +359,7 @@ return { { action = 'lua LazyVim.pick.config_files()()', desc = " Config", icon = " ", key = "c" }, { action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" }, { action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "x" }, + { action = "LazyVimDocument", desc = " LazyVim Document",icon = "󰒲 ", key = "d" }, { action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" }, { action = function() vim.api.nvim_input("qa") end, desc = " Quit", icon = " ", key = "q" }, },