From bc3ea18e18dbe402689fb51fa9d346ca53f1046a Mon Sep 17 00:00:00 2001 From: QQ <1770362456@qq.com> Date: Wed, 8 Feb 2023 17:32:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8B=AC=E5=8F=B7=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E7=9A=84=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- init.lua | 2 ++ lua/Plugin/hlchunk.lua | 17 +++++++++++++++++ lua/core/filetype.lua | 18 ++++++++++++++++++ lua/core/options.lua | 8 -------- 4 files changed, 37 insertions(+), 8 deletions(-) create mode 100644 lua/Plugin/hlchunk.lua create mode 100644 lua/core/filetype.lua diff --git a/init.lua b/init.lua index 091fd45..4b1e909 100644 --- a/init.lua +++ b/init.lua @@ -1,8 +1,10 @@ require('core.plug') require('core.options') require('core.keymap') +require('core.filetype') require('Plugin.coc') require('Plugin.lualine') require('Plugin.Imchange') require('Plugin.treesitter') +require('Plugin.hlchunk') diff --git a/lua/Plugin/hlchunk.lua b/lua/Plugin/hlchunk.lua new file mode 100644 index 0000000..9963e13 --- /dev/null +++ b/lua/Plugin/hlchunk.lua @@ -0,0 +1,17 @@ +local G = require("G") + +G.cmd([[ + " 支持哪些文件 默认为 '*.ts,*.js,*.json,*.go,*.c' + let g:hlchunk_files = '*.ts,*.js,*.json,*.go,*.c' + " 高亮颜色 + au VimEnter * hi IndentLineSign ctermfg=248 + " 延时 默认为50 + let g:hlchunk_time_delay = 50 + " 优先级 默认为90 + let g:hlchunk_priority = 90 + " 预设主题 默认为1 + let g:hlchunk_theme = 1 + " 用户自定义主题 默认无(用户设置后 以用户设置为主) + " 格式: sign_texts: char[2][3], usenew: (0|1)[4] " [起止,中间] + let g:hlchunk_theme_byuser = { 'sign_texts': ['╭─', '│ ', '╰>'], 'usenew': [1, 1, 1, 1] }, +]]) diff --git a/lua/core/filetype.lua b/lua/core/filetype.lua new file mode 100644 index 0000000..631ac16 --- /dev/null +++ b/lua/core/filetype.lua @@ -0,0 +1,18 @@ +local G = require("G") + +G.api.nvim_create_autocmd( {"FileType"}, { + pattern = "markdown", + callback = function() + require('Filetype.markdown') + --G.cmd('MarkdownPreview') + end + } +) + +G.api.nvim_create_autocmd( {"FileType"}, { + pattern = {"c", "cpp"}, + callback = function() + require('Filetype.c') + end + } +) diff --git a/lua/core/options.lua b/lua/core/options.lua index 44077fd..c2344a8 100644 --- a/lua/core/options.lua +++ b/lua/core/options.lua @@ -52,13 +52,5 @@ G.api.nvim_create_autocmd({ "BufEnter" }, { end, }) -G.api.nvim_create_autocmd( {"FileType"}, { - pattern = "markdown", - callback = function() - require('Filetype.markdown') - --G.cmd('MarkdownPreview') - end - } -)