mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-14 13:23:53 +00:00
This patch is a major rewrite of the Vim syntax file
(vim/syntax/mercury.vim), supporting following (optional) features:
- highlighting of foreign code, including all doubly escaped characters
such as "" or \\" in strings, etc.
- recognising \uXXXX \OOO\ and formatting specifiers in Mercury strings
- concealing of certain operators and infix functions such as /\,
the `compose` function from std_util,
and set-calculus related operators (`union`, ...)
- supporting markup within comments, i.e. as function headers, ` ',
``'', URIs and Mercury file names, TODO, NOTE, XXX and so on.
- support underlining of local variables within function or predicate
bodies, which is a feature found in SWI-Prolog.
Additionally one can use <C-K>r and <C-K>R to rename the underlined
variable.
- improved speed due to better overlong line detection and a sync on
Mercury line comments '%-----' instead of sync start, which is
noticeable for large files such as io.m.
- Different way of supporting transparent comment highlighting, such
that spell checking works only on comments in both fully highlighted
and partially highlighted comments, this works best if comment
markup is enables (see above).
Without this, spell checking would have to be enabled for Mercury
code as well which Vim is not good at.
- Improved folding support if no user defined setting is in place
- Matching parenthesis detection (here meaning (),[],{}) and marking
unbalanced parens as err
- highlighting of spurious whitespace for better patch management.
vim/.gitignore:
Ignore mercury.vba file.
vim/Makefile:
A makefile to create a Vimball (.vba) and install that.
vim/README:
Moved installation instructions to vim/doc/mercury.txt and point to
that file.
vim/doc/mercury.txt:
Moved the documentation part from mercury.vim to a Vim documentation
file.
vim/ftplugin/mercury.vim:
Adds highlighting and renaming of currently selected variables,
and enables ftplugin/mercuryhdr.sh on Windows.
vim/ftplugin/mercuryhdr.sh:
Adhere to Mercury coding standards.
vim/syntax/mercury.vim:
see above.
43 lines
1.3 KiB
Bash
Executable File
43 lines
1.3 KiB
Bash
Executable File
#!/bin/sh
|
|
# vim: ft=sh ff=unix ts=4 sw=4 tw=78 et
|
|
MODULE=$(echo $(basename "$1" ) | sed 's/\.m$//')
|
|
FILE="${MODULE}.m"
|
|
cat <<EOF
|
|
%----------------------------------------------------------------------------%
|
|
% vim: ft=mercury ff=unix ts=4 sw=4 et
|
|
%----------------------------------------------------------------------------%
|
|
% File: $FILE
|
|
% Copyright © $(date +%Y) $GIT_AUTHOR_NAME
|
|
% Main author: $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>
|
|
% Created on: $(date)
|
|
% Stability: low
|
|
%----------------------------------------------------------------------------%
|
|
% TODO: module documentation
|
|
%----------------------------------------------------------------------------%
|
|
|
|
:- module $MODULE.
|
|
|
|
:- interface.
|
|
|
|
% TODO: insert predicates & functions
|
|
|
|
%----------------------------------------------------------------------------%
|
|
|
|
% TODO: declare predicates & functions
|
|
|
|
%----------------------------------------------------------------------------%
|
|
%----------------------------------------------------------------------------%
|
|
|
|
:- implementation.
|
|
|
|
% TODO: include/import/use modules
|
|
|
|
%----------------------------------------------------------------------------%
|
|
|
|
% TODO: implement predicates & functions
|
|
|
|
%----------------------------------------------------------------------------%
|
|
:- end_module $MODULE.
|
|
%----------------------------------------------------------------------------%
|
|
EOF
|