From dced8c0e0b768b54477a3443bd363c040fa81157 Mon Sep 17 00:00:00 2001 From: hlstwizard Date: Mon, 30 Mar 2026 16:27:38 +0800 Subject: [PATCH] Add markdown lint; neotree hidden --- README.md | 1 + init.lua | 7 ++++--- lua/custom/plugins/lint.lua | 23 +++++++++++++++++++++++ lua/custom/plugins/neotree.lua | 10 ++++++++++ 4 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 lua/custom/plugins/lint.lua diff --git a/README.md b/README.md index 093e42a6..35113e90 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ External Requirements: - Language Setup: - If you want to write Typescript, you need `npm` - If you want to write Golang, you will need `go` + - If you want to lint Markdown, install `markdownlint-cli2` (via `npm i -g markdownlint-cli2` or Mason) - etc. > [!NOTE] diff --git a/init.lua b/init.lua index 931ebd0b..cd70af38 100644 --- a/init.lua +++ b/init.lua @@ -626,9 +626,10 @@ require('lazy').setup({ end local config_path = vim.fn.stdpath 'config' - local runtime_files = vim.tbl_filter(function(file) - return file ~= config_path and file ~= (config_path .. '/after') - end, vim.api.nvim_get_runtime_file('', true)) + local runtime_files = vim.tbl_filter( + function(file) return file ~= config_path and file ~= (config_path .. '/after') end, + vim.api.nvim_get_runtime_file('', true) + ) client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, { runtime = { diff --git a/lua/custom/plugins/lint.lua b/lua/custom/plugins/lint.lua new file mode 100644 index 00000000..9f6f459c --- /dev/null +++ b/lua/custom/plugins/lint.lua @@ -0,0 +1,23 @@ +return { + { + 'mfussenegger/nvim-lint', + ft = { 'markdown' }, + opts = { + linters = { + markdownlint = { + args = { '--disable', 'MD013', '--' }, + }, + ['markdownlint-cli2'] = { + prepend_args = { '--disable', 'MD013', '--' }, + }, + }, + }, + config = function(_, opts) + local lint = require 'lint' + + for linter_name, linter_config in pairs(opts.linters or {}) do + lint.linters[linter_name] = vim.tbl_deep_extend('force', lint.linters[linter_name] or {}, linter_config) + end + end, + }, +} diff --git a/lua/custom/plugins/neotree.lua b/lua/custom/plugins/neotree.lua index 41fc36f9..520f47d6 100644 --- a/lua/custom/plugins/neotree.lua +++ b/lua/custom/plugins/neotree.lua @@ -23,9 +23,19 @@ return { opts.filesystem = vim.tbl_deep_extend('force', opts.filesystem or {}, { use_libuv_file_watcher = true, follow_current_file = { enabled = true }, + filtered_items = { + visible = false, + hide_dotfiles = true, + hide_gitignored = true, + hide_hidden = true, + always_show = { + '.github', + }, + }, window = { mappings = { ['R'] = 'refresh', + ['H'] = 'toggle_hidden', }, }, })