Plugins: Migrate to vim.pack

This commit is contained in:
a.shalimov 2026-10-11 15:00:32 +03:00
parent c54b4be291
commit a97c73b1dc
24 changed files with 283 additions and 487 deletions

View file

@ -7,18 +7,18 @@
### Root plugin папка ### Root plugin папка
Скрипты в этой папке загружаются автоматически после инициализации `neovim`, но до загрузки файлов типа `ftplugin/` или `after/`. Скрипты в этой папке загружаются автоматически после инициализации `neovim`, но до загрузки файлов типа `ftplugin/` или `after/`.
### Plugins ### Plugins
Разберем на примере `oil.nvim`: Сначала базовые настройки, такие как инструкция откуда качать и всякие зависимости и атрибуты по типу приоритета кладутся в директорию `custom/plugins` в виде названия плагина: Плагины ставятся встроенным менеджером `vim.pack` (Neovim 0.12+), см. раздел [Работа с vim.pack](#работа-с-vimpack).
*lua/custom/plugins/oil.lua* Разберем на примере `oil.nvim`: источник плагина указывается в списке `vim.pack.add` в `lua/custom/pack.lua`:
*lua/custom/pack.lua*
```lua ```lua
return { vim.pack.add({
"stevearc/oil.nvim", gh("echasnovski/mini.icons"),
dependencies = { { "echasnovski/mini.icons", opts = {} } }, gh("stevearc/oil.nvim"),
config = function() })
require "custom/oil" require("mini.icons").setup()
end, require "custom.oil"
}
``` ```
Затем, как можно видеть, сама функция настроек расположена отдельно в файле с идентичным названием, но в директории "повыше": Затем сама функция настроек расположена отдельно, в файле с названием плагина:
*lua/custom/oil.lua* *lua/custom/oil.lua*
```lua ```lua
require("oil").setup{ require("oil").setup{
@ -36,20 +36,40 @@ require("oil").setup{
Тут храняться настройки, которые будут применены **до** загразуки плагинов. Т.е. настройки, что определны где-то в настройках плагинов будут переписывать если что те, которые установлены для типов файлов тут Тут храняться настройки, которые будут применены **до** загразуки плагинов. Т.е. настройки, что определны где-то в настройках плагинов будут переписывать если что те, которые установлены для типов файлов тут
### after/ftplugin ### after/ftplugin
Настройки для типов файлов тут будут применены уже после того, как загрузится все содержимое neovim => эти настройки будут перегружать все то, что было настроено в плагинах Настройки для типов файлов тут будут применены уже после того, как загрузится все содержимое neovim => эти настройки будут перегружать все то, что было настроено в плагинах
## Включение / Выключение некоторых плагинов ## Работа с vim.pack
Из за возникновения случаев, когда некоторые плагины на некоторых машинах не нужно включать (например obsidian мне нужен только на хостовых машинах, на удаленных он будет только мешать открывать .md файлы), то в `init.lua` у меня в самом начале устанавливаются для таких плагинов глобальные переменные со следующей семантикой: Плагины описаны в `lua/custom/pack.lua`, версии зафиксированы в `nvim-pack-lock.json` (его нужно коммитить). Плагины ставятся в `~/.local/share/nvim/site/pack/core/opt`.
```
vim.g.<plugin_name>_enabled = <type:bool> | Задача | lazy.nvim | vim.pack |
``` |---|---|---|
Например: | Установить плагин | добавить spec, `:Lazy install` | добавить в `vim.pack.add({...})` и перезапустить, недостающее ставится при старте с подтверждением |
| Обновить все | `:Lazy update` | `:lua vim.pack.update()`, откроется буфер с диффом |
| Обновить один | `:Lazy update name` | `:lua vim.pack.update({"name"})` |
| Применить обновление | кнопка в UI | `:write` в буфере с диффом |
| Отклонить обновление | закрыть окно | закрыть буфер (`:quit`) |
| Список плагинов | `:Lazy` | `:lua vim.print(vim.pack.get())` |
| Удалить | убрать spec, `:Lazy clean` | убрать из `pack.lua`, затем `:lua vim.pack.del({"name"})` |
| Откатить к lock-файлу | `:Lazy restore` | `:lua vim.pack.update(nil, {target = "lockfile"})` |
| Lock-файл | `lazy-lock.json` | `nvim-pack-lock.json` |
| Профилирование | `:Lazy profile` | `nvim --startuptime out.log` |
Порядок обновления: `:lua vim.pack.update()` → прочитать дифф → `:write` → перезапустить nvim → закоммитить `nvim-pack-lock.json`.
Парсеры treesitter обновляются вручную командой `:TSUpdate`.
### Чего нет по сравнению с lazy
- Нет окна `:Lazy`, всё делается командами и через буфер диффа.
- Нет ленивой загрузки (`event`, `cmd`, `ft`, `keys`), плагины грузятся при старте.
- Нет `dependencies`, `opts` и `config`: зависимости перечисляются в `vim.pack.add`, а `setup()` вызывается вручную.
- Нет хука `build`. Вместо него автокоманда `PackChanged`, которую нужно объявить **до** `vim.pack.add` (пример для `markdown-preview` в `pack.lua`).
### Версии
Без `version` плагин следует за веткой по умолчанию. Версию можно зафиксировать:
```lua ```lua
vim.g.obsidian_enabled = false { src = gh("L3MON4D3/LuaSnip"), version = vim.version.range("2.*") }
``` ```
Это позволяет динамически включать/выключать плагины без необходимости усложнять конфиг `lazy`
# FAQ # FAQ
> Зачем так мучаться? Не проще все кидать в один файл? > Зачем так мучаться? Не проще все кидать в один файл?
Проще, но такое распараллеливание позволяет легче дебажить файлы настроек. Т.е. исправляя настройки мы можем просто `source`ить файл настроек, не трогая конфигурации скачивания файлов, чтобы лишний раз не триггерить Lazy. Проще, но такое распараллеливание позволяет легче дебажить файлы настроек. Т.е. исправляя настройки мы можем просто `source`ить файл настроек, не трогая список плагинов в `pack.lua`.
> Что делать, если в `checkhealth` выдается ошибка `luarocks not found`? > Что делать, если в `checkhealth` выдается ошибка `luarocks not found`?

View file

@ -1,7 +1,3 @@
-- Global settings params
--- Option to enable/disalbe obsidian plugin
vim.g.obsidian_enabled = false
-- Making leader (<Leader>) key to space -- Making leader (<Leader>) key to space
vim.g.mapleader = "\\" vim.g.mapleader = "\\"
-- Making local leader (<LocalLeader>) key to backslash -- Making local leader (<LocalLeader>) key to backslash
@ -10,32 +6,5 @@ vim.g.maplocalleader = ""
vim.opt.exrc = true vim.opt.exrc = true
vim.opt.secure = true vim.opt.secure = true
-- Bootstrap lazy.nvim -- Plugins (vim.pack)
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" require "custom.pack"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
-- Setup lazy.nvim
require("lazy").setup({
spec = {
-- import your plugins
{ import = "custom/plugins" },
},
-- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins.
install = { colorscheme = { "gruvbox-material" } },
-- automatically check for plugin updates
checker = { enabled = false },
})

View file

@ -1,72 +0,0 @@
require("obsidian").setup {
-- Set workspace setting
workspaces = {
{
name = "personal",
path = "~/Documents/t0xa_vault",
}
},
-- Disable conceal level to supress varning log message
ui = {
enable = false
},
-- Set notes subdir to store new notes
notes_subdir = "Unsorted",
new_notes_location = "notes_subdir",
-- Set template params
templates = {
folder = "Templates",
date_format = "%Y-%m-%d",
time_format = "%H:%M",
substitutions = {
yesterday = function()
return os.date("%Y-%m-%d", os.time() - 86400)
end
}
},
-- Set behaviour of following links
follow_url_func = function(url)
-- vim.fn.jobstart({ "open", url }) -- Mac OS
vim.fn.jobstart({ "xdg-open", url }) -- linux
-- vim.cmd(':silent exec "!start ' .. url .. '"') -- Windows
-- vim.ui.open(url) -- need Neovim 0.10.0+
end,
-- Set behaviour for opening images
follow_img_func = function(img)
-- vim.fn.jobstart { "qlmanage", "-p", img } -- Mac OS quick look preview
vim.fn.jobstart({ "xdg-open", url }) -- linux
-- vim.cmd(':silent exec "!start ' .. url .. '"') -- Windows
end,
-- Set sorting for creation date
sort_by = "created",
-- Set attachements new folder
attachments = {
img_folder = "Media"
},
-- Disable auto formatter for files
disable_frontmatter = true,
}
-- Obsidian-related keybinds
vim.keymap.set("n", "<leader>oit", "<cmd>ObsidianTemplate<CR>",
{ silent = true, noremap = true, desc = "Obsidian: insert template" })
vim.keymap.set("n", "<leader>oo", "<cmd>ObsidianQuickSwitch<CR>",
{ silent = true, noremap = true, desc = "Obsidian: open file" })
vim.keymap.set("n", "<leader>opi", "<cmd>ObsidianPasteImg<CR>",
{ silent = true, noremap = true, desc = "Obsidian: paste image" })
vim.keymap.set("n", "<leader>or", "<cmd>ObsidianRename<CR>",
{ silent = true, noremap = true, desc = "Obsidian: rename file" })
vim.keymap.set("n", "<leader>oc", "<cmd>ObsidianToggleCheckbox<CR>",
{ silent = true, noremap = true, desc = "Obsidian: toggle checkbox" })
vim.keymap.set("n", "<leader>on", "<cmd>ObsidianNew<CR>", { silent = true, noremap = true, desc = "Obsidian: new file" })
vim.keymap.set("n", "<leader>otoc", "<cmd>ObsidianTOC<CR>",
{ silent = true, noremap = true, desc = "Obsidian: open TOC" })
vim.keymap.set("n", "<leader>ofl", "<cmd>ObsidianFollowLink<CR>",
{ silent = true, noremap = true, desc = "Obsidian: follow link" })
vim.keymap.set("n", "<leader>olt", "<cmd>ObsidianTags<CR>",
{ silent = true, noremap = true, desc = "Obsidian: Get tags list" })
vim.keymap.set("n", "<leader>osb", "<cmd>ObsidianBacklinks<CR>",
{ silent = true, noremap = true, desc = "Obsidian: Show Backlinks" })
vim.keymap.set("n", "<leader>osl", "<cmd>ObsidianLinks<CR>",
{ silent = true, noremap = true, desc = "Obsidian: Show Links" })

95
lua/custom/pack.lua Normal file
View file

@ -0,0 +1,95 @@
-- Plugin management via built-in vim.pack (Neovim 0.12+)
-- Lockfile: nvim-pack-lock.json (commit it). Update: :lua vim.pack.update()
-- Treesitter parsers are updated manually with :TSUpdate
local gh = function(repo) return "https://github.com/" .. repo end
-- Build hooks. Must be registered BEFORE vim.pack.add()
vim.api.nvim_create_autocmd("PackChanged", {
callback = function(ev)
local data = ev.data
if data.spec.name == "markdown-preview.nvim" and data.kind ~= "delete" then
-- Downloads the pre-built preview server
local cmd = vim.fn.has("win32") == 1 and { "cmd.exe", "/c", "install.cmd" } or { "./install.sh" }
vim.system(cmd, { cwd = data.path .. "/app" }):wait()
end
end,
})
-- Used by which-key
vim.o.timeout = true
vim.o.timeoutlen = 500
vim.pack.add({
-- Libraries
gh("nvim-lua/plenary.nvim"),
gh("nvim-tree/nvim-web-devicons"),
gh("echasnovski/mini.icons"),
-- Colorschemes
gh("folke/tokyonight.nvim"),
gh("ellisonleao/gruvbox.nvim"),
gh("sainnhe/everforest"),
gh("sainnhe/gruvbox-material"),
gh("rebelot/kanagawa.nvim"),
{ src = gh("catppuccin/nvim"), name = "catppuccin" },
gh("luisiacc/gruvbox-baby"),
-- Treesitter
gh("nvim-treesitter/nvim-treesitter"),
-- Completion & snippets
{ src = gh("L3MON4D3/LuaSnip"), version = vim.version.range("2.*") },
gh("onsails/lspkind.nvim"),
gh("hrsh7th/nvim-cmp"),
gh("hrsh7th/cmp-buffer"),
gh("hrsh7th/cmp-path"),
gh("hrsh7th/cmp-nvim-lsp"),
gh("saadparwaiz1/cmp_luasnip"),
-- LSP
gh("neovim/nvim-lspconfig"),
gh("folke/lazydev.nvim"),
gh("mason-org/mason.nvim"),
gh("mason-org/mason-lspconfig.nvim"),
gh("WhoIsSethDaniel/mason-tool-installer.nvim"),
gh("j-hui/fidget.nvim"),
gh("stevearc/conform.nvim"),
-- UI / navigation
gh("nvim-lualine/lualine.nvim"),
gh("ibhagwan/fzf-lua"),
gh("stevearc/oil.nvim"),
gh("stevearc/dressing.nvim"),
gh("folke/which-key.nvim"),
gh("folke/trouble.nvim"),
gh("folke/todo-comments.nvim"),
gh("christoomey/vim-tmux-navigator"),
-- Tools
{ src = gh("danymat/neogen"), version = vim.version.range("*") },
gh("sammaji/markdown-preview.nvim"),
})
-- Plugins configured with defaults only
require("mini.icons").setup()
require("fidget").setup()
require("which-key").setup()
require("lazydev").setup({
library = {
-- luv (vim.uv) types
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
},
})
-- Plugins with custom configuration
require "custom.colorschemes"
require "custom.treesitter"
require "custom.completion"
require "custom.lsp"
require "custom.lualine"
require "custom.fzf_lua"
require "custom.oil"
require "custom.trouble"
require "custom.todo"
require "custom.neogen"

View file

@ -1,20 +0,0 @@
-- TODO: Need to refactor ways of downloading colorschemes
-- Now it is just a hack to download all colorschemes as dependecies
return {
"folke/tokyonight.nvim",
dependencies = {
"ellisonleao/gruvbox.nvim",
"sainnhe/everforest",
"sainnhe/gruvbox-material",
"rebelot/kanagawa.nvim",
"catppuccin/nvim",
"folke/tokyonight.nvim",
"luisiacc/gruvbox-baby",
},
lazy = false,
priority = 1000,
config = function()
require "custom/colorschemes"
end,
}

View file

@ -1,20 +0,0 @@
return {
"hrsh7th/nvim-cmp",
event = "InsertEnter", -- Only load plugin when in INSERT mode
dependencies = {
"hrsh7th/cmp-buffer", -- source for text in buffer
"hrsh7th/cmp-path", -- source for file system paths
{
"L3MON4D3/LuaSnip",
-- follow latest release.
version = "v2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release)
},
"saadparwaiz1/cmp_luasnip", -- for autocompletion
"rafamadriz/friendly-snippets", -- useful snippets
"onsails/lspkind.nvim", -- vs-code like pictograms
"hrsh7th/cmp-nvim-lsp",
},
config = function()
require "custom/completion"
end,
}

View file

@ -1,4 +0,0 @@
return {
"stevearc/dressing.nvim",
event = "VeryLazy"
}

View file

@ -1,9 +0,0 @@
return {
"ibhagwan/fzf-lua",
dependencies = { "nvim-tree/nvim-web-devicons" },
opts = {},
config = function()
require "custom.fzf_lua"
end
}

View file

@ -1,35 +0,0 @@
return {
{
"neovim/nvim-lspconfig",
dependencies = {
{
--`lazydev` configures Lua LSP for your Neovim config, runtime and plugins
-- used for completion, annotations and signatures of Neovim apis
"folke/lazydev.nvim",
ft = "lua",
opts = {
library = {
-- Load luvit types when the `vim.uv` word is found
{ path = "luvit-meta/library", words = { "vim%.uv" } },
},
},
},
{ "Bilal2453/luvit-meta", lazy = true },
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
"WhoIsSethDaniel/mason-tool-installer.nvim",
-- Some enhancements for notifications in bottom-right corner
{ "j-hui/fidget.nvim", opts = {} },
-- Following plugin enables enhancements for diagnostics info
-- { "https://git.sr.ht/~whynothugo/lsp_lines.nvim" },
-- Autoformatting
"stevearc/conform.nvim",
},
config = function()
require "custom/lsp"
end,
},
}

View file

@ -1,7 +0,0 @@
return {
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
require "custom/lualine"
end,
}

View file

@ -1,9 +0,0 @@
return {
{
"L3MON4D3/LuaSnip",
-- follow latest release.
version = "v2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release)
-- install jsregexp (optional!).
build = "make install_jsregexp"
}
}

View file

@ -1,11 +0,0 @@
return {
"iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
build = "cd app && npm install && git restore .",
-- or if you use yarn: (I have not checked this, I use npm)
-- build = "cd app && yarn install && git restore .",
init = function()
vim.g.mkdp_filetypes = { "markdown" }
end,
ft = { "markdown" },
}

View file

@ -1,12 +0,0 @@
-- Plugin for generating annotations
return {
{
"danymat/neogen",
config = true,
-- Uncomment next line if you want to follow only stable versions
version = "*",
config = function()
require "custom/neogen"
end,
}
}

View file

@ -1,16 +0,0 @@
if vim.g.obsidian_enabled then
return {
"epwalsh/obsidian.nvim",
version = "*",
lazy = true,
ft = "markdown",
dependencies = {
"nvim-lua/plenary.nvim",
},
config = function()
require "custom.obsidian"
end
}
else
return {}
end

View file

@ -1,8 +0,0 @@
return {
"stevearc/oil.nvim",
dependencies = { { "echasnovski/mini.icons", opts = {} } },
config = function()
require "custom/oil"
end,
}

View file

@ -1,13 +0,0 @@
return {
"nvim-telescope/telescope.nvim",
enabled = false,
dependencies = {
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"folke/todo-comments.nvim",
},
config = function()
require "custom.telescope"
end
}

View file

@ -1,19 +0,0 @@
return {
"christoomey/vim-tmux-navigator",
cmd = {
"TmuxNavigateLeft",
"TmuxNavigateDown",
"TmuxNavigateUp",
"TmuxNavigateRight",
"TmuxNavigatePrevious",
"TmuxNavigatorProcessList",
},
keys = {
{ "<c-h>", "<cmd><C-U>TmuxNavigateLeft<cr>" },
{ "<c-j>", "<cmd><C-U>TmuxNavigateDown<cr>" },
{ "<c-k>", "<cmd><C-U>TmuxNavigateUp<cr>" },
{ "<c-l>", "<cmd><C-U>TmuxNavigateRight<cr>" },
{ "<c-\\>", "<cmd><C-U>TmuxNavigatePrevious<cr>" },
},
}
-- return {}

View file

@ -1,8 +0,0 @@
return {
"folke/todo-comments.nvim",
event = { "BufReadPre", "BufNewFile" },
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
require "custom/todo"
end,
}

View file

@ -1,8 +0,0 @@
return {
'nvim-treesitter/nvim-treesitter',
lazy = false,
build = ':TSUpdate',
config = function()
require "custom/treesitter"
end,
}

View file

@ -1,10 +0,0 @@
return {
{
"folke/trouble.nvim",
opts = {}, -- for default options, refer to the configuration section for custom setup.
cmd = "Trouble",
config = function()
require "custom/trouble"
end,
},
}

View file

@ -1,20 +0,0 @@
return {
"folke/which-key.nvim",
-- Telling nvim that it can load this plugin later, and that it is not
-- that important for initial UI
event = "VeryLazy",
-- Function that will run while neovim startup instead of when plugin is actualy loads
init = function()
-- How long which-key will wait until activation
vim.o.timeout = true
vim.o.timeoutlen = 500
end,
-- Options that will pass to setup function, but we are leaving it empty to use
-- default configuration
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
}
}

View file

@ -1,133 +0,0 @@
require("telescope").setup {
defaults = {
vimgrep_arguments = {
"rg",
"--color=never",
"--no-heading",
"--with-filename",
"--line-number",
"--column",
"--smart-case",
},
path_display = { shorten = 4 },
},
}
-- Load fzf extension to imporve performance
pcall(require("telescope").load_extension, "fzf")
-- Glob pattern searcher
local function live_grep_with_glob()
vim.ui.input({
prompt = "Glob pattern: ",
default = "/home/user/Work/root/ivideon/audio_storage/", -- Optional default value
}, function(input)
if input then
require('telescope.builtin').live_grep({
-- glob_pattern = input,
search_dirs = { input }
})
end
end)
end
local function live_grep_in_current_dir()
-- Get currentp path
local search_dirs = { vim.fn.expand('%:p') }
-- Extract path from table
local current_dir = search_dirs[1]
-- Get path, cutting last entry (current file)
local result = current_dir:match(".*/")
vim.ui.input({
prompt = "Glob pattern: ",
default = result, -- Optional default value
}, function(input)
if input then
require('telescope.builtin').live_grep({
search_dirs = { input }
})
end
end)
end
-- Function for copying current file path
local function copy_current_file_path()
local filepath = vim.fn.expand('%:p')
vim.fn.setreg("+", filepath)
print("Copied: " .. filepath)
end
-- Function for gettings snapshot of current cursor position
local function copy_file_path_and_position()
local filepath = vim.fn.expand('%:p')
local cursor_pos = vim.api.nvim_win_get_cursor(0)
local line = cursor_pos[1]
local col = cursor_pos[2]
local output = string.format("%s:%d:%d", filepath, line, col)
vim.fn.setreg("+", output)
print("Copied: " .. output)
end
-- Function for getting filename and copy it to + buffer
local function copy_filename()
local filepath = vim.fn.expand('%:t')
local output = string.format("[[%s]]", filepath)
vim.fn.setreg("+", output)
print("Copied: " .. output)
end
local builtin = require("telescope.builtin")
local keymap = vim.keymap
-- Live grep in quickfix list
local function live_grep_in_quick_fix_list_files()
builtin.live_grep({
search_dirs = vim.fn.getqflist({ items = 0 }).items
and vim.tbl_map(function(item)
return vim.fn.bufname(item.bufnr)
end, vim.fn.getqflist())
or nil
})
end
-- Find files with hidden included
local function find_files_with_hidden_included()
require('telescope.builtin').find_files({
hidden = true,
no_ignore = true,
})
end
-- Create a Neovim command
vim.api.nvim_create_user_command('TelescopeGrepGlob', live_grep_with_glob, {})
keymap.set("n", "<leader>ff", builtin.find_files, { desc = "FZF: find files in cwd" })
keymap.set("n", "<leader>fml", builtin.marks, { desc = "FZF: find marks list" })
keymap.set("n", "<leader>fmp", builtin.man_pages, { desc = "FZF: find available man pages" })
keymap.set("n", "<leader>fg", builtin.live_grep, { desc = "FZF: find string in cwd" })
keymap.set("n", "<leader>fs", builtin.grep_string, { desc = "FZF: find string under cursor" })
keymap.set("n", "<leader>fb", builtin.buffers, { desc = "FZF: display opened buffers" })
keymap.set("n", "<leader>fh", builtin.help_tags, { desc = "FZF: display help tags" })
keymap.set("n", "<leader>ft", "<cmd>TodoTelescope<cr>", { desc = "FZF: display TODO comments" })
keymap.set("n", "<leader>fds", builtin.lsp_document_symbols, { desc = "Grep: Document symbols" })
keymap.set('n', '<leader>fp', live_grep_with_glob, { desc = 'Live grep with glob pattern' })
keymap.set('n', '<leader>fcp', live_grep_in_current_dir, { desc = 'Live grep in current directory' })
keymap.set('n', '<leader>ccp', copy_file_path_and_position, { desc = "Copy cursor position" })
keymap.set('n', '<leader>ccf', copy_filename, { desc = "Copy only filename" })
keymap.set('n', '<leader>ccd', copy_current_file_path, { desc = 'Live grep in current directory' })
keymap.set('n', '<leader>fq', live_grep_in_quick_fix_list_files, { desc = "Live grep in quickfix files" })
keymap.set('n', '<leader>fa', find_files_with_hidden_included, { desc = "Find all files (hidden + no ignore)" })
-- Live grep in current file
vim.keymap.set('n', '<leader>fcf', function()
require('telescope.builtin').live_grep({
search_dirs = { vim.fn.expand('%:p') }, -- Current file's full path
-- disable_coordinates = true, -- Hide line/column numbers
-- fname_width = 0, -- Hide filename column
path_display = { 'hidden' },
})
end, { desc = 'Live grep in current file' })

View file

@ -9,4 +9,4 @@ keymap.set("n", "[t", function()
todo_comments.jump_prev() todo_comments.jump_prev()
end, { desc = "Previous todo comment" }) end, { desc = "Previous todo comment" })
todo_comments.setup(opts) todo_comments.setup()

146
nvim-pack-lock.json Normal file
View file

@ -0,0 +1,146 @@
{
"plugins": {
"LuaSnip": {
"rev": "642b0c595e11608b4c18219e93b88d7637af27bc",
"src": "https://github.com/L3MON4D3/LuaSnip",
"version": "2.0.0 - 3.0.0"
},
"catppuccin": {
"rev": "edefef779ab08ce1a4a404713e3012b0d202bd35",
"src": "https://github.com/catppuccin/nvim"
},
"cmp-buffer": {
"rev": "b74fab3656eea9de20a9b8116afa3cfc4ec09657",
"src": "https://github.com/hrsh7th/cmp-buffer"
},
"cmp-nvim-lsp": {
"rev": "cbc7b02bb99fae35cb42f514762b89b5126651ef",
"src": "https://github.com/hrsh7th/cmp-nvim-lsp"
},
"cmp-path": {
"rev": "c642487086dbd9a93160e1679a1327be111cbc25",
"src": "https://github.com/hrsh7th/cmp-path"
},
"cmp_luasnip": {
"rev": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90",
"src": "https://github.com/saadparwaiz1/cmp_luasnip"
},
"conform.nvim": {
"rev": "016802de402556da54c36bd7359b441266b01cdd",
"src": "https://github.com/stevearc/conform.nvim"
},
"dressing.nvim": {
"rev": "2d7c2db2507fa3c4956142ee607431ddb2828639",
"src": "https://github.com/stevearc/dressing.nvim"
},
"everforest": {
"rev": "85a86eb62409e3ec88713bff3d1b9d7374e112e4",
"src": "https://github.com/sainnhe/everforest"
},
"fidget.nvim": {
"rev": "9e0201673e08e997e7cf52afca5565c70bd117f3",
"src": "https://github.com/j-hui/fidget.nvim"
},
"fzf-lua": {
"rev": "48d7c3db291a2c7c1825905c227a6bc81c83b837",
"src": "https://github.com/ibhagwan/fzf-lua"
},
"gruvbox-baby": {
"rev": "bd52e62d8134647090108189e69c8b3cd18bdbbf",
"src": "https://github.com/luisiacc/gruvbox-baby"
},
"gruvbox-material": {
"rev": "11d779b26a9ab2b3db8c22c6ac9fb6e8ed4fea79",
"src": "https://github.com/sainnhe/gruvbox-material"
},
"gruvbox.nvim": {
"rev": "154eb5ff5b96d0641307113fa385eaf0d36d9796",
"src": "https://github.com/ellisonleao/gruvbox.nvim"
},
"kanagawa.nvim": {
"rev": "bb85e4bfc8d89b0e62c8fa53ccdd13d12e2f77b3",
"src": "https://github.com/rebelot/kanagawa.nvim"
},
"lazydev.nvim": {
"rev": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d",
"src": "https://github.com/folke/lazydev.nvim"
},
"lspkind.nvim": {
"rev": "c7274c48137396526b59d86232eabcdc7fed8a32",
"src": "https://github.com/onsails/lspkind.nvim"
},
"lualine.nvim": {
"rev": "221ce6b2d999187044529f49da6554a92f740a96",
"src": "https://github.com/nvim-lualine/lualine.nvim"
},
"markdown-preview.nvim": {
"rev": "ec05f00643513d2e819dcc9176e3a4a0930e33a4",
"src": "https://github.com/sammaji/markdown-preview.nvim"
},
"mason-lspconfig.nvim": {
"rev": "e17625cdc8c2650787467398e02c5d63a2cde966",
"src": "https://github.com/mason-org/mason-lspconfig.nvim"
},
"mason-tool-installer.nvim": {
"rev": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc",
"src": "https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim"
},
"mason.nvim": {
"rev": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d",
"src": "https://github.com/mason-org/mason.nvim"
},
"mini.icons": {
"rev": "f642e3ba8c12afbc8f32f6d77ef6597eac56786f",
"src": "https://github.com/echasnovski/mini.icons"
},
"neogen": {
"rev": "b2e78708876f4da507839726816010a68e33fec8",
"src": "https://github.com/danymat/neogen",
"version": ">=0.0.0"
},
"nvim-cmp": {
"rev": "2ffe79f1f021def8dd1fcd81deb16f1bb0d989f3",
"src": "https://github.com/hrsh7th/nvim-cmp"
},
"nvim-lspconfig": {
"rev": "c59fc922f718fa055f69f5f3bc888f23211571eb",
"src": "https://github.com/neovim/nvim-lspconfig"
},
"nvim-treesitter": {
"rev": "1a4f47b03dfe92d28de7d5654c67327ef008c9e6",
"src": "https://github.com/nvim-treesitter/nvim-treesitter"
},
"nvim-web-devicons": {
"rev": "58447c1fca354bbf184425e4a8d01deecbd6f3c4",
"src": "https://github.com/nvim-tree/nvim-web-devicons"
},
"oil.nvim": {
"rev": "b73018b75affd13fa38e2fc94ef753b465f770d7",
"src": "https://github.com/stevearc/oil.nvim"
},
"plenary.nvim": {
"rev": "74b06c6c75e4eeb3108ec01852001636d85a932b",
"src": "https://github.com/nvim-lua/plenary.nvim"
},
"todo-comments.nvim": {
"rev": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668",
"src": "https://github.com/folke/todo-comments.nvim"
},
"tokyonight.nvim": {
"rev": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6",
"src": "https://github.com/folke/tokyonight.nvim"
},
"trouble.nvim": {
"rev": "bd67efe408d4816e25e8491cc5ad4088e708a69a",
"src": "https://github.com/folke/trouble.nvim"
},
"vim-tmux-navigator": {
"rev": "e41c431a0c7b7388ae7ba341f01a0d217eb3a432",
"src": "https://github.com/christoomey/vim-tmux-navigator"
},
"which-key.nvim": {
"rev": "3aab2147e74890957785941f0c1ad87d0a44c15a",
"src": "https://github.com/folke/which-key.nvim"
}
}
}