Add comments to the binary
Plug 'rapan931/binary_comments.vim'
use 'rapan931/binary_comments.vim'
neovim
vim.keymap.set('x', 'ge', require('binary_comments').draw)
vim
xmap ge <Plug>(binary-comments-draw)
neovim
-- This sample is default value.
-- If you do not need to change the set values, there is no need to call setup
require('binary_comments').setup({
corner = {
top_left = vim.fn.strdisplaywidth('┌') == 1 and '┌' or '+',
bottom_left = vim.fn.strdisplaywidth('└') == 1 and '└' or '+',
},
vert = vim.fn.strdisplaywidth('│') == 1 and '│' or '|',
hori = vim.fn.strdisplaywidth('─') == 1 and '─' or '-',
draw_below = true, -- draw position, if false, ruled lines on above of binary
})
vim(legacy vim script)
" This sample is default value.
" If you do not need to change the set values, there is no need to call setup
let g:binary_comments#corner = #{
\ top_left: strdisplaywidth('┌') == 1 ? '┌' : '+',
\ bottom_left: strdisplaywidth('└') == 1 ? '└' : '+',
\ }
let g:binary_comments#vert = strdisplaywidth('│') == 1 ? '│' : '|'
let g:binary_comments#hori = strdisplaywidth('─') == 1 ? '─' : '-'
let g:binary_comments#draw_below = v:true
vim(vim9script)
" This sample is default value.
" If you do not need to change the set values, there is no need to call setup
g:binary_comments#corner = {
top_left: strdisplaywidth('┌') == 1 ? '┌' : '+',
bottom_left: strdisplaywidth('└') == 1 ? '└' : '+',
}
g:binary_comments#vert = strdisplaywidth('│') == 1 ? '│' : '|'
g:binary_comments#hori = strdisplaywidth('─') == 1 ? '─' : '-'
g:binary_comments#draw_below = true