7 files changed,
129 insertions(+),
109 deletions(-)
Author:
Oleksandr Smirnov
olexsmir@gmail.com
Committed at:
2025-06-08 02:20:02 +0300
Parent:
dbd5f5a
M
lazy-lock.json
@@ -36,9 +36,6 @@ "orgmode": { "branch": "master", "commit": "b0c9896bfcfb4815ea53f73a7da1a62c5c28efa3" },
"plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, "schemastore.nvim": { "branch": "main", "commit": "0146c7411871d30847b18fb4a288773c3a913bfe" }, "snacks.nvim": { "branch": "main", "commit": "5eac729fa290248acfe10916d92a5ed5e5c0f9ed" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, - "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, - "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, "tokyonight.nvim": { "branch": "main", "commit": "b262293ef481b0d1f7a14c708ea7ca649672e200" }, "undotree": { "branch": "master", "commit": "b951b87b46c34356d44aa71886aecf9dd7f5788a" },
M
lua/core/lsp.lua
@@ -34,13 +34,18 @@ u.map("n", "<leader>lf", function()
vim.lsp.buf.format { async = true } end, bufnr) - u.map("n", "gd", "<cmd>Telescope lsp_definitions<cr>", bufnr) - u.map("n", "gr", "<cmd>Telescope lsp_references<cr>", bufnr) - u.map("n", "gi", "<cmd>Telescope lsp_implementations<cr>", bufnr) + u.map("n", "gd", "<cmd>lua Snacks.picker.lsp_definitions()<cr>", bufnr) + u.map("n", "gr", "<cmd>lua Snacks.picker.lsp_references()<cr>", bufnr) + u.map("n", "gi", "<cmd>lua Snacks.picker.lsp_implementations()<cr>", bufnr) u.map("n", "gl", vim.diagnostic.open_float, bufnr) u.map("n", "<leader>la", vim.lsp.buf.code_action, bufnr) u.map("n", "<leader>lr", vim.lsp.buf.rename, bufnr) - u.map("n", "<leader>ss", "<cmd>Telescope lsp_document_symbols<cr>", bufnr) + u.map( + "n", + "<leader>ss", + "<cmd>lua Snacks.picker.lsp_symbols()<cr>", + bufnr + ) u.map("n", "<leader>ll", vim.lsp.codelens.run, bufnr) u.map("n", "<leader>li", function() if vim.lsp.inlay_hint.is_enabled { bufnr = bufnr } then
M
lua/plugins/core.lua
@@ -50,7 +50,6 @@ "folke/todo-comments.nvim",
event = "BufRead", config = function() require("todo-comments").setup {} - require("telescope").load_extension "todo-comments" end, }, }
M
lua/plugins/git.lua
@@ -70,7 +70,7 @@ kind = "split",
staged_diff_split_kind = "split_above", }, integrations = { - telescope = true, + snacks = true, diffview = true, }, sections = {
A
lua/plugins/lsp.lua
@@ -0,0 +1,79 @@
+---@type LazySpec +return { + "b0o/schemastore.nvim", + { + "j-hui/fidget.nvim", + event = { "BufReadPre", "BufNewFile" }, + opts = { + progress = { + display = { + render_limit = 2, + done_ttl = 2, + }, + }, + }, + }, + { + "RRethy/vim-illuminate", + event = { "BufReadPre", "BufNewFile" }, + opts = { + providers = { "lsp", "treesitter" }, + filetypes_denylist = { + "NeogitStatus", + "TelescopePrompt", + }, + }, + config = function(_, opts) + require("illuminate").configure(opts) + end, + }, + { + "folke/lazydev.nvim", + ft = "lua", + cmd = "LazyDev", + ---@module "lazydev" + ---@type lazydev.Config + ---@diagnostic disable-next-line: missing-fields + opts = { + library = { + { path = "${3rd}/luv/library", words = { "vim%.uv" } }, + { path = "mini.test", words = { "MiniTest" } }, + { path = "mini.ai", words = { "MiniAI" } }, + { path = "snacks.nvim", words = { "Snacks" } }, + "lazy.nvim", + }, + }, + }, + { + "nvimtools/none-ls.nvim", + event = { "BufReadPre", "BufNewFile" }, + config = function() + local null_ls = require "null-ls" + local formatting = null_ls.builtins.formatting + local diagnostic = null_ls.builtins.diagnostics + + null_ls.setup { + sources = { + formatting.pg_format, + diagnostic.codespell.with { + args = { + "--ignore-words", + vim.env.HOME .. "/.config/codespell-ignore.txt", + "-", + }, + }, + + formatting.stylua, + diagnostic.selene.with { + condition = function(utils) + return utils.root_has_file "selene.toml" + end, + }, + + formatting.goimports, + formatting.golines, + }, + } + end, + }, +}
M
lua/plugins/mini.lua
@@ -40,6 +40,24 @@ },
{ "folke/snacks.nvim", lazy = false, + priority = 1001, + keys = function() + local function wrap(mod, fn) + return function() + return Snacks[mod][fn]() + end + end + + return { + { "<leader>f", wrap("picker", "files") }, + { "<leader>b", wrap("picker", "buffers") }, + { "<leader>sr", wrap("picker", "recent") }, + { "<leader>sg", wrap("picker", "grep") }, + { "<leader>sd", wrap("picker", "diagnostics") }, + { "<leader>sh", wrap("picker", "help") }, + { "z=", wrap("picker", "spelling") }, + } + end, ---@module "snacks" ---@type snacks.Config opts = {@@ -47,13 +65,28 @@ image = {
enabled = true, doc = { inline = false }, }, + picker = { + enabled = true, + layout = { + preset = "ivy", + layout = { + height = 25, + }, + }, + win = { + input = { + keys = { + ["<Esc>"] = { "close", mode = { "n", "i" } }, + ["<C-k>"] = { "" }, + ["<C-j>"] = { "" }, + }, + }, + }, + sources = { + select = { layout = { preset = "ivy" } }, + spelling = { layout = { preset = "ivy" } }, + }, + }, }, - config = function(_, opts) - require("snacks").setup(opts) - - vim.api.nvim_create_user_command("SnacksScratch", function() - Snacks.scratch() - end, { nargs = 0 }) - end, }, }
D
@@ -1,93 +0,0 @@
----@type LazySpec -return { - "nvim-telescope/telescope.nvim", - cmd = "Telescope", - dependencies = { - "nvim-telescope/telescope-ui-select.nvim", - { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, - }, - keys = function() - local function grep_string() - vim.ui.input({ prompt = "Grep: " }, function(input) - require("telescope.builtin").grep_string { search = input } - end) - end - - local function wrap(fn) - return function() - return require("telescope.builtin")[fn]() - end - end - - return { - { "<leader>f", wrap "find_files" }, - { "<leader>b", wrap "buffers" }, - { "<leader>sr", wrap "oldfiles" }, - { "<leader>sg", wrap "live_grep" }, - { "<leader>st", grep_string }, - { "<leader>sd", wrap "diagnostics" }, - { "<leader>sh", wrap "help_tags" }, - { "z=", wrap "spell_suggest" }, - } - end, - config = function() - local telescope = require "telescope" - local actions = require "telescope.actions" - - telescope.setup { - defaults = { - prompt_prefix = " ", - selection_caret = " ", - file_ignore_patterns = { - "^\\.git$", - "^\\.bin$", - "^\\tmp$", - "node_modules", - "__pycache__", - "target", - "vendor", - }, - mappings = { - i = { - ["<esc>"] = actions.close, - ["<C-d>"] = actions.delete_buffer, - }, - n = { - ["<C-d>"] = actions.delete_buffer, - }, - }, - }, - pickers = { - find_files = { theme = "ivy" }, - live_grep = { theme = "ivy" }, - grep_string = { theme = "ivy" }, - filetypes = { theme = "ivy" }, - buffers = { theme = "ivy" }, - oldfiles = { theme = "ivy" }, - keymaps = { theme = "ivy" }, - help_tags = { theme = "ivy" }, - diagnostics = { theme = "ivy" }, - spell_suggest = { theme = "ivy" }, - git_branches = { theme = "ivy" }, - git_commits = { theme = "ivy" }, - git_bcommits = { theme = "ivy" }, - git_status = { theme = "ivy" }, - lsp_definitions = { theme = "ivy" }, - lsp_references = { theme = "ivy" }, - lsp_implementations = { theme = "ivy" }, - lsp_document_symbols = { - theme = "ivy", - fname_width = 0.1, - symbol_width = 0.8, - symbol_type_width = 0.1, - }, - }, - extensions = { - ["ui-select"] = { require("telescope.themes").get_ivy {} }, - }, - } - - telescope.load_extension "ui-select" - telescope.load_extension "fzf" - end, -}