A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/bohlender/vim-smt2 below:

bohlender/vim-smt2: A Vim plugin that adds support for the SMT-LIB2 format (including Z3's extensions)

Extended SMT-LIB2 support for Vim

A Vim plugin that provides syntax highlighting and common operations for working with SMT-LIB2 files (*.smt2).

Although SMT-LIB2 is the standard language supported by most SMT solvers, some of them introduce custom language extensions. Such extensions may range from syntactical sugar to fine-grained control over the underlying solver-procedure. Besides the base SMT-LIB2 language, this plugin also supports the extensions of Z3.

Note: To provide a familiar experience, the syntax highlighting is directly derived from the source of Z3's online demo.

Without an SMT solver being installed, both the highlighting and the following shortcuts will be available:

With an SMT solver of your choice being installed (defaults to Z3 or boolector), the following shortcuts will also be available:

Note: Unless you've set <localleader> to a custom key, it is \ (Vim default).

Here you can see it in action:

Plugin Manager Instructions Pathogen
  1. cd ~/.vim/bundle
  2. git clone https://github.com/bohlender/vim-smt2
Vundle
  1. add Plugin 'bohlender/vim-smt2' to your ~/.vimrc file (before call vundle#end())
  2. reload your ~/.vimrc or restart Vim
  3. run :PluginInstall in Vim
manual (discouraged) Extract the archive or clone the repository into a directory in your runtimepath (e.g. ~/.vim/):
  1. cd ~/.vim/
  2. curl -L https://github.com/bohlender/vim-smt2/tarball/master | tar xz --strip 1

If you only care about the syntax highlighting or auto-formatting, i.e. you don't need to invoke a solver, you're done. However, you can tweak the auto-formatting as follows:

To use the solver-oriented commands, you need to:

The plugin uses <Plug> mappings to make it possible for you to override them. The following table lists the plugin's exposed functions:

Function Default mapping <Plug>Smt2Run <localleader>r <Plug>Smt2RunAndShowResult <localleader>R <Plug>Smt2PrintVersion <localleader>v <Plug>Smt2FormatCurrentParagraph <localleader>f <Plug>Smt2FormatOutermostSExpr <Plug>Smt2FormatFile <localleader>F

For example, if you want to make <localleader>f format the outermost S-expression instead of the current paragraph, simply add

nmap <leader>f <Plug>Smt2FormatOutermostSExpr

to your ~/.vimrc.

Why does Vim not show any syntax highlighting - neither for *.smt2 files nor for others?

Most likely syntax highlighting is simply disabled. You can enable syntax highlighting by typing :syntax on in Vim or adding syntax on to your ~/.vimrc file.

Why does the ending of a file, e.g. *.smt2, not affect the plugins loaded by Vim?

Make sure that you have filetype plugins enabled. See |filetype-plugin-on| for details, or simply add the following to your ~/.vimrc:

What do you use to get the look shown on the screenshot?

The screenshot was made with the Vim colorscheme monokai and the airline standard theme dark.

You can always create an issue if you find bugs or think that something could be improved. If you want to tackle an issue or contribute to the plugin feel free to create a pull request.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4