hex.nvim 使用教程
hex.nvimhex editing done right项目地址:https://gitcode.com/gh_mirrors/he/hex.nvim
1. 项目的目录结构及介绍
hex.nvim/
├── LICENSE
├── README.md
├── lua/
│ └── hex/
│ ├── init.lua
│ └── ...
├── ...
- LICENSE: 项目的许可证文件。
- README.md: 项目的说明文档。
- lua/hex/: 包含项目的主要代码文件。
- init.lua: 项目的初始化文件。
2. 项目的启动文件介绍
项目的启动文件是 lua/hex/init.lua
。这个文件负责初始化插件,并设置相关的配置选项。
3. 项目的配置文件介绍
项目的配置文件通常在 Neovim 的配置文件中进行设置。以下是一个示例配置:
require 'hex'.setup {
-- cli command used to dump hex data
dump_cmd = 'xxd -g 1 -u',
-- cli command used to assemble from hex data
assemble_cmd = 'xxd -r',
-- function that runs on BufReadPre to determine if it's binary or not
is_buf_binary_pre_read = function()
-- logic that determines if a buffer contains binary data or not
-- must return a bool
end,
-- function that runs on BufReadPost to determine if it's binary or not
is_buf_binary_post_read = function()
-- logic that determines if a buffer contains binary data or not
-- must return a bool
end
}
通过这个配置文件,可以设置用于转储和组装十六进制数据的命令,以及在读取缓冲区前后判断是否为二进制文件的函数。
hex.nvimhex editing done right项目地址:https://gitcode.com/gh_mirrors/he/hex.nvim