Syntax-highlighting Synopsys commands.
This Perl script will use man pages of Synopsys commands to compile syntax definitions for the vim text editor.
Rather than providing an out-dated set of syntax definitions, this script will compile them using the tool versions that you have installed on your system.
The compiled syntax file works in conjunction with the Tcl syntax file that is pre-installed with vim-7.x.
Make sure the Synopsys executables (e.g. 'dc_shell') are added to your $PATH variable. Then run:
% snpsMan2VimSyntax --verboseThe script will search for the 'man' catalogues installed alongside the Synopsys tools, and will parse all commands in the 'cat2' category, compiling them into a syntax file: synopsys.vim.
For more options, use:
% snpsMan2VimSyntax --help
The aim is not to replace the tcl.vim file that already exists on your system. Instead, the synopsys.vim file is used to extend the Tcl syntax definitions. To do this, place the file here:
~/.vim/syntax/synopsys.vimNext, create this add-on Tcl syntax definition file:
~/.vim/syntax/after/tcl.vimand edit it to contain:
" Vim syntax file " This file is loaded AFTER the standard tcl.vim file. " Include the Synopsys commands. source ~/.vim/syntax/synopsys.vim " Additional syntax definitions:Now open one of your Tcl scripts in vim and make sure you use
:syntax on
and :set syntax=tcl
.snpsMan2VimSyntax
Freeware
Version 1.6.1
26 August 2015
Language: English
The Synopsys tools need to be installed.
The script uses man
to parse the man pages and col
to remove colour codes.
To auto-detect standard Tcl commands, a stand-alone Tcl installation is needed.
The syntax files have been tested with vim 7.3.
Linux:
v1.6.1 on GitHubThese tools have been tested:
Other tools may also be supported since man pages usually follow a standard format.
If you are using the older tcl.vim syntax files, maintained by SM Smithfield (available on www.vim.org), then run the script with the --old-tcl-vim options.
The DC man page for the 'set_message_info' command contains a typo in the arguments list: -stop_ff. It should be -stop_off. The script does not detect this, sorry.