Des slides dans votre vim - retour accueil
git clone git://bebou.netlib.re/slides.vim
Log | Files | Refs |
commit d1f66d56890995ef00918ec08c8cade9ea067b94 parent 919b25cf7506dbadaea16934c587392fe56d340f Auterice: Marc Chantreux <khatar@phear.org> Date: Sat, 2 Jun 2018 10:59:24 +0200 don't repeat yourself * make things local * don't reload existing commands and functions * also removed deadcode and rearange settings Diffstat:
M | ftplugin/slides.vim | | | 48 | +++++++++++++++++++----------------------------- |
1 file changed, 19 insertions(+), 29 deletions(-)
diff --git a/ftplugin/slides.vim b/ftplugin/slides.vim @@ -1,5 +1,5 @@ " vim: fdm=indent -" digraphs +" digraphs are " ‹ = 1< " › = 1> @@ -14,42 +14,32 @@ nnoremap <buffer> <PageDown> zjzt " Theme: - set fcs=fold:\ ,diff:\ highlight CursorLine cterm=bold ctermbg=blue ctermfg=white highlight emphasize cterm=bold ctermfg=darkred ctermbg=none highlight Folded cterm=none ctermbg=none ctermfg=white - set statusline=0 noshowmode noruler noshowcmd nolist - setlocal nonu cursorline so=0 laststatus=0 + setlocal fcs=fold:\ ,diff:\ cursorline + setlocal noshowmode noruler noshowcmd nolist nonu + setlocal so=0 laststatus=0 statusline=0 " use nbsp to emphasize something " see emphasize.slides demo " every slide starts with a › -set fdm=expr foldexpr=getline(v:lnum)=~'^\ *›'?'>1':1 - +setlocal fdm=expr fdo=all fcl=all foldexpr=getline(v:lnum)=~'^\ *›'?'>1':1 let b:show_agenda=v:true -command -nargs=0 AgendaShow - \ let b:show_agenda=v:true - \| set foldtext=substitute(getline(v:foldstart),'.\\v(.*)','\\1\ \ \','') -command -nargs=0 AgendaHide - \ let b:show_agenda=v:false - \| set foldtext=substitute(getline(v:foldstart),'.\\v(.*)','','') - -fun AgendaToggle () - if b:show_agenda | AgendaHide - else | AgendaShow - endif -endfun -command -nargs=0 AgendaToggle call AgendaToggle() +if !exists('*AgendaToggle') + command -nargs=0 AgendaShow + \ let b:show_agenda=v:true + \| setlocal foldtext=substitute(getline(v:foldstart),'.\\v(.*)','\\1\ \ \','') + command -nargs=0 AgendaHide + \ let b:show_agenda=v:false + \| setlocal foldtext=substitute(getline(v:foldstart),'.\\v(.*)','','') + fun AgendaToggle () + if b:show_agenda | AgendaHide + else | AgendaShow + endif + endfun + command -nargs=0 AgendaToggle call AgendaToggle() +endif -" " Presentation mode open and close folders automatically -command -nargs=0 Presentation set fdo=all fcl=all -Presentation AgendaToggle - - - - -" Dead code ? ( just toggle foldenable? ) - " Edition mode reset default folding behavior - " command -nargs=0 Edition set fcl= fdo=block,hor,mark,percent,quickfix,search,tag,undo