Add support for hexediting to nvim
This commit is contained in:
parent
af53ec73c7
commit
30cc4f16e5
3 changed files with 24 additions and 0 deletions
|
@ -14,6 +14,7 @@ in
|
|||
./clangd.nix
|
||||
./elixir.nix
|
||||
./dart.nix
|
||||
./hexeditor.nix
|
||||
];
|
||||
|
||||
options.mae.nvim = {
|
||||
|
|
22
users/modules/neovim/hexeditor.nix
Normal file
22
users/modules/neovim/hexeditor.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{ lib, pkgs, config, ... }:
|
||||
let
|
||||
cfg = config.mae.nvim.hexeditor;
|
||||
in
|
||||
{
|
||||
options.mae.nvim.hexeditor.enable = lib.mkEnableOption "Enable hexediting in neovim";
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.neovim.extraConfig = ''
|
||||
augroup Binary
|
||||
au!
|
||||
au BufReadPre *.bin let &bin=1
|
||||
au BufReadPost *.bin if &bin | %!xxd
|
||||
au BufReadPost *.bin set ft=xxd | endif
|
||||
au BufWritePre *.bin if &bin | %!xxd -r
|
||||
au BufWritePre *.bin endif
|
||||
au BufWritePost *.bin if &bin | %!xxd
|
||||
au BufWritePost *.bin set nomod | endif
|
||||
augroup END
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -12,5 +12,6 @@
|
|||
python.enable = true;
|
||||
elixir.enable = true;
|
||||
dart.enable = true;
|
||||
hexeditor.enable = true;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue