diff --git a/README.md b/README.md index f44cf4e..b5c7ff9 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,9 @@ To open [README.md](./README.md): `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 diff --git a/REFERENCES.md b/REFERENCES.md index b40e6c9..bb9446d 100644 --- a/REFERENCES.md +++ b/REFERENCES.md @@ -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 diff --git a/TODO.md b/TODO.md index e30a01d..aab5533 100644 --- a/TODO.md +++ b/TODO.md @@ -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 diff --git a/lazy-lock.json b/lazy-lock.json index 518cbd1..f2708aa 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -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" }, diff --git a/lua/config/keymap.lua b/lua/config/keymap.lua index d3aa488..c811beb 100644 --- a/lua/config/keymap.lua +++ b/lua/config/keymap.lua @@ -16,6 +16,12 @@ vim.keymap.set('n', "wq", "wq", { desc = "Save and quit" } ) vim.keymap.set('n', "qq", "q!", { desc = "Force to quit without saving" } ) +-- switch between windows +vim.keymap.set("n", "j", "j") +vim.keymap.set("n", "h", "h") +vim.keymap.set("n", "k", "k") +vim.keymap.set("n", "l", "l") + -- TERMINAL -- exit t mode km("t", "", "", { desc = "Exit terminal mode"}) diff --git a/lua/plugins/image.lua b/lua/plugins/image.lua new file mode 100644 index 0000000..b395975 --- /dev/null +++ b/lua/plugins/image.lua @@ -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 +} diff --git a/lua/plugins/lspconfig.lua.bak b/lua/plugins/lspconfig.lua.bak deleted file mode 100644 index 3657f57..0000000 --- a/lua/plugins/lspconfig.lua.bak +++ /dev/null @@ -1,3 +0,0 @@ -return { - "neovim/nvim-lspconfig" -} diff --git a/lua/plugins/luarocks.lua b/lua/plugins/luarocks.lua new file mode 100644 index 0000000..c8dfe6c --- /dev/null +++ b/lua/plugins/luarocks.lua @@ -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, +} diff --git a/lua/plugins/render-markdown.lua b/lua/plugins/render-markdown.lua new file mode 100644 index 0000000..a516a41 --- /dev/null +++ b/lua/plugins/render-markdown.lua @@ -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 = {}, +}