Comments (3)
The automatic hex dumping feature can be disabled by passing the following config options during setup:
require 'hex'.setup {
is_file_binary_pre_read = function() return false end,
is_file_binary_post_read = function() return false end,
}
one can of course implement their own detection logic in there, checkout the README for more info.
Also thanks :)
from hex.nvim.
@AadityaGala I am also using LazyVim, but it can't work perfectly. I can use :lua require("hex").toggle()
, but :HexToggle
not work. Could you please give me your configuration?
from hex.nvim.
return {
-- add symbols-outline
{
"RaafatTurki/hex.nvim",
event = "VeryLazy",
config = function()
require("hex").setup({
dump_cmd = "xxd -g 1 -u",
assemble_cmd = "xxd -r",
is_file_binary_pre_read = function()
local binary_ext = { "out", "bin", "png", "jpg", "jpeg", "exe", "dll" }
local binary_ext_ignore = { "a2l" }
-- only work on normal buffers
if vim.bo.ft ~= "" then
return false
end
-- check -b flag
if vim.bo.bin then
return true
end
-- check ext within binary_ext
local ext = vim.fn.expand("%:e")
if vim.tbl_contains(binary_ext_ignore, ext) then
return false
elseif vim.tbl_contains(binary_ext, ext) then
return true
end
-- none of the above
return false
end,
is_file_binary_post_read = function()
local encoding = (vim.bo.fenc ~= "" and vim.bo.fenc) or vim.o.enc
local binary_ext_ignore = { "a2l" }
local ext = vim.fn.expand("%:e")
if vim.tbl_contains(binary_ext_ignore, ext) then
return false
end
if encoding ~= "utf-8" then
return true
end
return false
end,
})
end,
},
}
from hex.nvim.
Related Issues (15)
- media issue
- wierd string at first load HOT 2
- Hex breaks Oil HOT 1
- not seem to work HOT 5
- Writing binary is no longer executable HOT 4
- Not an editor command: LspStop HOT 5
- Add install inscructions for vim plugged HOT 2
- Trouble opening windows executables HOT 6
- vim.lsp.buf.server_ready is deprecated :help deprecated This feature will be removed in Nvim version 0.10.0 HOT 1
- DAP UI integration? HOT 5
- Error detected | using Blob as a String HOT 1
- Confusing editor behavior HOT 5
- Binary Executable breaks on Write Back HOT 3
- disabling or overriding is_buf_binary_pre_read() HOT 3
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 hex.nvim.