mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-12 18:24:35 +02:00
plugins/hex: init
This commit is contained in:
parent
1d6afdbce0
commit
ffa9b8f7a0
2 changed files with 83 additions and 0 deletions
45
plugins/by-name/hex/default.nix
Normal file
45
plugins/by-name/hex/default.nix
Normal file
|
@ -0,0 +1,45 @@
|
|||
{ lib, pkgs, ... }:
|
||||
let
|
||||
inherit (lib.nixvim) defaultNullOpts mkNullOrLuaFn;
|
||||
in
|
||||
lib.nixvim.neovim-plugin.mkNeovimPlugin {
|
||||
name = "hex";
|
||||
originalName = "hex.nvim";
|
||||
package = "hex-nvim";
|
||||
|
||||
maintainers = [ lib.maintainers.GaetanLepage ];
|
||||
|
||||
extraOptions = {
|
||||
xxdPackage = lib.mkPackageOption pkgs [
|
||||
"unixtools"
|
||||
"xxd"
|
||||
] { nullable = true; };
|
||||
};
|
||||
|
||||
extraConfig = cfg: { extraPackages = [ cfg.xxdPackage ]; };
|
||||
|
||||
settingsOptions = {
|
||||
dump_cmd = defaultNullOpts.mkStr "xxd -g 1 -u" ''
|
||||
cli command used to dump hex data.
|
||||
'';
|
||||
|
||||
assemble_cmd = defaultNullOpts.mkStr "xxd -r" ''
|
||||
cli command used to dump hex data.
|
||||
'';
|
||||
|
||||
is_buf_binary_pre_read = mkNullOrLuaFn ''
|
||||
Function that runs on `BufReadPre` to determine if it's binary or not.
|
||||
It should return a boolean value.
|
||||
'';
|
||||
|
||||
is_buf_binary_post_read = mkNullOrLuaFn ''
|
||||
Function that runs on `BufReadPost` to determine if it's binary or not.
|
||||
It should return a boolean value.
|
||||
'';
|
||||
};
|
||||
|
||||
settingsExample = {
|
||||
dump_cmd = "xxd -g 1 -u";
|
||||
assemble_cmd = "xxd -r";
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue