From d7917f5236ee095e086a074e99ab07847146fffc Mon Sep 17 00:00:00 2001 From: QQ <1770362456@qq.com> Date: Sun, 22 Jan 2023 22:23:51 +0800 Subject: [PATCH] update --- lua/Filetype/Html.lua | 5 ----- lua/Filetype/markdown.lua | 4 +--- lua/core/options.lua | 14 +++++++------- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/lua/Filetype/Html.lua b/lua/Filetype/Html.lua index 649545e..8b13789 100644 --- a/lua/Filetype/Html.lua +++ b/lua/Filetype/Html.lua @@ -1,6 +1 @@ -local map = vim.api.nvim_set_keymap -local openPreview = ":CocCommand markdown-preview-enhanced.openPreview:CocCommand markdown-preview-enhanced.openPreviewBackground" -map('n', 'rr', openPreview, {noremap = false}) - -print("markdown sourced") diff --git a/lua/Filetype/markdown.lua b/lua/Filetype/markdown.lua index 649545e..ea443c7 100644 --- a/lua/Filetype/markdown.lua +++ b/lua/Filetype/markdown.lua @@ -1,6 +1,4 @@ local map = vim.api.nvim_set_keymap local openPreview = ":CocCommand markdown-preview-enhanced.openPreview:CocCommand markdown-preview-enhanced.openPreviewBackground" -map('n', 'rr', openPreview, {noremap = false}) - -print("markdown sourced") +map('n', 'r', openPreview, {noremap = false}) diff --git a/lua/core/options.lua b/lua/core/options.lua index 04f1294..f1f1e8b 100644 --- a/lua/core/options.lua +++ b/lua/core/options.lua @@ -54,13 +54,13 @@ vim.api.nvim_create_autocmd({ "BufEnter" }, { end, }) -local require_markdown = function() require('Filetype.markdown') end -local require_html = function() require('Filetype.Html') end - -vim.api.nvim_create_autocmd({ -{"FileType"}, { pattern = "markdown", callback = require_markdown }, -{"FileType"}, { pattern = "html", callback = require_html } -}) +local require_markdown = {} +function require_markdown() + require('Filetype.markdown') +end +vim.api.nvim_create_autocmd( +{"FileType"}, { pattern = "markdown", callback = require_markdown } +)