Comments (6)
Ah it's complicated, can look into it after finishing the first rewrite.
from image.nvim.
Thanks for this. Anyone coming here looking for a toggle command, @3rd also exposed an is_enabled api function, so I have
vim.keymap.set("n", "<leader>ti", function()
if image.is_enabled() then
image.disable()
else
image.enable()
end
end, {})
from image.nvim.
Hey, here's a sample for clearing / rerendering from Discord:
local api = require("image")
local bufnr = vim.api.nvim_get_current_buf()
local images = api.get_images({ buffer = bufnr })
for _, image in ipairs(images) do
image:clear(true)
end
vim.keymap.set("n", "<leader>x", function()
for _, image in ipairs(images) do
image:render()
end
end)
Will add a built-in way to toggle them, we also need to disable the integration when it's turned off.
from image.nvim.
vim.keymap.set({ "n", "v" }, "<leader>pt", function()
local bufnr = vim.api.nvim_get_current_buf()
local images = api.get_images({ buffer = bufnr })
for _, image in ipairs(images) do
image:clear(true)
end
end, opts)
This doesn't hide the image but just blinks it when ++<leader>-p-t++
from image.nvim.
@MikeLemo1 Try this branch please: #182
local api = require("image")
vim.keymap.set({ "n", "v" }, "<c-c>", function()
api.disable()
end, {})
vim.keymap.set({ "n", "v" }, "<c-x>", function()
api.enable()
end, {})
from image.nvim.
with lazy plugin manager:
{
"3rd/image.nvim",
branch = "feat/toggle-rendering",
config = function()
local api = require("image")
vim.keymap.set({ "n", "v" }, "<leader>pc", function()
api.disable()
end, {})
vim.keymap.set({ "n", "v" }, "<leader>po", function()
api.enable()
end, {})
end,
}
Does the trick!
BTW Whatbout the image offset? it also might require "padding offset" as it can also be reduced one column less for more "page efficiecy"
from image.nvim.
Related Issues (20)
- [Bug] Image overlap till next line
- Unexpected effect on ext_messages
- Alacritty with Ueberzug in Wayland remains blank HOT 1
- Curl gives an error (maybe related to query string parameters handling?) HOT 1
- [Bug]: Misplacement of pictures HOT 11
- [ADD] Add SVG File preview support (maybe using `cairosvg`?) HOT 5
- Ability to supply headers/modify the http request to fetch remote images HOT 2
- Image overlaps statusline when laststatus=2 HOT 2
- Telescope preview issue HOT 4
- Supports Tabby Terminal Manager
- Display local gifs with ueberzug HOT 2
- Images not displaying HOT 2
- Wezterm Sticky Image HOT 1
- feature:could this support latex? HOT 3
- Help with rendering images within ObsidianVault HOT 2
- Error wont go away (lazy.nvim luarocks) HOT 20
- magick rock not found HOT 4
- Image appears Rotated by 90 degrees every time I open it with neovim
- image plugin messes up with telescope insert mode
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from image.nvim.