Skip to content

Instantly share code, notes, and snippets.

View Fmajor's full-sized avatar

Fmajor Fmajor

  • Department of Astronomy, PKU
  • Beijing
View GitHub Profile
" 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)
@Fmajor
Fmajor / input-cell-fold.py
Created March 18, 2018 07:58
fold input cell of jupyter notebook
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>
@Fmajor
Fmajor / vue.ctags
Created June 19, 2019 18:20
A ctags syntax file for vue components
# A ctags syntax file for vue components
--langdef=vue
--langmap=vue:.vue
# vue-commands in <template>
--regex-vue=/^(<template>)$/\1/t,template/{scope=set}{exclusive}
--regex-vue=/^\S*(.*(v-if=|v-for=|v-show=|ref=)("[^"]*"))/\2\3/c,vue-command/{scope=ref}
--regex-vue=/^(<\/template>)$/\1//{scope=pop}{exclusive}{placeholder}
# css in <template>
--regex-vue=/^(<style.*)$/style/s,script/{scope=set}{exclusive}
--regex-vue=/^(<\/style>)$/\1//{scope=clear}{placeholder}
@Fmajor
Fmajor / customVimFolding.vim
Created April 4, 2021 15:41
custom vim folding
"#<== 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