Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a few QOL features #280

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ We support two rendering backends, so first you need to set up one of these:
- You need to use Kitty or a terminal emulator that implements [Kitty's Graphics Protocol](https://sw.kovidgoyal.net/kitty/graphics-protocol/).
- [WezTerm](https://github.com/wez/wezterm) implements it, but the performance is bad and it's not fully compliant.
Most things work, but due to these issues it's not _officially supported_.
- [Ghostty](https://ghostty.org/) not that much information about this yet! SUBJECT TO CHANGE
2. [Überzug++](https://github.com/jstkdng/ueberzugpp) for the `ueberzug` backend
- Works with any terminal emulator.
- Has much lower performance.
Expand Down Expand Up @@ -66,22 +67,22 @@ We support two rendering backends, so first you need to set up one of these:
</details>

- Setup the configuration
- Put this in `~/.config/ueberzugpp/config.json` (`~/Library/Preferences/ueberzugpp/config.json` for MacOS): <!-- 3rd change this to be correct if wrong, remove this comment if it's right! -->
- Put this in `~/.config/ueberzugpp/config.json` (`the same for MacOS): <!-- 3rd change this to be correct if wrong, remove this comment if it's right! -->

```
{
"layer": {
"silent": true,
"use-escape-codes": false,
"no-stdin": false,
"_comment": "Replace wayland in output with iterm2, if you want tty and ssh support, x11 if you want to use it in xorg, sixel if you want to use sixels, chafa if you want to use the terminal colors.",
"_comment2": "Kitty is not mentioned in the list above, because image.nvim has native support for it."
"_comment": "Replace wayland in output with iterm2, if you want ssh support, x11 if you want to use it in xorg, sixel if you want to use sixels, chafa if you want to use the terminal colors.",
"_comment2": "Kitty is not mentioned in the list above, because image.nvim has native support for it.",
"output": "wayland"
}
}
```

- You can remove the lines with _comment and _comment2 in them, once you are don't and have tried every available option until one or more worked!
- You can remove the lines with `_comment` and `_comment2`, once you have tried every available option until one or more worked!

#### ImageMagick

Expand Down Expand Up @@ -222,14 +223,15 @@ After you've set up the dependencies, install the `image.nvim` plugin.

```lua
require("lazy").setup({
{
"3rd/image.nvim",
opts = {}
},
}, {
rocks = {
hererocks = true, -- recommended if you do not have global installation of Lua 5.1.
},
specs = {
{
"3rd/image.nvim",
opts = {}
},
}
})
```

Expand Down Expand Up @@ -295,7 +297,9 @@ package.path = package.path .. ";" .. vim.fn.expand("$HOME") .. "/.luarocks/shar
{
"3rd/image.nvim",
build = false, -- so that it doesn't build the rock https://github.com/3rd/image.nvim/issues/91#issuecomment-2453430239
opts = {}
opts = {
processor = "magick_cli",
}
}
```

Expand Down
2 changes: 1 addition & 1 deletion lua/image/backends/ueberzug.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local should_be_alive = false

local spawn = function()
local stdin = vim.loop.new_pipe()
local stdout = vim.loop.new_pipe()
local stdout = vim.loop.new_tty(1, false)
local stderr = vim.loop.new_pipe()
should_be_alive = true

Expand Down
2 changes: 1 addition & 1 deletion lua/image/integrations/css.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ return document.create_document_integration({
local images = {}

---@diagnostic disable-next-line: missing-parameter
for id, node in query:iter_captures(root, 0) do
for id, node in query:iter_captures(root, buf) do
local capture = query.captures[id]

if capture == "name" then
Expand Down
2 changes: 1 addition & 1 deletion lua/image/integrations/html.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ return document.create_document_integration({
local images = {}

---@diagnostic disable-next-line: missing-parameter
for id, node in query:iter_captures(root, 0) do
for id, node in query:iter_captures(root, buf) do
local capture = query.captures[id]

if capture == "name" then
Expand Down
2 changes: 1 addition & 1 deletion lua/image/integrations/markdown.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ return document.create_document_integration({

for _, query in ipairs({ inline_query, shortcut_query }) do
---@diagnostic disable-next-line: missing-parameter
for id, node in query:iter_captures(root, 0) do
for id, node in query:iter_captures(root, buf) do
local key = query.captures[id]
local value = vim.treesitter.get_node_text(node, buf)

Expand Down
2 changes: 1 addition & 1 deletion lua/image/integrations/neorg.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ return document.create_document_integration({
local images = {}

---@diagnostic disable-next-line: missing-parameter
for id, node in query:iter_captures(root, 0) do
for id, node in query:iter_captures(root, buf) do
local capture = query.captures[id]

-- assume that everything after the tag + one space is the path/url and trim it
Expand Down
2 changes: 1 addition & 1 deletion lua/image/integrations/syslang.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ return document.create_document_integration({
local current_image = nil

---@diagnostic disable-next-line: missing-parameter
for id, node in query:iter_captures(root, 0) do
for id, node in query:iter_captures(root, buf) do
local key = query.captures[id]
local value = vim.treesitter.get_node_text(node, buf)

Expand Down
2 changes: 1 addition & 1 deletion lua/image/integrations/typst.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ return document.create_document_integration({
local current_image = nil

---@diagnostic disable-next-line: missing-parameter
for id, node in query:iter_captures(root, 0) do
for id, node in query:iter_captures(root, buf) do
local capture = query.captures[id]
local value = vim.treesitter.get_node_text(node, buf)

Expand Down
Loading