├── screenshot.gif ├── README.md └── ftplugin └── xxd └── cursor.vim /screenshot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattn/vim-xxdcursor/HEAD/screenshot.gif -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vim-xxdcursor 2 | 3 | ![vim-xxdcursor](https://raw.githubusercontent.com/mattn/vim-xxdcursor/master/screenshot.gif) 4 | 5 | ## License 6 | 7 | MIT 8 | 9 | ## Author 10 | 11 | Yasuhiro Matsumoto (a.k.a. mattn) 12 | -------------------------------------------------------------------------------- /ftplugin/xxd/cursor.vim: -------------------------------------------------------------------------------- 1 | function! s:highlight() 2 | if exists('s:match') && s:match != -1 3 | call matchdelete(s:match) 4 | unlet s:match 5 | endif 6 | let syn = synIDattr(synID(line('.'), col('.'), 1), 'name') 7 | if syn != '' 8 | return 9 | endif 10 | let c = col('.') - 10 11 | if c % 5 == 0 12 | return 13 | endif 14 | let c = c / 5 * 2 + (c % 5 > 2 ? 1 : 0) 15 | let s:match = matchadd('MyGroup', '\%' . (c+52) . 'c\%' . line('.') . 'l') 16 | endfunction 17 | 18 | augroup XXD 19 | au! 20 | autocmd CursorMoved call s:highlight() 21 | augroup END 22 | highlight link MyGroup WildMenu 23 | 24 | --------------------------------------------------------------------------------