-
-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(media): added image.nvim plugin
- Loading branch information
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# image.nvim | ||
|
||
This plugin attempts to add image support to Neovim. | ||
|
||
**Repository:** <https://github.com/3rd/image.nvim> | ||
|
||
Works with Kitty + Tmux, and it handles painful things like rendering an image at a given position in a buffer, scrolling, windows, etc. | ||
|
||
It has built-in Markdown and Neorg integrations that you can use right now. | ||
It can also render image files as images when opened. | ||
|
||
**Requirements** | ||
|
||
These are things you have to setup on your own | ||
|
||
* ImageMagick - **mandatory** | ||
* magick LuaRock - **mandatory** (luarocks --local --lua-version=5.1 install magick) | ||
* Kitty >= 28.0 - for the kitty backend | ||
* ueberzugpp - for the ueberzug backend | ||
* curl - for remote images | ||
|
||
**This plugin is configured to be used with kitty terminal and lua 5.1** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package.path = package.path .. ";" .. vim.fn.expand "$HOME" .. "/.luarocks/share/lua/5.1/?/init.lua;" | ||
package.path = package.path .. ";" .. vim.fn.expand "$HOME" .. "/.luarocks/share/lua/5.1/?.lua;" | ||
|
||
return { | ||
"3rd/image.nvim", | ||
event = "VeryLazy", | ||
dependencies = { | ||
{ | ||
"nvim-treesitter/nvim-treesitter", | ||
build = ":TSUpdate", | ||
config = function() | ||
require("nvim-treesitter.configs").setup { | ||
ensure_installed = { "markdown" }, | ||
highlight = { enable = true }, | ||
} | ||
end, | ||
}, | ||
}, | ||
opts = { | ||
backend = "kitty", | ||
integrations = { | ||
markdown = { | ||
enabled = true, | ||
clear_in_insert_mode = false, | ||
download_remote_images = true, | ||
only_render_image_at_cursor = false, | ||
filetypes = { "markdown", "vimwiki" }, -- markdown extensions (ie. quarto) can go here | ||
}, | ||
neorg = { | ||
enabled = true, | ||
clear_in_insert_mode = false, | ||
download_remote_images = true, | ||
only_render_image_at_cursor = false, | ||
filetypes = { "norg" }, | ||
}, | ||
}, | ||
max_width = nil, | ||
max_height = nil, | ||
max_width_window_percentage = nil, | ||
max_height_window_percentage = 50, | ||
kitty_method = "normal", | ||
hijack_file_patterns = { "*.png", "*.jpg", "*.jpeg", "*.gif", "*.webp" }, -- render image files as images when opened | ||
}, | ||
} |