request names can be longer than 2 characters and
there are extensions to the language primitives. For example, in AT&T troff
you access the year as a 2-digit number with the request \(yr. In groff you
can use the same request, recognized for compatibility, or you can use groff's
native syntax, \[yr]. Furthermore, you can use a 4-digit year directly:
\[year]. Macro requests can be longer than 2 characters, for example, GNU mm
accepts the requests ".VERBON" and ".VERBOFF" for creating verbatim
environments.
In order to obtain the best formatted output g/troff can give you, you should
follow a few simple rules about spacing and punctuation.
1. Do not leave empty spaces at the end of lines.
2. Leave one space and one space only after an end-of-sentence period,
exclamation mark, etc.
3. For reasons stated below, it is best to follow all period marks with a
carriage return.
The reason behind these unusual tips is that g/n/troff have a line breaking
algorithm that can be easily upset if you don't follow the rules given above.
Unlike TeX, troff fills text line-by-line, not paragraph-by-paragraph and,
furthermore, it does not have a concept of glue or stretch, all horizontal and
vertical space input will be output as is.
Therefore, you should be careful about not using more space between sentences
than you intend to have in your final document. For this reason, the common
practice is to insert a carriage return immediately after all punctuation
marks. If you want to have "even" text in your final processed output, you
need to maintain regular spacing in the input text. To mark both trailing
spaces and two or more spaces after a punctuation as an error, use: >
:let nroff_space_errors = 1
Another technique to detect extra spacing and other errors that will interfere
with the correct typesetting of your file, is to define an eye-catching
highlighting definition for the syntax groups "nroffDefinition" and
"nroffDefSpecial" in your configuration files. For example: >
hi def nroffDefinition cterm=italic gui=reverse
hi def nroffDefSpecial cterm=italic,bold gui=reverse,bold
If you want to navigate preprocessor entries in your source file as easily as
with section markers, you can activate the following option in your vimrc
file: >
let b:preprocs_as_sections = 1
As well, the syntax file adds an extra paragraph marker for the extended
paragraph macro (.XP) in the ms package.
Finally, there is a |groff.vim| syntax file that can be used for enabling
groff syntax highlighting either on a file basis or globally by default.
OCAML *ocaml.vim* *ft-ocaml-syntax*
The OCaml syntax file handles files having the following prefixes: .ml,
.mli, .mll and .mly. By setting the following variable >
:let ocaml_revised = 1
you can switch from standard OCaml-syntax to revised syntax as supported
by the camlp4 preprocessor. Setting the variable >
:let ocaml_noend_error = 1
prevents highlighting of "end" as error, which is useful when sources
contain very long structures that Vim does not synchronize anymore.
PANDOC *ft-pandoc-syntax*
By default, markdown files will be detected as filetype "markdown".
Alternatively, you may want them to be detected as filetype "pandoc" instead.
To do so, set the *g:filetype_md* var: >
:let g:filetype_md = 'pandoc'
The pandoc syntax plugin uses |conceal| for pretty highlighting. Default is 1 >
:let g:pandoc#syntax#conceal#use = 1
To specify elements that should not be concealed, set the following variable: >
:let g:pandoc#syntax#conceal#blacklist = []
This is a list of the rules which can be used here:
- titleblock
- image
- block
- subscript
- superscript
- strikeout
- atx
- codeblock_start
- codeblock_delim
- footnote
- definition
- list
- newline
- dashes
- ellipses
- quotes
- inlinecode
- inlinemath
You can customize the way concealing works. For example, if you prefer to mark
footnotes with the `*` symbol: >
:let g:pandoc#syntax#conceal#cchar_overrides