C.W.K.
Stream
Lesson 03 of 04 · published

lazy.nvim 으로 plugin 관리

~14 min · neovim, lazy, plugins

Level 0갇힌 자
0 XP0/35 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete

Neovim plugin 의 현대 표준

lazy.nvim (folke/lazy.nvim) 이 2026 Neovim 의 사실상 plugin 매니저. lazy-loading (이벤트/명령/filetype 으로 plugin 로드), 시작 시 자동 install, lockfile 기반 재현 가능성, 상태 + 프로파일링 위한 깔끔한 대화형 UI 지원.

Bootstrap — 표준 스니펫

Bootstrap 이 init.lua 맨 위로. lazy.nvim 깔렸는지 체크; 안 깔렸으면 git-clone. 그 다음 require("lazy").setup(plugins) 가 인계받아 나머지 전부 install.

Plugin spec

각 plugin 이 Lua table — 문자열 (GitHub user/repo) 과 옵션 필드:

  • dependencies — 필요한 다른 plugin.
  • config — plugin 로드 후 호출할 함수 (보통 require("plugin").setup({...})).
  • opts — config 가 그냥 require("plugin").setup(opts) 인 흔한 케이스 단축.
  • event — 특정 이벤트에 로드 (BufReadPost, InsertEnter, VeryLazy).
  • cmd — 명령 첫 사용 시 로드.
  • ft — 특정 filetype 만 로드.
  • keys — 키 처음 누르면 로드.
  • build — install 후 셸 명령 (예: treesitter 의 :TSUpdate).

Starter plugin 셋

여섯 plugin 이 대부분 사람이 까는 거의 80% 커버:

  • nvim-treesitter — 정확한 AST 기반 syntax 하이라이팅, 구조적 text object.
  • telescope.nvim — 파일, grep, buffer, LSP 심볼, 모든 것의 fuzzy finder.
  • nvim-lualine — 예쁜 status 라인.
  • which-key.nvim — 타이핑하며 leader keymap 팝업 메뉴.
  • nvim-autopairs — 괄호와 quote 자동 닫기.
  • nvim-surround — 둘러싼 페어에 ys / ds / cs operation.
:Lazy 안에서 살아. lazy.nvim UI 가 모든 plugin 로드 시간 표시, update / clean / sync 가능, breakage 하이라이트. install 후 :Lazy profile 실행 — 정확히 어떤 plugin 이 시작 시간 비용 지불하는지 보여.

Code

lazy.nvim bootstrap — init.lua 맨 위에 그대로 붙여·lua
-- lazy.nvim bootstrap
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
  vim.fn.system({
    "git", "clone", "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git",
    "--branch=stable", lazypath,
  })
end
vim.opt.rtp:prepend(lazypath)

-- plugin 키 작동하게 leader 를 lazy.setup 전에 박아
vim.g.mapleader = " "
vim.g.maplocalleader = " "
Starter plugin 셋·lua
require("lazy").setup({
  -- Treesitter — 더 나은 하이라이팅 + textobjects
  {
    "nvim-treesitter/nvim-treesitter",
    build = ":TSUpdate",
    config = function()
      require("nvim-treesitter.configs").setup({
        ensure_installed = {
          "lua", "python", "javascript", "typescript",
          "html", "css", "json", "yaml", "bash",
          "markdown", "markdown_inline", "vim", "vimdoc",
        },
        highlight = { enable = true },
        indent = { enable = true },
      })
    end,
  },

  -- Telescope — fuzzy finder
  {
    "nvim-telescope/telescope.nvim",
    dependencies = { "nvim-lua/plenary.nvim" },
    keys = {
      { "<leader>ff", "<cmd>Telescope find_files<CR>", desc = "Find files" },
      { "<leader>fg", "<cmd>Telescope live_grep<CR>", desc = "Live grep" },
      { "<leader>fb", "<cmd>Telescope buffers<CR>", desc = "Buffers" },
      { "<leader>fh", "<cmd>Telescope help_tags<CR>", desc = "Help" },
    },
  },

  -- Status 라인
  { "nvim-lualine/lualine.nvim", opts = { options = { theme = "auto" } } },

  -- Which-key (leader 팝업)
  { "folke/which-key.nvim", event = "VeryLazy", opts = {} },

  -- Autopair
  { "windwp/nvim-autopairs", event = "InsertEnter", config = true },

  -- Surround
  { "kylechui/nvim-surround", event = "VeryLazy", config = true },
})
Lazy.nvim UI 명령·vim
:Lazy           " UI 열기
:Lazy sync      " install + update + clean
:Lazy update    " update 만
:Lazy clean     " 안 쓰는 plugin 제거
:Lazy profile   " plugin 별 시작 타이밍
:Lazy log       " 최근 update 보기

External links

Exercise

Bootstrap 스니펫과 starter plugin 셋을 init.lua 에 추가. Neovim 재시작 — lazy.nvim 이 자동으로 clone 하고 모든 거 install. :Lazy 열어 여섯 plugin 다 로드 검증. <Space>ff 눌러서 telescope 의 find-files 테스트. 뭔가 실패하면 :Lazy log 의 아래 읽어 — 에러 메시지 명확.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.