Last active
September 6, 2019 04:55
-
-
Save tamago324/141f6673f5542a61d14403ee32c1ac65 to your computer and use it in GitHub Desktop.
折畳レベルをお寿司で表す
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" 余白文字を指定 {{{ | |
" vert: 垂直分割の区切り文字 | |
" fold: 折畳の余白 | |
" diff: diffの余白 | |
set fillchars=vert:\ ,fold:\ ,diff:\ | |
" }}} | |
" 折畳 {{{ | |
function! MyFoldText() abort | |
let sushi = '' | |
" 折畳のレベルによって、お寿司を増やす | |
for i in range(v:foldlevel) | |
let sushi .= '🍣' | |
endfor | |
let line = getline(v:foldstart) | |
let marker_start = strpart(&foldmarker, 0, 3) | |
let line = substitute(line, marker_start.'\d\=\|/\*\|\*/', '', 'g') | |
let line = substitute(line, '^"*\s*', '', 'g') | |
let line = substitute(line, '"*\s*$', '', 'g') | |
return ' '.sushi.' '.line | |
endfunction | |
set foldtext=MyFoldText() | |
" }}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment