slides.vim

Des slides dans votre vim - retour accueil

git clone git://bebou.netlib.re/slides.vim
Log | Files | Refs |

slides.vim (2420B)


      1 " vim: fdm=indent
      2 " digraphs are
      3 " ‹ = 1<
      4 " › = 1>
      5 
      6 let $PATH = join(
      7 \ [ $PATH
      8 \ , expand('<sfile>:p:h:h')."/bin"
      9 \ , expand('%:p:h')."/bin"
     10 \ ]
     11 \ , ":" )
     12 command -nargs=1 -range=% FixTitles <line1>,<line2>! slides.vim.fixtitles <args>
     13 
     14 set conceallevel=3 concealcursor=n
     15 command -nargs=0 Mod  set conceallevel=0 nofen spell
     16 command -nargs=0 Prez set conceallevel=3 fen nospell
     17 
     18 command -nargs=0 Record redir @a
     19 \| exe "normal \<c-l>"
     20 \| redraw
     21 \| silent call system("sh ./next")
     22 \| redir END
     23 
     24 nnoremap ,x :Record<cr>
     25 " edition commands:
     26     inoremap <buffer> (' <space>›<c-o>i
     27     inoremap <buffer> (* ▶<space>
     28     inoremap <buffer> (- <space>
     29     inoremap <buffer> (" ›<space>
     30     inoremap <buffer> (5  <cr> <cr> <cr> <cr> <cr><esc>5kA
     31 
     32 " presentation command
     33     nnoremap <buffer> <PageUp> zkzt
     34     nnoremap <buffer> <PageDown> zjzt:Hook<cr>:redraw!<cr>
     35 
     36 command Hook exec matchstr(getline("."),"^\\v^[^›]+")
     37 
     38 " Theme:
     39     highlight Slidetitle cterm=bold ctermfg=white   ctermbg=darkblue
     40     highlight Emphasize  cterm=bold ctermfg=darkred ctermbg=none
     41     highlight Hook  ctermfg=darkred ctermbg=none
     42     highlight Folded cterm=none ctermbg=none ctermfg=white
     43     highlight EndOfBuffer ctermfg=black ctermbg=black
     44     setlocal fcs=fold:\ ,diff:\
     45     setlocal noshowmode noruler noshowcmd nolist nonu nornu
     46     setlocal so=0 laststatus=0 statusline=0
     47     " use nbsp to emphasize something
     48     " see emphasize.slides demo
     49 
     50 setlocal fdm=expr fdo=all fcl=all foldexpr=getline(v:lnum)=~'›'?'>1':1
     51 
     52 let b:show_agenda=v:true
     53 
     54 if !exists('*AgendaToggle')
     55     command -nargs=0 Agenda
     56         \  let b:show_agenda=v:true
     57         \| setlocal foldtext=substitute(getline(v:foldstart),\".*›\",\"\",\"\")
     58     command -nargs=0 NoAgenda
     59         \  let b:show_agenda=v:false
     60         \| setlocal foldtext='\ '
     61         " \| setlocal foldtext=substitute(getline(v:foldstart),'.\\v(.*)','','')
     62     fun AgendaToggle ()
     63         if b:show_agenda | NoAgenda
     64         else             | Agenda
     65         endif
     66     endfun
     67     command -nargs=0 AgendaToggle call AgendaToggle()
     68     command -nargs=0 -bang A <bang>?AgendaShow:AgendaHide
     69 endif
     70 
     71 AgendaToggle
     72 
     73 command -nargs=0 LoadTheme
     74 \| set nofen
     75 \| silent /^" *<vim\>/;/^" *vim>/w! /tmp/vimslidestheme
     76 \| so /tmp/vimslidestheme
     77 \| silent exec "!rm /tmp/vimslidestheme"
     78 
     79 if search("^\" *<vim\\>","n") | LoadTheme
     80 endif
     81 set fen " should be a toggle in LoadTheme
     82 1