Open laoshaw opened 3 years ago
@laoshaw thanks for reporting!
I was looking into other issues and can confirm that code block are not syntax highlighted.
Please provide a md snippet which contains an example in which the code is not displayed at all.
Note so self: maybe related to this: https://github.com/sotte/presenting.vim/commit/6d87e549fb0bd00db908f501c7b4bff7436daa05
A markdown snippet:
## hello world for c++
```cpp
#include <iostream>
int main(){ std::cout << "hello world" << std::endl;
```
## hello world for c
```c
#include <stdio.h>
int main(void) { printf("hello world\n");}
```
Haha, the #include
is interpreted as a heading and creates a new slide :)
The snippet you posted creates 4 slides, not 2 as one would expect.
Fixing the separator is easy, but I have to investigate the syntax hl issue
@laoshaw just to have a semi working version this would be the regex for the slid separator:
# ftplugin/markdown.vim
let b:presenting_slide_separator_default = '\v(^|\n)\ze#{1,2} '
You should be able to overwrite the separator like this: https://github.com/sotte/presenting.vim#configuration
Thanks. That fixed the header issue. Hope syntax can be highlighted somehow.
A screenshot of one slide is attached, there are two bars not sure if it's be design. plus the two lines for code block, e.g.
```c
```
ideally should not be visible.
The bars are there on purpose, fencing off the code
ideally should not be visible.
That is/should be the case if it works.
If code can be highlighted they will stand out visibly enough without the two bars I feel. It would be nice to make the two bars optional as they're a bit heavy visually when I have say two or three small snippets of code on one slide(that will be 6 bars then)
Yeah, design is subjective :) Initially presenting did not do any formatting, it just used the existing hl.
If you want a super lightweight version of presenting you can use an old version which does not use figlet, but does proper syntax hl:
git checkout 9fb8ccc
Then "fix" the slide sep:
au FileType markdown let s:presenting_slide_separator = '\v(^|\n)\ze#+ '
This version would respect your md conceal for your code blocks. I assume you use plasticboy/vim-markdown
https://github.com/plasticboy/vim-markdown#fenced-code-block-languages
git checkout 9fb8ccc will give me blank slides with only title shown, the code blocks are totally gone if I use au FileType markdown let s:presenting_slide_separator_default = '\v(^|\n)\ze#+ '
, use au FileType markdown let s:presenting_slide_separator = '\v(^|\n)\ze#+ '
it works fine now. Thanks!
Glad it kinda works :tm: should be a smoother experience though! I'll try to fix this soon.
Out of curiosity: do you use the figlet feature? @laoshaw
I could not use figlet as I got "error: could not load font small" for all headings on each slide.
fixed it: I did not install figlet, now it works but long headline does not look good with the figlet headers, would love just to use a bold font instead, but I like the list using figlet dots
also when using 'figlet' I found for lists only the first level are figlet-ed, the second level of the list are still using whatever is from markdown, be it *
or -
Related to #34
this same occurred on python
#Comment
def hola():
print('Hola mundo')
hola()
This make the slide divided into 2. The fixes here do not work. I use vimwiki plugin too, so the markdown files seems to appear as vimwiki type. do you think this the cause?
I had the same issue and fixed it with:
rm -rf vim-plug
.tpope/vim-markdown
from the list of plugins.let g:vimwiki_global_ext = 0
for vimwiki
to avoid ft=vimwiki
on *.md
files.The crucial step seems to be removing the vim-plug
dir.
I am still facing this issue @sotte
For me it works. I have no markdown plugin installed - tpopes plugin is integrated in VIM. I do have to add the highlight types to my vimrc
though, like below. Those then also work in vimwiki though, which is a double-win.
let g:markdown_fenced_languages = ['go','perl','sh', 'python', 'cpp', 'c', 'javascript', 'vim']
My workaround is also not using any markdown plugin :) I should mention that in the README.
For me, the vim-polyglot
plugin caused my code cells to be not highlighted.
I managed to solve the issue here by commenting the lines that ident the code block to the right. Seems like doing so will cause my markdown highlighter to fail to detect the block as a code block. Can't work in a polished PR now, sorry, but here is a complete file:
https://gist.github.com/VictorTaelin/df15d860e1aca738794e6f4f67e17c48
Replace autoload/markdown.vim
by it to solve the issue.
I have
```cpp ```
for c++, and c for c, and python for python etc, i.e. the 'standard' markdown code block, however they're either displayed as a single color, or the code just disappears, the code block in markdown does not work for me on ubuntu 20.04 vim8.