windows nvim lazy

安装git后

git clone https://github.com/folke/lazy.nvim.git $env:LOCALAPPDATA\nvim-data\lazy\lazy.nvim

编辑配置文件

复制代码
nvim $env:LOCALAPPDATA\nvim\init.lua

-- ================= 基础 =================
vim.g.mapleader = " "
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.cursorline = true
vim.opt.termguicolors = true
vim.opt.signcolumn = "yes"
vim.opt.updatetime = 100

-- ================= lazy =================
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
vim.opt.rtp:prepend(lazypath)

require("lazy").setup({

-- 🌙 主题
{
  "folke/tokyonight.nvim",
  priority = 1000,
  config = function()
    vim.cmd.colorscheme("tokyonight")
  end
},

-- 📂 文件树
{
  "nvim-tree/nvim-tree.lua",
  dependencies = {"nvim-tree/nvim-web-devicons"},
  config = function()
    require("nvim-tree").setup()
    vim.keymap.set("n", "<leader>e", ":NvimTreeToggle<CR>")
  end
},

-- 📊 状态栏
{
  "nvim-lualine/lualine.nvim",
  dependencies = {"nvim-tree/nvim-web-devicons"},
  config = function()
    require("lualine").setup({ options = { theme = "tokyonight" } })
  end
},

-- 📑 标签栏
{
  "akinsho/bufferline.nvim",
  dependencies = {"nvim-tree/nvim-web-devicons"},
  config = function()
    require("bufferline").setup()
  end
},


-- 🔍 Telescope
{
  "nvim-telescope/telescope.nvim",
  dependencies = {"nvim-lua/plenary.nvim"},
  config = function()
    local b = require("telescope.builtin")
    vim.keymap.set("n", "<leader>f", b.find_files)
    vim.keymap.set("n", "<leader>g", b.live_grep)
  end
},

-- 🧠 补全
{
  "hrsh7th/nvim-cmp",
  dependencies = {
    "hrsh7th/cmp-nvim-lsp",
    "hrsh7th/cmp-buffer",
    "hrsh7th/cmp-path",
    "L3MON4D3/LuaSnip",
    "saadparwaiz1/cmp_luasnip"
  },
  config = function()
    local cmp = require("cmp")
    cmp.setup({
      snippet = {
        expand = function(args)
          require("luasnip").lsp_expand(args.body)
        end,
      },
      mapping = cmp.mapping.preset.insert({
        ["<Tab>"] = cmp.mapping.select_next_item(),
        ["<CR>"] = cmp.mapping.confirm({ select = true }),
      }),
      sources = {
        { name = "nvim_lsp" },
        { name = "luasnip" },
        { name = "buffer" },
        { name = "path" },
      }
    })
  end
},


-- ✨ 格式化(替代 null-ls)
{
  "stevearc/conform.nvim",
  config = function()
    require("conform").setup({
      formatters_by_ft = {
        python = {"black"},
        javascript = {"prettier"},
        html = {"prettier"},
        css = {"prettier"},
      }
    })

    vim.keymap.set("n","<leader>fm",function()
      require("conform").format()
    end)
  end
},

-- 🐞 调试
{ "mfussenegger/nvim-dap" },


-- 🌿 Git
{
  "lewis6991/gitsigns.nvim",
  config = function()
    require("gitsigns").setup()
  end
},

-- 🖥 终端
{
  "akinsho/toggleterm.nvim",
  config = function()
    require("toggleterm").setup()
    vim.keymap.set("n","<leader>t",":ToggleTerm<CR>")
  end
},

-- ✨ 启动页
{
  "goolord/alpha-nvim",
  config = function()
    require("alpha").setup(require("alpha.themes.dashboard").config)
  end
},

})
相关推荐
就改了31 分钟前
Windows 环境 SkyWalking 完整实操教程
windows·微服务·skywalking
郭wes代码3 小时前
Win10 拒绝访问、长期关机自动维护与声音图标灰色故障解决记录
windows·python·开源
2601_961875246 小时前
花生十三公考课程|网课|视频
数据库·windows·git·svn·eclipse·github
bkspiderx6 小时前
Windows DLL核心技术:深入理解__declspec(dllexport)与__declspec(dllimport)
windows·stm32·单片机·dllimport·dllexport·windows dll·__declspec
铁打的阿秀7 小时前
SQL server2025 Express安装及管理工具安装使用教程(Windows)
windows·sqlserver·express
疯狂成瘾者7 小时前
Java 常用工具包 java.util
java·开发语言·windows
无为之士7 小时前
Windows 批量打印 PDF 工具分享:支持文件夹、指定文件、当天文件、预览列表
windows·powershell
rhythm-ring8 小时前
TortoiseSVN 配置 Beyond Compare 注意事项
windows
凡人叶枫8 小时前
Effective C++ 条款38:通过复合塑模出 has-a 或 \“根据某物实现出\
linux·开发语言·c++·windows
caimouse9 小时前
Reactos 第 9 章 设备驱动 — 9.14 IRP请求的完成与返回
windows