Prevent the use of italic

41 views
Skip to first unread message

Anton Shepelev

unread,
Mar 2, 2018, 2:37:21 AM3/2/18
to vim...@googlegroups.com
Hello, all

I am using GVim with a font that has no italic sub-
set. When I edit markdown (.md) files, however, Vim
tries to render *emphasized* text as italic. How
can I prevent that? Is it configured in a color
file or a syntax file?

--
Please, do not forward replies to the list to my e-mail.

Alessandro Antonello

unread,
Mar 2, 2018, 6:08:47 AM3/2/18
to vim...@googlegroups.com
This is probably in the syntax file. In 'syntax/markdown.vim' somewhere in the 'runtimepath'.


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Frank Shute

unread,
Mar 2, 2018, 11:55:07 AM3/2/18
to vim...@googlegroups.com
Do you prefer that gvim doesn't render emphasised text as italic? Or
would you like it to?

If the latter, then you can set gvim to use a font that contains the
italicised glyphs.

:help guifont

I use 'Consolas' on Windows and 'Anonymous Pro' on *nix.
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--

Frank

Oliver Knodel

unread,
Mar 2, 2018, 2:40:47 PM3/2/18
to vim_use
It is set in the syntax/markdown file and links to htmlItalic:
markdownItalic xxx links to htmlItalic

You can override it in ~/.vim/after/syntax/html.vim:
hi htmlItalic gui=NONE

If you use vim inside terminal, substitute gui with term or cterm.

Nikolay Aleksandrovich Pavlov

unread,
Mar 2, 2018, 4:48:03 PM3/2/18
to vim...@googlegroups.com
There is no need to use after/ directory, and especially after/syntax
which will be constantly reloaded. Sane syntax file authors (and
html.vim other is one of those) define highlight groups with
`:highlight default` which means that if highlighting group is defined
*before* sourcing syntax file then it will not be overridden, so
placing something like `hi link htmlItalic Normal` into the
colorscheme (if it is maintained by the OP) or vimrc is good and will
not create uselessly reloaded oneline files. Usage of the `:highlight
default` in syntax files aims precisely at allowing colorschemes to
provide defaults better suited to the user.

Tony Mechelynck

unread,
Mar 2, 2018, 7:32:24 PM3/2/18
to vim...@googlegroups.com
Anton Shepelev: this last sentence is important. Rather than linking
htmlItalic to Normal, you might prefer to define your own colorscheme,
defining htmlItalic with some specific colours rather than as italic
text.

I'm attaching my "almost-default" colorscheme, which uses Vim's
defaults for everything not explicitly mentioned. Don't use it
unchanged, but you may add and remove highlight lines until it does
what you like. There are a few lines at beginning and end (lines 1-28
and, I think, 136-end) which should not be removed (but possibly
modified if you change the colorscheme's name). Please also change
lines 2 and 3 (which hold my name and the last change date). Line 4 is
to force it to get a 'fileencoding' of Latin1 because that line would
be invalid in UTF-8. After applying your changes, drop it into
~/.vim/colors/ (on Unix-like systems) or ~/vimfiles/colors (as named
in Vim terminology on Windows), and invoke it with a :colo[rscheme]
statement (see ":help :colorscheme") in your vimrc.

This colorscheme is intentionally written to work well with the
CSApprox plugin if loaded. It predates the invention of the
+termguicolors feature, which I don't use (instead, I use the CSApprox
plugin and I don't touch 'termguicolors', which remains at its FALSE
default if defined).

It also assumes that Vimscript lines whose first nonblank is a
backslash are continuation lines, which is the 'nocompatible' (or
"Vim") default but not the 'compatible' (or "Vi") default. The User1
and User2 highlights are used in my custom text-style tabline (defined
in my vimrc, not here, and used in both "GUI" and "console" operating
modes).

Best regards,
Tony.
almost-default.vim

Anton Shepelev

unread,
Mar 9, 2018, 1:39:48 AM3/9/18
to vim...@googlegroups.com
Oliver Knodel to Anton Shepelev:

>>I am using GVim with a font that has no italic
>>subset. When I edit markdown (.md) files, howev-
>>er, Vim tries to render *emphasized* text as ital-
>>ic. How can I prevent that? Is it configured in
>>a color file or a syntax file?
>
>It is set in the syntax/markdown file and links to
>htmlItalic: markdownItalic xxx links to htmlItalic
>
>You can override it in
>
>~/.vim/after/syntax/html.vim:
>hi htmlItalic gui=NONE

Thanks. I have already found and disabled it, right
in the main syntax file.

Anton Shepelev

unread,
Mar 9, 2018, 1:39:48 AM3/9/18
to vim...@googlegroups.com
Frank Shute:

>Do you prefer that gvim doesn't render emphasised
>text as italic? Or would you like it to?

My basic requirement is that vim shall ignore the
Markdown conventions for italic and render the cor-
responding text as usual. An improved solution
would be to have it render italic Markdown in a spe-
cial color.

>If the latter, then you can set gvim to use a font
>that contains the italicised glyphs.
>
> :help guifont
>
>I use 'Consolas' on Windows and 'Anonymous Pro' on
>*nix.

Thanks, but I dislike those fonts and I prefer true
raster fonts, such as Terminus:

http://terminus-font.sourceforge.net/

or pixel-for-pixel conversions of raster fonts into
vector form:

http://int10h.org/oldschool-pc-fonts/fontlist/

One of my favorite ones is Olympiad:

http://8088mph.blogspot.ru/2016/03/olympiad-ibm-prototype-fonts-unearthed.html
Reply all
Reply to author
Forward
0 new messages