Skip to content

Commit

Permalink
fix(markdown-preview.nvim): move "markdown-preview.nvim" to user plug…
Browse files Browse the repository at this point in the history
…ins list (#618)

feat(peek.nvim): add key mappings for "peek.nvim"  (#618)
  • Loading branch information
linrongbin16 authored Nov 22, 2024
1 parent eb4ffd8 commit ce52f9d
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 21 deletions.
12 changes: 10 additions & 2 deletions lua/configs/toppair/peek-nvim/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,13 @@ require("peek").setup({
app = "browser",
})

vim.api.nvim_create_user_command("PeekOpen", require("peek").open, {})
vim.api.nvim_create_user_command("PeekClose", require("peek").close, {})
vim.api.nvim_create_user_command(
"PeekOpen",
require("peek").open,
{ desc = "Peek open (for markdown preview)" }
)
vim.api.nvim_create_user_command(
"PeekClose",
require("peek").close,
{ desc = "Peek close (for markdown preview)" }
)
14 changes: 14 additions & 0 deletions lua/configs/toppair/peek-nvim/keys.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
local set_lazy_key = require("builtin.utils.keymap").set_lazy_key

local M = {
set_lazy_key("n", "<leader>pk", function()
local peek = require("peek")
if not peek.is_open() then
peek.open()
else
peek.close()
end
end, { desc = "Peek toggle (for markdown preview)" }),
}

return M
18 changes: 0 additions & 18 deletions lua/plugins/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -311,24 +311,6 @@ local M = {
config = lua_config("hrsh7th/nvim-cmp"),
},

-- ---- SPECIFIC LANGUAGE SUPPORT ----

-- Markdown
{
"iamcco/markdown-preview.nvim",
build = function()
vim.fn["mkdp#util#install"]()
end,
cmd = {
"MarkdownPreviewToggle",
"MarkdownPreview",
"MarkdownPreviewStop",
},
ft = { "markdown" },
init = lua_init("iamcco/markdown-preview.nvim"),
keys = lua_keys("iamcco/markdown-preview.nvim"),
},

-- ---- KEY BINDING ----

-- Key mappings
Expand Down
11 changes: 10 additions & 1 deletion lua/plugins/users_sample.lua
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,16 @@
-- "toppair/peek.nvim",
-- build = "deno task --quiet build:fast",
-- config = lua_config("toppair/peek.nvim"),
-- -- keys = lua_keys("toppair/peek.nvim"),
-- keys = lua_keys("toppair/peek.nvim"),
-- },
-- {
-- "iamcco/markdown-preview.nvim",
-- build = function()
-- vim.fn["mkdp#util#install"]()
-- end,
-- ft = { "markdown" },
-- init = lua_init("iamcco/markdown-preview.nvim"),
-- keys = lua_keys("iamcco/markdown-preview.nvim"),
-- },
-- -- Vim/Neovim api version helper
-- {
Expand Down

0 comments on commit ce52f9d

Please sign in to comment.