This commit is contained in:
QQ 2023-01-22 22:20:39 +08:00
parent aa2ffcfaf5
commit 6918e692bb
6 changed files with 25 additions and 6 deletions

View File

@ -1,3 +1,4 @@
<!-- @import "[TOC]" {cmd="toc" depthFrom=1 depthTo=6 orderedList=false} -->
# 从零开始打造属于自己的nvim # 从零开始打造属于自己的nvim
--- ---
## 文件结构 ## 文件结构

View File

@ -1,5 +1,7 @@
{ {
"snippets.ultisnips.pythonPrompt": false, "snippets.ultisnips.pythonPrompt": false,
"explorer.icon.enableNerdfont": true, "explorer.icon.enableNerdfont": true,
"explorer.toggle": true "explorer.toggle": true,
"markdown-preview-enhanced.previewTheme":"github-dark.css",
"markdown-preview-enhanced.latexEngine": "pdflatex"
} }

6
lua/Filetype/Html.lua Normal file
View File

@ -0,0 +1,6 @@
local map = vim.api.nvim_set_keymap
local openPreview = ":CocCommand markdown-preview-enhanced.openPreview<CR>:CocCommand markdown-preview-enhanced.openPreviewBackground<CR>"
map('n', '<leader>rr', openPreview, {noremap = false})
print("markdown sourced")

View File

@ -0,0 +1,6 @@
local map = vim.api.nvim_set_keymap
local openPreview = ":CocCommand markdown-preview-enhanced.openPreview<CR>:CocCommand markdown-preview-enhanced.openPreviewBackground<CR>"
map('n', '<leader>rr', openPreview, {noremap = false})
print("markdown sourced")

View File

@ -82,5 +82,3 @@ keyset("v", "<leader>tt", "<Plug>(coc-translator-pv)")
-- translator-releader -- translator-releader
keyset("n", "<leader>tr", "<Plug>(coc-translator-r)") keyset("n", "<leader>tr", "<Plug>(coc-translator-r)")
keyset("v", "<leader>tr", "<Plug>(coc-translator-rv)") keyset("v", "<leader>tr", "<Plug>(coc-translator-rv)")

View File

@ -41,7 +41,7 @@ vim.cmd("colorscheme gruvbox")
vim.cmd([[ au InsertLeave * :silent !fcitx5-remote -c ]]) vim.cmd([[ au InsertLeave * :silent !fcitx5-remote -c ]])
-- 文件判断 -- 文件判断
vim.cmd([[ filetype plugin on ]]) vim.cmd([[ filetype plugin indent on ]])
-- 取消换行注释 -- 取消换行注释
vim.api.nvim_create_autocmd({ "BufEnter" }, { vim.api.nvim_create_autocmd({ "BufEnter" }, {
@ -54,6 +54,14 @@ vim.api.nvim_create_autocmd({ "BufEnter" }, {
end, 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 }
})
@ -71,7 +79,5 @@ vim.api.nvim_create_autocmd({ "BufEnter" }, {