fidian / hexmode

Vim plugin to edit binary files in a hex mode automatically.
146 stars 19 forks source link

.vimrc now with ft=xxd, opening in hexmode #22

Closed oblitum closed 7 years ago

oblitum commented 7 years ago

After the last commit when I open my ~/.vimrc file with vim ~/.vimrc it's open in hexmode, and the filetype is xxd. Disabling the plugin fix the issue.

chaoren commented 7 years ago

Would you mind sharing your .vimrc? I suspect you have some special characters in there that causes the plugin to think it's a binary file.

chaoren commented 7 years ago

Though I would rather suggest the maintainer to just get rid of this and all similar tricks so the plugin can behave more predictably. We can always add more binary patterns here, and the user can always manually open a file with vim -b <file>.

oblitum commented 7 years ago

@chaoren https://github.com/oblitum/dotfiles/blob/56d4dceba6c5b5a1e06159b7f243959759908096/.vimrc. I have special chars at https://github.com/oblitum/dotfiles/blob/56d4dceba6c5b5a1e06159b7f243959759908096/.vimrc#L158-L159, they can't be viewed on GitHub.

oblitum commented 7 years ago

@chaoren I still need to change raw escapes to https://groups.google.com/forum/#!msg/vim_dev/JLp01xUC7v0/QJoKSfxBBwAJ

oblitum commented 7 years ago

yep, changing from using raw escapes for that two lines to:

let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"

solves the issue with hexmode. But I still think Hexmode heuristics are a bit loose.

fidian commented 7 years ago

I'm glad that there's a workaround for this issue. I'm going to close it and have opened one that addresses @chaoren's comments and tackles the issue a bit more accurately.