From d776924ffc05c7fa79cbf1add8f1d42ae02208a9 Mon Sep 17 00:00:00 2001 From: RafayAhmad7548 Date: Sat, 11 Apr 2026 21:15:45 +0500 Subject: [PATCH] replace image.nvim with snacks image, and new rest.nvim shortcut --- .config/nvim/lazy-lock.json | 1 - .config/nvim/lua/config/keymaps.lua | 16 +++++++++++++--- .../lua/config/plugins/languages/notebook.lua | 16 ---------------- .config/nvim/lua/config/plugins/snacks.lua | 3 ++- 4 files changed, 15 insertions(+), 21 deletions(-) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 8e25a06..bbf4bc0 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -8,7 +8,6 @@ "flutter-tools.nvim": { "branch": "main", "commit": "677cc07c16e8b89999108d2ebeefcfc5f539b73c" }, "gitsigns.nvim": { "branch": "main", "commit": "8d82c240f190fc33723d48c308ccc1ed8baad69d" }, "harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" }, - "image.nvim": { "branch": "master", "commit": "c40215d7d7d1d8c823ee9a77be1a894d5c8df41b" }, "jupytext.nvim": { "branch": "main", "commit": "c8baf3ad344c59b3abd461ecc17fc16ec44d0f7b" }, "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, "lazydev.nvim": { "branch": "main", "commit": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d" }, diff --git a/.config/nvim/lua/config/keymaps.lua b/.config/nvim/lua/config/keymaps.lua index df556e7..0ff649a 100644 --- a/.config/nvim/lua/config/keymaps.lua +++ b/.config/nvim/lua/config/keymaps.lua @@ -230,9 +230,19 @@ vim.keymap.set('n', 'rr', 'Rest run', { desc = 'Run request und vim.keymap.set('n', 'ro', 'vert Rest open', { desc = 'Open result pane'}) vim.keymap.set('n', 'rl', 'Rest last', { desc = 'Run last request'}) vim.keymap.set('n', 'rn', function () - vim.ui.input({prompt = 'Enter request name'}, function (value) - if value then - vim.cmd('Rest run ' .. value) + local lines = vim.api.nvim_buf_get_lines(0, 0, -1, false) + local items = {} + + for _, line in ipairs(lines) do + local capture = line:match('# @name (%w+)') + if capture then + table.insert(items, capture) + end + end + + vim.ui.select(items, { prompt = 'Run Request' }, function (choice) + if choice then + vim.cmd('Rest run ' .. choice) end end) end, { desc = 'Run last request'}) diff --git a/.config/nvim/lua/config/plugins/languages/notebook.lua b/.config/nvim/lua/config/plugins/languages/notebook.lua index 8fba839..da211f4 100644 --- a/.config/nvim/lua/config/plugins/languages/notebook.lua +++ b/.config/nvim/lua/config/plugins/languages/notebook.lua @@ -54,25 +54,9 @@ end, { }) return { - { - '3rd/image.nvim', - version = '1.1.0', - build = false, -- so that it doesn't build the rock https://github.com/3rd/image.nvim/issues/91#issuecomment-2453430239 - opts = { - backend = 'kitty', -- whatever backend you would like to use - max_width = 100, - max_height = 20, - max_height_window_percentage = math.huge, - max_width_window_percentage = math.huge, - window_overlap_clear_enabled = true, -- toggles images when windows are overlapped - window_overlap_clear_ft_ignore = { 'cmp_menu', 'cmp_docs', '' }, - } - - }, { 'benlubas/molten-nvim', version = '^1.0.0', -- use version <2.0.0 to avoid breaking changes - dependencies = { '3rd/image.nvim' }, build = ':UpdateRemotePlugins', init = function() -- these are examples, not defaults. Please see the readme diff --git a/.config/nvim/lua/config/plugins/snacks.lua b/.config/nvim/lua/config/plugins/snacks.lua index 8e3c376..bfdc64d 100644 --- a/.config/nvim/lua/config/plugins/snacks.lua +++ b/.config/nvim/lua/config/plugins/snacks.lua @@ -111,13 +111,14 @@ return { } }, + image = { enabled = true }, + bufdelete = { enabled = false }, debug = { enabled = false }, dim = { enabled = false }, explorer = { enabled = false }, git = { enabled = false }, gitbrowse = { enabled = false }, - image = { enabled = false }, layout = { enabled = false }, lazygit = { enabled = false }, notifier = { enabled = false },