chore(neovim): Use snacks.nvim to view images

- Remove `image.nvim` for image display on markdown
- Simple code reorg
This commit is contained in:
Pratik Tripathy
2025-07-22 16:40:36 +05:30
parent 9ed4ee445b
commit eb4bd841b3
4 changed files with 17 additions and 19 deletions

View File

@@ -26,7 +26,7 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
if vim.v.shell_error ~= 0 then if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({ vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" }, { "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" }, { out, "WarningMsg" },
{ "\nPress any key to exit..." }, { "\nPress any key to exit..." },
}, true, {}) }, true, {})
vim.fn.getchar() vim.fn.getchar()

View File

@@ -30,9 +30,12 @@ return {
-- Place cursor on "View Documentation" gx -> Open the docs on browser -- Place cursor on "View Documentation" gx -> Open the docs on browser
map("K", "<cmd>Lspsaga hover_doc<cr>", "Hover Documentation") map("K", "<cmd>Lspsaga hover_doc<cr>", "Hover Documentation")
map("<F2>", vim.lsp.buf.rename, "Rename Symbol") map("<F2>", vim.lsp.buf.rename, "Rename Symbol")
map("<C-.>", "<cmd>Lspsaga code_action<cr>", "Code Actions") map("<C-.>", "<cmd>Lspsaga code_action<cr>", "Code Actions")
map("<leader>ca", "<cmd>Lspsaga code_action<cr>", "Code Actions") map("<leader>ca", "<cmd>Lspsaga code_action<cr>", "Code Actions")
map("<leader>cr", "<cmd>Lspsaga finder<cr>", "Goto References") map("<leader>cr", "<cmd>Lspsaga finder<cr>", "Goto References")
map("<leader>cpf", "<cmd>Lspsaga peek_definition<cr>", "Peek definition: Function") map("<leader>cpf", "<cmd>Lspsaga peek_definition<cr>", "Peek definition: Function")
map("<leader>cpt", "<cmd>Lspsaga peek_type_definition<cr>", "Peek definition: Class") map("<leader>cpt", "<cmd>Lspsaga peek_type_definition<cr>", "Peek definition: Class")
map("<leader>cpi", "<cmd>Lspsaga finder imp<cr>", "Peek: Implementations") map("<leader>cpi", "<cmd>Lspsaga finder imp<cr>", "Peek: Implementations")
@@ -42,12 +45,15 @@ return {
-- To jump back, press <C-t>. -- To jump back, press <C-t>.
map("gd", require("telescope.builtin").lsp_definitions, "[G]oto [D]efinition") map("gd", require("telescope.builtin").lsp_definitions, "[G]oto [D]efinition")
map("<F12>", require("telescope.builtin").lsp_definitions, "[G]oto [D]efinition") map("<F12>", require("telescope.builtin").lsp_definitions, "[G]oto [D]efinition")
map("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration") map("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
map("gI", require("telescope.builtin").lsp_implementations, "[G]oto [I]mplementation") map("gI", require("telescope.builtin").lsp_implementations, "[G]oto [I]mplementation")
map("<leader>ci", require("telescope.builtin").lsp_implementations, "Goto Implementation")
map("<leader>cs", require("telescope.builtin").lsp_document_symbols, "Search Document Symbols") map("<leader>cs", require("telescope.builtin").lsp_document_symbols, "Search Document Symbols")
map("<leader>cS", require("telescope.builtin").lsp_dynamic_workspace_symbols, "Search Workspace Symbols") map("<leader>cS", require("telescope.builtin").lsp_dynamic_workspace_symbols, "Search Workspace Symbols")
map("<leader>ci", require("telescope.builtin").lsp_implementations, "Goto Implementation")
map("<leader>ct", require("telescope.builtin").lsp_type_definitions, "Goto Type Definition") map("<leader>ct", require("telescope.builtin").lsp_type_definitions, "Goto Type Definition")
-- e to jump to the symbol under cursor; q to quit -- e to jump to the symbol under cursor; q to quit
map("<leader>co", "<cmd>Lspsaga outline<cr>", "Outline Panel on Left") map("<leader>co", "<cmd>Lspsaga outline<cr>", "Outline Panel on Left")

View File

@@ -149,14 +149,4 @@ return {
}, },
-- TIP: Use :PasteImage -- TIP: Use :PasteImage
}, },
-- View images in Neovim
{
"3rd/image.nvim",
build = false,
opts = {
-- Use ImageMagick (Fedora) or imagemagick (Debian) installed
processor = "magick_cli",
},
},
} }

View File

@@ -35,6 +35,14 @@ return {
input = { input = {
enabled = true, enabled = true,
}, },
image = {
enabled = true,
doc = {
max_width = 80,
max_height = 68,
},
img_dirs = { "img", "images", "assets", "static", "public", "media", "attachments", ".artifacts/img" },
},
lazygit = { lazygit = {
enabled = true, enabled = true,
configure = true, configure = true,
@@ -140,7 +148,7 @@ return {
desc = "Notification History", desc = "Notification History",
}, },
{ {
"<leader>z", "<S-Esc>",
function() function()
Snacks.zen() Snacks.zen()
end, end,
@@ -156,12 +164,6 @@ return {
}, },
}, },
-- Navigate between NVIM & Tmux splits seamlessly
{
"christoomey/vim-tmux-navigator",
cond = require("config.util").is_not_vscode(),
},
-- Navigate between NVIM & kitty splits -- Navigate between NVIM & kitty splits
{ {
"knubie/vim-kitty-navigator", "knubie/vim-kitty-navigator",