feat: 添加 diffview、hardtime、render-markdown

This commit is contained in:
OrionPax 2025-02-19 09:08:14 +08:00
parent 9efdef2568
commit de0f7c3942
8 changed files with 70 additions and 6 deletions

View File

@ -91,7 +91,7 @@ vim.g.mapleader = ' '
vim.g.maplocalleader = ' ' vim.g.maplocalleader = ' '
-- Set to true if you have a Nerd Font installed and selected in the terminal -- Set to true if you have a Nerd Font installed and selected in the terminal
vim.g.have_nerd_font = false vim.g.have_nerd_font = true
-- [[ Setting options ]] -- [[ Setting options ]]
-- See `:help vim.opt` -- See `:help vim.opt`
@ -419,6 +419,11 @@ require('lazy').setup({
builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
winblend = 10, winblend = 10,
previewer = false, previewer = false,
layout_config = {
width = 0.7, -- 宽度占屏幕 80%0~1 之间的百分比,或像素值)
height = 30, -- 高度设置为 20 行
-- prompt_position = "top", -- 可选:将输入框置于顶部
},
}) })
end, { desc = '[/] Fuzzily search in current buffer' }) end, { desc = '[/] Fuzzily search in current buffer' })
@ -870,6 +875,7 @@ require('lazy').setup({
-- - ci' - [C]hange [I]nside [']quote -- - ci' - [C]hange [I]nside [']quote
require('mini.ai').setup { n_lines = 500 } require('mini.ai').setup { n_lines = 500 }
-- TODO: 和跳转插件有冲突
-- Add/delete/replace surroundings (brackets, quotes, etc.) -- Add/delete/replace surroundings (brackets, quotes, etc.)
-- --
-- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren -- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren

View File

@ -1,2 +1,9 @@
-- tab 页签 -- tab 页签
return { 'akinsho/bufferline.nvim', version = '*', dependencies = 'nvim-tree/nvim-web-devicons', opts = {} } vim.keymap.set('n', 'gb', '<cmd>BufferLinePick<CR>', { desc = '[G]o to [B]uffer' })
return {
'akinsho/bufferline.nvim',
version = '*',
dependencies = 'nvim-tree/nvim-web-devicons',
opts = {},
}

View File

@ -0,0 +1,4 @@
return {
'sindrets/diffview.nvim',
dependencies = { 'nvim-lua/plenary.nvim' },
}

View File

@ -0,0 +1,7 @@
-- 建立良好的指挥工作流程,戒除不良习惯。
-- 按下 `s` 然后输入需要跳转到的位置的单词
return {
'm4xshen/hardtime.nvim',
dependencies = { 'MunifTanjim/nui.nvim' },
opts = {},
}

View File

@ -0,0 +1,15 @@
-- Markdown 预览
return {
'MeanderingProgrammer/render-markdown.nvim',
dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.nvim' }, -- if you use the mini.nvim suite
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons
---@module 'render-markdown'
---@type render.md.UserConfig
opts = {},
config = function()
local rm = require 'render-markdown'
vim.keymap.set('n', '<leader>tp', rm.toggle, { noremap = true, silent = true, expr = true, desc = '[T]oggle [P]review Markdown' })
end,
}

View File

@ -0,0 +1,20 @@
local powershell_options = {
-- shell = vim.fn.executable 'pwsh' == 1 and 'pwsh' or 'powershell',
-- shellcmdflag = '-NoLogo -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.UTF8Encoding]::new();$PSDefaultParameterValues[',
-- shellredir = '2>&1 | %%{ "$_" } | Out-File %s; exit $LastExitCode',
-- shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode',
-- shellquote = '',
-- shellxquote = '',
shell = vim.fn.executable 'pwsh' == 1 and 'pwsh' or 'powershell',
shellcmdflag = '-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;',
shellredir = '-RedirectStandardOutput %s -NoNewWindow -Wait',
shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode',
shellquote = '',
shellxquote = '',
}
for option, value in pairs(powershell_options) do
vim.opt[option] = value
end
return {}

View File

@ -1,3 +1,4 @@
-- 显示缩进线
return { return {
{ -- Add indentation guides even on blank lines { -- Add indentation guides even on blank lines
'lukas-reineke/indent-blankline.nvim', 'lukas-reineke/indent-blankline.nvim',

View File

@ -1,15 +1,19 @@
-- Neo-tree is a Neovim plugin to browse the file system -- Neo-tree is a Neovim plugin to browse the file system
-- Neo-Tree 是一个浏览文件系统的 Neovim 插件
-- https://github.com/nvim-neo-tree/neo-tree.nvim -- https://github.com/nvim-neo-tree/neo-tree.nvim
-- leader [T]oggle [F]ileTree : 开关文件树
-- 文件树内部 `?` 查看帮助
return { return {
'nvim-neo-tree/neo-tree.nvim', 'nvim-neo-tree/neo-tree.nvim',
version = '*', version = '*',
dependencies = { dependencies = {
'nvim-lua/plenary.nvim', 'nvim-lua/plenary.nvim', -- 一个 Neovim 的 Lua 工具库NeoTree 依赖它提供一些实用函数。
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended 'nvim-tree/nvim-web-devicons', -- 为文件和文件夹提供图标,虽然不是必需的,但推荐安装以增强界面。
'MunifTanjim/nui.nvim', 'MunifTanjim/nui.nvim', -- 一个用于构建用户界面的 Lua 库NeoTree 用它来创建其界面组件。
}, },
cmd = 'Neotree', cmd = 'Neotree', -- 将在执行 :Neotree 命令时加载
keys = { keys = {
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true }, { '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
}, },