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
},

})
相关推荐
flyingonpine17 小时前
PowerShell脚本数字签名实战:自签名证书、代码签名与信任链验证
windows·信任链
goehou1 天前
让 AI 替我操作这台电脑,先把手能伸多远定下来
windows·自动化·权限管理·ai agent
公子小六1 天前
基于.NET的Windows窗体编程之WinForms数据持久化(1)
windows·microsoft·c#·.net·winforms
2601_967987372 天前
安装 Redis 或 Redis Stack
linux·windows·redis·macos·安装
xbzb2 天前
自定义 yum 软件源:Linux 上 createrepo,Windows 上纯 Python 也能造
linux·运维·windows·python·yum·createrepo
武雄(小星Ai)2 天前
Ollama报llama-server binary not found排坑实录:服务活着引擎没了
人工智能·windows·大模型·ollama·排坑
叼烟扛炮2 天前
[LangChain] 学习笔记(06):突破大模型限制——结构化输出(Structured Output)
windows·笔记·学习·langchain
Thneonl3 天前
桌宠穿透不是一行 SetWindowLong
windows·程序员
艺杯羹4 天前
Windows原生软件锁设计:从暴力杀进程丢数据到零轮询事件驱动架构
windows·系统架构·开源·开源软件·内存管理·开源协议
csdn_aspnet4 天前
Redis 入门:Windows、Mac安装指南
数据库·windows·redis·缓存·mac