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
"#<== custom highlights | |
" highligh enpty end of each line | |
highlight WhitespaceEOL ctermbg=red guibg=red | |
match WhitespaceEOL /\s\+$/ | |
highlight NoneText ctermfg=8 | |
highlight SpecialKey ctermfg=8 | |
" highlight link name1 name2 | |
highlight foldStart ctermfg=7 ctermbg=23 | |
highlight foldStartStr ctermfg=11 ctermbg=23 |
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
def doFold(max_height=200): | |
'''define this function in your first input cell | |
call it in the input cell you want to fold | |
then you can fold the input cell like the output cell | |
''' | |
from IPython.display import HTML | |
from IPython.display import display as Display | |
randid = np.random.randint(9999999999) | |
Display(HTML(''' | |
<style> |
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
" config for fold | |
" highlights: this costum function enable using both the 'indent' folding | |
" and the custum '#<==' '#==>' 'Marker' folding | |
"#<==================================================================== | |
"nnoremap <space> @=((foldclosed(line('.')) < 0) ? 'zc' :'zo')<CR> | |
nnoremap <space> za | |
set foldenable | |
"set foldmethod=indent foldignore= | |
set foldmethod=expr | |
set foldexpr=MyFold(v:lnum) |