Giter Site home page Giter Site logo

hex.nvim's Introduction

🟠inking with portals. Now you're th🔵

hex.nvim's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

hex.nvim's Issues

Add install inscructions for vim plugged

I tried to install the plugin with Vim plugged:

Plug 'RaafatTurki/hex.nvim'
require 'hex'.setup()

:PlugInstall gave me a successfull installation, but I cant use the commands like :HexDump
It would be good to have instructions for vim plugged.
I assume at least that it did not work because of my install method.

Disable automatic detection for certain filetypes

Is there a method available such that hex would not be applied to certain filetypes? Have a bunch of large files that are text files but hex detects them as binary files and automagically displays the file in hex. Simple :HexToggle does revert it back so not that big of an issue. But the files are big and it does take a few seconds to convert back and forth.

Awesome plugin. Works seamlessly with LazyVim.

DAP UI integration?

I'm not exactly sure how hex editors work. Is this a compiled view or can this also be dynamic view? Is there a way to connect to dap-ui and view the editor update the memory in real time?

Like a floating window, but in neovim:

Ref: Video from 22:16 https://youtu.be/T4CjOB0y9nI?feature=shared

not seem to work

I used ":HexDump" and it says "already dumped " but nothing seems to have changed.
I'm new to nvim so I don't know how to handle.

image

Writing binary is no longer executable

WSL2 Ubuntu 22.04.2 LTS
NVIM v0.10.0-dev

I followed the exact steps as the gif in the README and attempting to write the buffer makes the binary no longer executable.
Resulting an error of either exec format error: ./a.out or Segmentation fault.
This occurs without any modification to the data, simply writing the buffer after opening a.out had the same result.

Not an editor command: LspStop

When I toggle the hex view it works, but when going from hex view to normal view I get:

Error executing Lua callback: ...are/nvim/site/pack/packer/opt/hex.nvim/lua/hex/utils.lua:17: Vim:E492: Not an editor command: LspStop
stack traceback:
        [C]: in function 'cmd'
        ...are/nvim/site/pack/packer/opt/hex.nvim/lua/hex/utils.lua:17: in function 'dump_to_hex'
        ...cal/share/nvim/site/pack/packer/opt/hex.nvim/lua/hex.lua:31: in function 'dump'
        ...cal/share/nvim/site/pack/packer/opt/hex.nvim/lua/hex.lua:47: in function <...cal/share/nvim/site/pack/packer/opt/hex.nvim/lua/hex.lu
a:45>

Binary Executable breaks on Write Back

Overview

Opening a binary file and trying to save it after using :HexToggle breaks the executable.

The problem stems from the binary being opened as a regular file, since the plugin cannot determine that the file is a binary due to missing file extension and not being opened with the -b flag.

From the VIM docs, this will likely break the file due to wrong handling.

This is likely a user error since the flag should be provided when opening the file but (some) users likely don't know about this behavior.

Proposed Fix

Set the buffer as "binary" when calling dump_to_hex.

  vim.bo.bin = true

I can prepare a PR for this if you'd like.

Steps to Reproduce

Prepare Binary

Compile the following content with gcc -o run main.c.

#include <stdio.h>

int main() {
  printf("hello\n");
  return 0;
}

Executing the binary prints "hello", as expected.

Save Binary

  1. Open the binary with nvim run
  2. Call :HexToggle (hexdump content still correct)
  3. Save with :w

The binary is broken after step 3.
Trying to execute the binary now gives the output

Segmentation fault (core dumped)

Trouble opening windows executables

I like to manually patch my games to fit my monitor ratio of 4:3 then run those patched files through proton, I wanted to switch from using ghex to using your tool because I already use nvim for everything else.

Whenever I open any exe files I get the following for example when opening tekken..

xxd: /away/plant/Steam/steamapps/common/TEKKEN\ 7/TEKKEN\ 7.exe: No such file or directory

Error detected | using Blob as a String

When trying to save the hex the following error is thrown:

Error detected while processing BufWritePre Autocommands for "*":
Error executing lua callback: vim/_editor.lua:0: BufWritePre Autocommands for "*"..script nvim_exec2() called at BufWritePre Autocommands for "*":0: Vim(!):Error executi
ng lua callback: Vim:E976: using Blob as a String
stack traceback:
        [C]: in function 'strcharpart'
        ...cal/share/nvim/lazy/cmp-buffer/lua/cmp_buffer/buffer.lua:316: in function 'index_line'
        ...cal/share/nvim/lazy/cmp-buffer/lua/cmp_buffer/buffer.lua:125: in function 'callback'
        ...cal/share/nvim/lazy/cmp-buffer/lua/cmp_buffer/buffer.lua:110: in function 'safe_buf_call'
        ...cal/share/nvim/lazy/cmp-buffer/lua/cmp_buffer/buffer.lua:117: in function 'index_range'
        ...cal/share/nvim/lazy/cmp-buffer/lua/cmp_buffer/buffer.lua:272: in function <...cal/share/nvim/lazy/cmp-buffer/lua/cmp_buffer/buffer.lua:187>
        [C]: in function 'nvim_exec2'
        vim/_editor.lua: in function 'cmd'
        ...myzel394/.local/share/nvim/lazy/hex.nvim/lua/hex/utils.lua:30: in function 'begin_patch_from_hex'
        /Users/myzel394/.local/share/nvim/lazy/hex.nvim/lua/hex.lua:71: in function </Users/myzel394/.local/share/nvim/lazy/hex.nvim/lua/hex.lua:69>
stack traceback:
        [C]: in function 'nvim_exec2'
        vim/_editor.lua: in function 'cmd'
        ...myzel394/.local/share/nvim/lazy/hex.nvim/lua/hex/utils.lua:30: in function 'begin_patch_from_hex'
        /Users/myzel394/.local/share/nvim/lazy/hex.nvim/lua/hex.lua:71: in function </Users/myzel394/.local/share/nvim/lazy/hex.nvim/lua/hex.lua:69>

I'm running on MacOS Sonoma 14.1.1.

Confusing editor behavior

May be I'm not getting how this plugin works, but when in the hex / bytes area, I can input any text there, not just 00 - FF values. Is that intended? It feels confusing or at least not correct for hex editing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.