diff --git a/init.lua b/init.lua index dff68443..37240ae8 100644 --- a/init.lua +++ b/init.lua @@ -91,7 +91,7 @@ vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' -- 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 ]] -- See `:help vim.opt` @@ -419,6 +419,11 @@ require('lazy').setup({ builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { winblend = 10, previewer = false, + layout_config = { + width = 0.7, -- 宽度占屏幕 80%(0~1 之间的百分比,或像素值) + height = 30, -- 高度设置为 20 行 + -- prompt_position = "top", -- 可选:将输入框置于顶部 + }, }) end, { desc = '[/] Fuzzily search in current buffer' }) @@ -870,6 +875,7 @@ require('lazy').setup({ -- - ci' - [C]hange [I]nside [']quote require('mini.ai').setup { n_lines = 500 } + -- TODO: 和跳转插件有冲突 -- Add/delete/replace surroundings (brackets, quotes, etc.) -- -- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren diff --git a/lua/custom/plugins/bufferline.lua b/lua/custom/plugins/bufferline.lua index d45da895..af65b271 100644 --- a/lua/custom/plugins/bufferline.lua +++ b/lua/custom/plugins/bufferline.lua @@ -1,2 +1,9 @@ -- tab 页签 -return { 'akinsho/bufferline.nvim', version = '*', dependencies = 'nvim-tree/nvim-web-devicons', opts = {} } \ No newline at end of file +vim.keymap.set('n', 'gb', 'BufferLinePick', { desc = '[G]o to [B]uffer' }) + +return { + 'akinsho/bufferline.nvim', + version = '*', + dependencies = 'nvim-tree/nvim-web-devicons', + opts = {}, +} diff --git a/lua/custom/plugins/diffview.lua b/lua/custom/plugins/diffview.lua new file mode 100644 index 00000000..2d520d37 --- /dev/null +++ b/lua/custom/plugins/diffview.lua @@ -0,0 +1,4 @@ +return { + 'sindrets/diffview.nvim', + dependencies = { 'nvim-lua/plenary.nvim' }, +} diff --git a/lua/custom/plugins/hardtime.lua b/lua/custom/plugins/hardtime.lua new file mode 100644 index 00000000..f8f07804 --- /dev/null +++ b/lua/custom/plugins/hardtime.lua @@ -0,0 +1,7 @@ +-- 建立良好的指挥工作流程,戒除不良习惯。 +-- 按下 `s` 然后输入需要跳转到的位置的单词 +return { + 'm4xshen/hardtime.nvim', + dependencies = { 'MunifTanjim/nui.nvim' }, + opts = {}, +} diff --git a/lua/custom/plugins/render-markdown.lua b/lua/custom/plugins/render-markdown.lua new file mode 100644 index 00000000..36c76da1 --- /dev/null +++ b/lua/custom/plugins/render-markdown.lua @@ -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', 'tp', rm.toggle, { noremap = true, silent = true, expr = true, desc = '[T]oggle [P]review Markdown' }) + end, +} diff --git a/lua/custom/plugins/terminal.lua b/lua/custom/plugins/terminal.lua new file mode 100644 index 00000000..178782cd --- /dev/null +++ b/lua/custom/plugins/terminal.lua @@ -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 {} diff --git a/lua/kickstart/plugins/indent_line.lua b/lua/kickstart/plugins/indent_line.lua index ed7f2693..9f579cb8 100644 --- a/lua/kickstart/plugins/indent_line.lua +++ b/lua/kickstart/plugins/indent_line.lua @@ -1,3 +1,4 @@ +-- 显示缩进线 return { { -- Add indentation guides even on blank lines 'lukas-reineke/indent-blankline.nvim', diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua index bd442269..268ec7c5 100644 --- a/lua/kickstart/plugins/neo-tree.lua +++ b/lua/kickstart/plugins/neo-tree.lua @@ -1,15 +1,19 @@ -- Neo-tree is a Neovim plugin to browse the file system +-- Neo-Tree 是一个浏览文件系统的 Neovim 插件 -- https://github.com/nvim-neo-tree/neo-tree.nvim +-- leader [T]oggle [F]ileTree : 开关文件树 +-- 文件树内部 `?` 查看帮助 + return { 'nvim-neo-tree/neo-tree.nvim', version = '*', dependencies = { - 'nvim-lua/plenary.nvim', - 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended - 'MunifTanjim/nui.nvim', + 'nvim-lua/plenary.nvim', -- 一个 Neovim 的 Lua 工具库,NeoTree 依赖它提供一些实用函数。 + 'nvim-tree/nvim-web-devicons', -- 为文件和文件夹提供图标,虽然不是必需的,但推荐安装以增强界面。 + 'MunifTanjim/nui.nvim', -- 一个用于构建用户界面的 Lua 库,NeoTree 用它来创建其界面组件。 }, - cmd = 'Neotree', + cmd = 'Neotree', -- 将在执行 :Neotree 命令时加载 keys = { { '\\', ':Neotree reveal', desc = 'NeoTree reveal', silent = true }, },