Skip to content

Instantly share code, notes, and snippets.

@sgur
Last active December 19, 2015 11:19
Show Gist options
  • Save sgur/5946592 to your computer and use it in GitHub Desktop.
Save sgur/5946592 to your computer and use it in GitHub Desktop.
Foldされた領域をバルーンを使ってプレビューする
" Foldされた領域をプレビューする {{{2
" ------------------------------
function! MyBalloonExpr()
let lnum = foldclosed(v:beval_lnum)
if lnum == -1
return ''
endif
let lines = getline(lnum, foldclosedend(lnum))
return iconv(join(len(lines) > &lines ? lines[:&lines] : lines, "\n"),
\ &encoding, &termencoding)
endfunction
set balloonexpr=MyBalloonExpr()
set ballooneval
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment