feat(nvim): use mini.nvim & neo-tree

This commit is contained in:
2026-02-07 11:45:59 +08:00
parent a1d873cc30
commit 832733f931
9 changed files with 70 additions and 75 deletions

View File

@@ -13,7 +13,8 @@
"lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" },
"leap.nvim": { "branch": "main", "commit": "d7316deae68dc93d6957020cdda6d7bb399218fb" },
"lspkind.nvim": { "branch": "master", "commit": "c7274c48137396526b59d86232eabcdc7fed8a32" },
"lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" },
"mini.nvim": { "branch": "main", "commit": "8c40d95931cbe6138391af9180e59439ed2e69df" },
"neo-tree.nvim": { "branch": "main", "commit": "f3df514fff2bdd4318127c40470984137f87b62e" },
"noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" },
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
"nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" },

View File

@@ -1,5 +1,6 @@
local buf_kill = require("core.globals").buf_kill
--- @type bufferline.UserConfig
M = {
highlights = {
buffer_selected = {
@@ -10,7 +11,7 @@ M = {
diagnostics = "nvim_lsp",
offsets = {
{
filetype = "NvimTree",
filetype = "neo-tree",
text = "File Explorer",
highlight = "Directory",
text_align = "center",

View File

@@ -1,4 +1,3 @@
--- @module "blink.cmp"
--- @type blink.cmp.Config
M = {
keymap = {

View File

@@ -1,3 +1,4 @@
--- @type ibl.config
M = {
enabled = true,
indent = {

View File

@@ -1,30 +0,0 @@
M = {
options = {
theme = "tokyonight",
},
sections = {
lualine_y = {
"encoding",
"fileformat",
"filetype",
},
lualine_x = {
{
require("noice").api.status.message.get_hl,
cond = require("noice").api.status.message.has,
},
{
require("noice").api.status.command.get,
cond = require("noice").api.status.command.has,
color = { fg = "#ff9e64" },
},
{
require("noice").api.status.search.get,
cond = require("noice").api.status.search.has,
color = { fg = "#ff9e64" },
},
},
},
}
return M

View File

@@ -1,32 +0,0 @@
M = {
sync_root_with_cwd = true,
diagnostics = {
enable = false,
debounce_delay = 50,
show_on_dirs = true,
},
filters = {
git_ignored = false,
},
}
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
local opt = require("core.globals").keymap_opt
vim.keymap.set("n", "<leader>e", ":NvimTreeToggle<CR>", opt)
vim.keymap.set("n", "<leader>te", ":NvimTreeFocus<CR>", opt)
vim.api.nvim_create_autocmd("BufEnter", {
group = vim.api.nvim_create_augroup("NvimTreeCloseOnLast", { clear = true }),
pattern = "NvimTree*",
callback = function()
if vim.api.nvim_call_function("winlayout", {})[1] == "leaf" and vim.bo.filetype == "NvimTree" then
vim.defer_fn(function()
vim.cmd("NvimTreeClose")
end, 10)
end
end,
})
return M

View File

@@ -21,20 +21,72 @@ local plugins = {
end,
},
{
"nvim-lualine/lualine.nvim",
lazy = false,
dependencies = { { "nvim-tree/nvim-web-devicons", lazy = true } },
'echasnovski/mini.nvim',
config = function()
require("lualine").setup(require("plugins.lualine"))
-- Simple and easy statusline.
-- You could remove this setup call if you don't like it,
-- and try some other statusline plugin
local statusline = require 'mini.statusline'
-- set use_icons to true if you have a Nerd Font
statusline.setup { use_icons = vim.g.have_nerd_font }
-- You can configure sections in the statusline by overriding their
-- default behavior. For example, here we set the section for
-- cursor location to LINE:COLUMN
---@diagnostic disable-next-line: duplicate-set-field
statusline.section_location = function()
return '%2l:%-2v'
end
-- Better Around/Inside textobjects
--
-- Examples:
-- - va) - [V]isually select [A]round [)]paren
-- - yinq - [Y]ank [I]nside [N]ext [Q]uote
-- - ci' - [C]hange [I]nside [']quote
require('mini.ai').setup { n_lines = 500 }
-- Add/delete/replace surroundings (brackets, quotes, etc.)
--
-- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren
-- - sd' - [S]urround [D]elete [']quotes
-- - sr)' - [S]urround [R]eplace [)] [']
require('mini.surround').setup()
-- ... and there is more!
-- Check out: https://github.com/echasnovski/mini.nvim
end,
},
{
"nvim-tree/nvim-tree.lua",
dependencies = { { "nvim-tree/nvim-web-devicons", lazy = true } },
lazy = false,
config = function()
require("nvim-tree").setup(require("plugins.nvim-tree"))
end,
'nvim-neo-tree/neo-tree.nvim',
version = '*',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-tree/nvim-web-devicons',
'MunifTanjim/nui.nvim',
},
cmd = 'Neotree',
keys = {
{ '\\', ':Neotree reveal toggle<CR>', desc = 'Toggle NeoTree', silent = true },
{ '<leader>e', ':Neotree reveal toggle<CR>', desc = 'Toggle NeoTree', silent = true },
},
--- @type neotree.Config
opts = {
close_if_last_window = true,
filesystem = {
filtered_items = {
hide_dotfiles = false,
},
window = {
width = 30,
mappings = {
['\\'] = 'close_window',
["<leader>e"] = "close_window",
["<c-]>"] = "set_root",
},
},
},
},
},
{
"nvim-treesitter/nvim-treesitter",

View File

@@ -1,4 +1,5 @@
local rainbow_delimiters = require("rainbow-delimiters")
--- @type rainbow_delimiters.config
vim.g.rainbow_delimiters = {
strategy = {
[""] = rainbow_delimiters.strategy["global"],

View File

@@ -1,9 +1,11 @@
--- @type TSConfig
M = {
auto_install = true,
parser_install_dir = "$HOME/.local/share/nvim/lazy/nvim-treesitter",
sync_install = true,
modules = {},
ignore_install = {},
ensure_installed = {},
highlight = { enable = true },
indent = { enable = true },