slides.vim

Des slides dans votre vim - retour accueil

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

readme.slides (9446B)


      1 
      2 › slides.vim: simple slides made simple
      3 
      4    ~ 50 lines of vim config
      5    WYSIWYG
      6    emphasize/highlighted with non breaking spaces
      7    easy mode switching (edition/presentation)
      8 
      9         :set fen! list! 
     10 
     11 › when ?
     12 
     13      need slides, have no time
     14      prototyping
     15      remote/collaborative display
     16 
     17 › install
     18 
     19   clone git@github.com:eiro/slides.vim.git as a start section of a vim pack.
     20   if you don't know about packs, I suggest to read `:help packages`.
     21   if you don't care, just follow those instuctions.
     22 
     23     mkdir ~/.vim/pack/slides.vim/start
     24     git clone -C !$ git@github.com:eiro/slides.vim.git
     25 
     26 › prototyping
     27 
     28     ▶ git revision
     29     ▶ lightweight as a text file
     30     ▶ autofolding: quick rearange
     31     ▶ WYSIWYG
     32 
     33 › remote/collaborative display
     34 
     35     ▶ ssh forced command
     36     ▶ slides.vim + ii + tmux + ...
     37 
     38 › cons ?
     39 
     40     only text, code, emojis and all unicode but ...
     41 
     42      vim customization (see emphasize slide)
     43      !eog -f  ~/slides*(o)& when things get visual
     44 
     45 › system requirement
     46 
     47      a fullscreen terminal
     48      vim + slides.vim
     49      your *.slides
     50 
     51 › which term ?
     52 
     53     Worth watching first: Features of a Modern Terminal Emulator
     54     https://www.youtube.com/watch?v=9DgQqDnYNyQ
     55 
     56     I tested terminology, gnome-terminal, st,
     57     tilix, kitty, coolretroterm.
     58 
     59 › so which term ?
     60 
     61     both kitty and tilix have
     62 
     63     👍 good support of 256 colors term
     64     👍 nice emoji rendering
     65     👍 transparency and background
     66 
     67 › SO which term ?
     68 
     69     kitty renders "▒░" as a field of dots, which
     70     is very hugly. did I miss an option ?
     71 
     72     I use tilix.
     73 
     74 › special mention: coolretroterm
     75 
     76     Awesome theming for old school or futuristic/cyberpunk
     77     looking.
     78 
     79     Now available in debian package.
     80 
     81     I used to use a docker file to build it:
     82     (https://github.com/eiro/slides.vim/blob/master/tips.md)
     83 
     84 › usage
     85 
     86     # install slides.vim (:h packages)
     87     # vim is now aware of .slides file extension
     88 
     89     $ vim yourtalk.slides
     90 
     91 › insertion mappings
     92 
     93 
     94     (*    ┃ ▶<space>
     95     (-    ┃ <space>
     96     ("    ┃ ›<space>
     97     (5    ┃  <cr> <cr> <cr> <cr> <cr><esc>5kA
     98 
     99     " TIP: whenever you  want to edit (:h 'fen)
    100     :set fen!
    101 
    102 › presentation mappings
    103 
    104     in normal mode
    105 
    106     next slide       ┃ PageDown
    107     last slide       ┃ PageUp
    108     show/hide agenda ┃ :AgendaToggle<cr>
    109 
    110 › emphasize
    111 
    112     because some words are important
    113     you can use npsp (alt-space) to
    114     emphasize them.
    115 
    116 › SlidesRC
    117 
    118 the SlideRC command can abitrary vim code in the range
    119 
    120     /^"<vim/,/^"vim>/
    121 
    122 some examples coming...
    123 
    124 › SlidesRC (define the flag)
    125 
    126 so here is the way to turn a BWR (blue, white, red)
    127 into a french flag
    128 
    129 "<vim
    130 syn match FranceFlagBlue   "\vB{4}"
    131 highlight FranceFlagBlue   ctermbg=lightblue ctermfg=lightblue
    132 syn match FranceFlagWhite  "\vW{4}"
    133 highlight FranceFlagWhite  ctermbg=white ctermfg=white
    134 syn match FranceFlagRed    "\vR{4}"
    135 highlight FranceFlagRed    ctermbg=red ctermfg=red
    136 "vim>
    137 
    138     BBBBWWWWRRRR
    139     BBBBWWWWRRRR
    140 
    141 › SlidesRC (theming)
    142 
    143 theming is basically redefining those 3 highlights:
    144 
    145 "<vim
    146     highlight SlideTitle  cterm=bold ctermbg=blue ctermfg=white
    147     highlight emphasize   cterm=bold ctermfg=darkred ctermbg=none
    148     highlight Folded      cterm=none ctermbg=none ctermfg=white
    149 "vim>
    150 
    151 › possible improvements
    152 
    153      resurect subsections the right way: 2 lines
    154 
    155         section title
    156         slide title
    157 
    158      more highlighing possibilities
    159      automatically gnome-screenshot every slide
    160       to build a pdf version
    161 
    162 › tips: editing
    163 
    164      toggle numbers and folding (switch to edition mode)
    165         :set nu! fen!
    166      next slide
    167 ›        /^
    168 
    169 › tips: digraphs
    170 
    171     :h digraphs
    172 
    173     get the list of digraphs in a text file
    174 
    175         :redir > ~/digraphs.txt
    176         :digraphs
    177         :redir END
    178         :e ~/digraphs.txt
    179 
    180     define a new digraph
    181 
    182         " in zsh: print $[16#1F44D]
    183         dig +1 128077
    184 
    185     so now <c-k>+1 means 👍
    186 
    187 › drawing with digraphs
    188 
    189     draw charts and tables can be drawn
    190     with digraphs:
    191 
    192     vv │ vertical
    193     hh ─ horizontal
    194     vh ┼ vertical and horizontal
    195     vr ├ vertical and right
    196     lv ┤ left     and vertical
    197     dh ┬ down  horizontal
    198     uh ┴ up    horizontal
    199     ld ┐ left down
    200     ur └ up right
    201 
    202     and so on ...
    203 
    204 › drawing with digraphs: examples
    205 
    206     ┌│┐ think border box:
    207     └┘
    208 4!  ┊ 4-┈ 4_ ┉ 3- ┄
    209 4/  ┋
    210 
    211     ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
    212     ┃RD                          LD ┃
    213     ┃Vr                          Vl ┃
    214     ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
    215     ┃                               ┃
    216     ┃                               ┃
    217     ┃                               ┃
    218     ┃UR                           UL┃
    219     ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
    220 
    221 › drawing with digraphs: tips
    222 
    223     use numeral adjectives:
    224     5i<c-k>vv gives you ─────
    225 
    226     get used to <c-v> to resize cols:
    227     <c-v>4l8jx to remove 4 char width
    228     <c-v>8jx5p to add 4 char width
    229 
    230     5i<c-k>vv gives you ─────
    231 
    232     use upercase to bold:
    233     <c-k>vv<c-k>VV gives you │┃
    234 
    235 › maths and digraphs
    236 
    237     <c-k>FA to get ∀ but also
    238 
    239    α *a  also greek alphabet is available with *
    240     β *b
    241     π *p
    242     ∏ *P
    243 
    244     ∀ FA
    245     ∈ (-
    246     ∞ 00
    247     ⌠ Iu
    248     │ vv
    249     ⌡ Il
    250     ∑ +Z
    251     ∏ *P
    252 
    253 › maths and digraphs
    254 
    255     FE E │ TE ∃ │ /0 ∅ │ DE ∆ │ NB ∇ │ (- ∈ │ -) ∋ │
    256     *P ∏ │ +Z ∑ │ -2 − │ -+ ∓ │ *- ∗ │ Ob ∘ │ Sb ∙ │
    257     RT √ │ 0( ∝ │ 00 ∞ │ -L ∟ │ -V ∠ │ PP ∥ │ AN ∧ │
    258     OR ∨ │ (U ∩ │ )U ∪ │ In ∫ │ DI ∬ │ Io ∮ │ .: ∴ │
    259     :. ∵ │ :R ∶ │ :: ∷ │ ?1 ∼ │ CG ∾ │ ?- ≃ │ ?= ≅ │
    260     ?2 ≈ │ =? ≌ │ HI ≓ │ != ≠ │ =3 ≡ │ =< ≤ │ >= ≥ │
    261     <* ≪ │ *> ≫ │ !< ≮ │ !> ≯ │ (C ⊂ │ )C ⊃ │ (_ ⊆ │
    262     )_ ⊇ │ 0. ⊙ │ 02 ⊚ │ -T ⊥ │ .P ⋅ │ :3 ⋮ │ .3 … │
    263     Eh ⌂ │ <7 ⌈ │ >7 ⌉ │ 7< ⌊ │ 7> ⌋ │ NI ⌐ │ (A ⌒ │
    264     TR ⌕ │ Iu ⌠ │ Il ⌡ │ </ 〈│ /> 〉│ Vs ␣ │ Vs ␣ │
    265     => ⇒ │ == ⇔ │ -> → │ FA ∀ │ dP ∂
    266 
    267     and more ... see :digraphs
    268 
    269 › example
    270 
    271     ℚ = { (𝑚 ,𝑛) | (𝑚 ,𝑛) ∈ ℤ  Χ ( ℤ \ {0} ) }
    272 
    273 › tips: emojis
    274 
    275     iab :-) ☺️
    276     iab xD 😃
    277     iab x3 😍
    278     iab :-( ☹️
    279     iab :'( 😭
    280     iab D:< 😱
    281     iab :') 😂
    282     iab :-O 😲
    283     iab :-* 😘
    284     iab :+1 👍
    285     iab :-/ 🤔
    286     iab :$ 😖
    287     iab :-X 🤐
    288     iab B) 😎
    289     iab %) 😵
    290     iab :## 🤢
    291     iab !m! 🤘
    292     iab ;-o 🤨
    293     iab _ok 🗸
    294 
    295 › tips: more emojis from gnome
    296 
    297     if you're using gnome:
    298      install gnome-characters and gnome-character-map
    299      activate "characters" in gnome search
    300      now you can search for "pile of " to get 💩
    301 
    302 › more tips
    303 
    304     just read tips.md
    305     (https://github.com/eiro/slides.vim/blob/master/tips.md)
    306 
    307 › Known bugs
    308 
    309     you can't have more than 1 emphasize in a line
    310     because (say X is nbsp):
    311 
    312         Xem1XtextXem2X
    313 
    314     you want to emphasize em1 and em2 but text also
    315     is a region between 2 X so the whole line is
    316     highlighted.
    317 
    318 › history
    319 
    320      written   in 2009 because of a deadline
    321      published in 2010 because of a deadline
    322      evolved on my laptop since then because of deadlines
    323      used at Journées Perl 2018
    324      evolutions and documentation pushed to github
    325       because someone wanted to know
    326 
    327 › see also
    328 
    329     I use to use slides.vim when I ran out of time.
    330     Nowadays, unicode symbols and emojis are randered
    331     nicely in terminals so I can do some nice looking
    332     presentations using slides.vim.
    333 
    334     to be productive with slides.vim, you should be
    335     confortable with abbreviations (:h :iab)
    336     and digraphs (:h :digr) and learn about the basic
    337     ones.
    338 
    339     I wasn't aware of vroom and it seems all the other
    340     vim presentation plugins came after my own tool.
    341     slides.vim became exactly what I want: 30 lines
    342     of viml to produce slides in a very short time
    343     with a look I really like so I have no reason to
    344     just even test the other ones and the next slides
    345     are probably unfair.
    346 
    347 › other presentation tools
    348 
    349   vroom (the only one I knew about in circa 2010)
    350   https://metacpan.org/pod/distribution/Vroom/lib/Vroom.pod
    351 
    352 vimdeck     https://github.com/tybenz/vimdeck
    353 git-slides  https://github.com/gelisam/git-slides
    354 presenting  https://github.com/sotte/presenting.vim
    355 pip slides  https://pypi.org/project/slides.vim/
    356 
    357 › stuck on slides.vim because
    358 
    359    Probably too         │ vimdeck
    360    heavy/complicated    │ vroom
    361                         │ pip slides
    362 
    363 › stuck on slides.vim because
    364 
    365   renders badly         │ presenting
    366   according to          │ git-slides
    367   screenshots           │
    368 
    369 › outside of vim
    370 
    371     pandoc can turn markdown files into
    372      a beamer file (latex class)
    373      a reveal.js file
    374 
    375     pug, stylus and livescript can used
    376     in combinaison with
    377     ▶ pandoc + reveal.js
    378     ▶ impress.js
    379 
    380 
    381 › Thank you
    382 
    383      questions ?
    384      fork me! http://github.com/eiro/slides.vim
    385