This commit is contained in:
QQ 2023-01-28 15:59:16 +08:00
parent a4cfb715c0
commit f2fef63db9
3 changed files with 14 additions and 13 deletions

View File

@ -1,9 +1,10 @@
local G = require("core.G")
local TogglePreview = "<Plug>MarkdownPreviewToggle"
local G = require("G")
G.cmd("au VimEnter * :MarkdownPreview")
--set to 1, nvim will open the preview window after entering the markdown buffer
--default: 0
G.g.mkdp_auto_start = 1
G.g.mkdp_auto_start = 0
--set to 1, the nvim will auto close current preview window when change
--from markdown buffer to another buffer
@ -81,6 +82,7 @@ G.g.mkdp_browserfunc = ''
-- ]])
--use a custom markdown style must be absolute path
--like '/Users/username/markdown.css' or expand('~/markdown.css')
G.g.mkdp_markdown_css = ''
--use a custom highlight style must absolute path

View File

@ -34,6 +34,10 @@ function G.eval(c)
return G.api.nvim_eval(c)
end
function G.au(c)
return G.api.nvim_create_autocmd(c)
end
G.g.mapleader = ' '
return G

View File

@ -52,17 +52,12 @@ G.api.nvim_create_autocmd({ "BufEnter" }, {
end,
})
local require_markdown = {}
function require_markdown()
require('Filetype.markdown')
G.cmd('MarkdownPreviewToggle')
end
G.api.nvim_create_autocmd(
{"FileType"}, {
G.api.nvim_create_autocmd( {"FileType"}, {
pattern = "markdown",
callback = require_markdown
callback = function()
require('Filetype.markdown')
--G.cmd('MarkdownPreview')
end
}
)