markdown with image rendering + lsp-config

This commit is contained in:
2025-11-16 04:04:27 -05:00
parent 4c1a71c1df
commit 65f8b53cfc
9 changed files with 83 additions and 3 deletions

View File

@@ -16,6 +16,9 @@ To open [README.md](./README.md): `<leader>hr`
- vim-sleuth: autodetect file indentation rules/policies
- showkeys: show typped keys
- smear-cursor: visual cue of motion
- render-markdown: view rendered markdown in nvim
- image: render image (need to use kitty as terminal)
- luarocks: needed to visualize images in markdown
### mainstream packages

View File

@@ -4,6 +4,9 @@
- [Recent (2025-11-15) example of lsp setup](https://www.youtube.com/watch?v=oBiBEx7L000)
- [Example of rust + lsp](https://www.youtube.com/watch?v=E2mKJ73M9pg)
- [Example of rust with nvim + lsp ](https://www.youtube.com/watch?v=E2mKJ73M9pg)
- [How to use autocmd](https://www.youtube.com/watch?v=qN6BuJpsFbQ)
- [markdown setup by linkarzu (including images rendering)](https://linkarzu.com/posts/neovim/markdown-setup-2025/#meanderingprogrammerrender-markdownnvim)
- [linkazu demonstrating and explaining its setup to render images in markdown](https://www.youtube.com/watch?v=0O3kqGwNzTI)
- https://www.youtube.com/watch?v=g1gyYttzxcI

View File

@@ -5,6 +5,8 @@
- [ ] telescope: Install and learn how to use
- [ ] cmp-nvim or cmp-nvim-lsp or ... (autocompletion)
- [ ] choose a linter
- [ ]
## lsp
@@ -15,3 +17,6 @@
## Files browsing
- [ ] see the current path of oil
## auto-completion
- [ ] learn how it works in neovim

View File

@@ -1,13 +1,17 @@
{
"image.nvim": { "branch": "master", "commit": "446a8a5cc7a3eae3185ee0c697732c32a5547a0b" },
"kanagawa.nvim": { "branch": "master", "commit": "aef7f5cec0a40dbe7f3304214850c472e2264b10" },
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
"luarocks.nvim": { "branch": "main", "commit": "1db9093915eb16ba2473cfb8d343ace5ee04130a" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "b1d9a914b02ba5660f1e272a03314b31d4576fe2" },
"mason.nvim": { "branch": "main", "commit": "57e5a8addb8c71fb063ee4acda466c7cf6ad2800" },
"mini.icons": { "branch": "main", "commit": "ff2e4f1d29f659cc2bad0f9256f2f6195c6b2428" },
"mini.nvim": { "branch": "main", "commit": "dce9bc4e19d02d5c37fe71c16f40f8a5536b0386" },
"mini.statusline": { "branch": "main", "commit": "e331175f10d9f400b42523b3890841aba202ce16" },
"nvim-lspconfig": { "branch": "master", "commit": "abf6d190f2c06818489c0bd4b926e7e3a06c5e51" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"oil.nvim": { "branch": "master", "commit": "7e1cd7703ff2924d7038476dcbc04b950203b902" },
"render-markdown.nvim": { "branch": "main", "commit": "13bfaaabaaf732cf58d14004ed79b331bb40b838" },
"rustaceanvim": { "branch": "master", "commit": "88575b98bb9937fb9983ddec5e532b67e75ce677" },
"showkeys": { "branch": "main", "commit": "cb0a50296f11f1e585acffba8c253b9e8afc1f84" },
"smear-cursor.nvim": { "branch": "main", "commit": "abfa5835920b1d76c0e24e1465a618ad914be90a" },

View File

@@ -16,6 +16,12 @@ vim.keymap.set('n', "<leader>wq", "<cmd>wq<CR>", { desc = "Save and quit" } )
vim.keymap.set('n', "<leader>qq", "<cmd>q!<CR>", { desc = "Force to quit without saving" } )
-- switch between windows
vim.keymap.set("n", "<leader>j", "<C-w>j")
vim.keymap.set("n", "<leader>h", "<C-w>h")
vim.keymap.set("n", "<leader>k", "<C-w>k")
vim.keymap.set("n", "<leader>l", "<C-w>l")
-- TERMINAL
-- exit t mode
km("t", "<Esc>", "<C-\\><C-n>", { desc = "Exit terminal mode"})

48
lua/plugins/image.lua Normal file
View File

@@ -0,0 +1,48 @@
return {
"3rd/image.nvim",
build = false, -- so that it doesn't build the rock https://github.com/3rd/image.nvim/issues/91#issuecomment-2453430239
opts = {
processor = "magick_cli",
},
config = function()
require("image").setup({
backend = "kitty", -- or "ueberzug" or "sixel"
processor = "magick_cli", -- or "magick_rock"
integrations = {
markdown = {
enabled = true,
clear_in_insert_mode = false,
download_remote_images = true,
only_render_image_at_cursor = false,
only_render_image_at_cursor_mode = "popup", -- or "inline"
floating_windows = false, -- if true, images will be rendered in floating markdown windows
filetypes = { "markdown", "vimwiki" }, -- markdown extensions (ie. quarto) can go here
},
neorg = {
enabled = true,
filetypes = { "norg" },
},
typst = {
enabled = true,
filetypes = { "typst" },
},
html = {
enabled = false,
},
css = {
enabled = false,
},
},
max_width = nil,
max_height = nil,
max_width_window_percentage = nil,
max_height_window_percentage = 50,
scale_factor = 1.0,
window_overlap_clear_enabled = false, -- toggles images when windows are overlapped
window_overlap_clear_ft_ignore = { "cmp_menu", "cmp_docs", "snacks_notif", "scrollview", "scrollview_sign" },
editor_only_render_when_focused = false, -- auto show/hide images when the editor gains/looses focus
tmux_show_only_in_active_window = false, -- auto show/hide images in the correct Tmux window (needs visual-activity off)
hijack_file_patterns = { "*.png", "*.jpg", "*.jpeg", "*.gif", "*.webp", "*.avif" }, -- render image files as images when opened
})
end
}

View File

@@ -1,3 +0,0 @@
return {
"neovim/nvim-lspconfig"
}

5
lua/plugins/luarocks.lua Normal file
View File

@@ -0,0 +1,5 @@
return {
"vhyrro/luarocks.nvim",
priority = 1000, -- Very high priority is required, luarocks.nvim should run as the first plugin in your config.
config = true,
}

View File

@@ -0,0 +1,9 @@
return {
'MeanderingProgrammer/render-markdown.nvim',
dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-mini/mini.nvim' }, -- if you use the mini.nvim suite
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-mini/mini.icons' }, -- if you use standalone mini plugins
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons
---@module 'render-markdown'
---@type render.md.UserConfig
opts = {},
}