All Projects → bohlender → vim-smt2

bohlender / vim-smt2

Licence: MIT license
A VIM plugin that adds support for the SMT-LIB2 format (including Z3's extensions)

Programming Languages

Vim Script
2826 projects

Projects that are alternatives of or similar to vim-smt2

Manticore
Symbolic execution tool
Stars: ✭ 2,599 (+7325.71%)
Mutual labels:  z3, smt
Rainbow levels.vim
A different approach to code highlighting.
Stars: ✭ 415 (+1085.71%)
Mutual labels:  syntax-highlighting, vim-plugin
stan-vim
A Vim plugin for the Stan probabilistic programming language.
Stars: ✭ 41 (+17.14%)
Mutual labels:  syntax-highlighting, vim-plugin
Vim Crystal
Vim filetype and tools support for Crystal language.
Stars: ✭ 326 (+831.43%)
Mutual labels:  syntax-highlighting, vim-plugin
Vim Gdscript3
Syntax highlighting and completion for GDScript 3
Stars: ✭ 121 (+245.71%)
Mutual labels:  syntax-highlighting, vim-plugin
clojure.vim
Clojure syntax highlighting for Vim and Neovim.
Stars: ✭ 23 (-34.29%)
Mutual labels:  syntax-highlighting, vim-plugin
haskell-z3
Haskell bindings to Microsoft's Z3 API (unofficial).
Stars: ✭ 48 (+37.14%)
Mutual labels:  z3, smt
z3 tutorial
Jupyter notebooks for tutorial on the Z3 SMT solver
Stars: ✭ 117 (+234.29%)
Mutual labels:  z3, smt
Vim Js
💯The most accurate syntax highlighting plugin for JavaScript and Flow.js
Stars: ✭ 99 (+182.86%)
Mutual labels:  syntax-highlighting, vim-plugin
Vim Systemd Syntax
Syntax highlighting for systemd service files in Vim.
Stars: ✭ 57 (+62.86%)
Mutual labels:  syntax-highlighting, vim-plugin
Dhall Vim
Syntax highlighting for Dhall
Stars: ✭ 51 (+45.71%)
Mutual labels:  syntax-highlighting, vim-plugin
z3-mode
An interactive development environment for SMT-LIB files and Z3
Stars: ✭ 20 (-42.86%)
Mutual labels:  smtlib, z3
Kuroi.vim
A dark Vim colorscheme
Stars: ✭ 174 (+397.14%)
Mutual labels:  syntax-highlighting, vim-plugin
vim-log-highlighting
Syntax highlighting for generic log files in VIM
Stars: ✭ 164 (+368.57%)
Mutual labels:  syntax-highlighting, vim-plugin
highlight
Source code to formatted text converter
Stars: ✭ 44 (+25.71%)
Mutual labels:  syntax-highlighting
suslik
Synthesis of Heap-Manipulating Programs from Separation Logic
Stars: ✭ 107 (+205.71%)
Mutual labels:  smt
DzNoteEditor
Delphi Property Editor for TStrings supporting formatted languages with syntax highlight
Stars: ✭ 18 (-48.57%)
Mutual labels:  syntax-highlighting
android native code view
A EditText with syntax highlight support
Stars: ✭ 23 (-34.29%)
Mutual labels:  syntax-highlighting
tmux.vim
[DEPRECATED] .tmux.conf syntax highlighting
Stars: ✭ 47 (+34.29%)
Mutual labels:  syntax-highlighting
vim-high
Vim plugin: All-in-one highlighter, highlight custom pattern like indentation, inactive window, word under the cursor
Stars: ✭ 20 (-42.86%)
Mutual labels:  vim-plugin

Extended SMT-LIB2 support for VIM

Example

What is this?

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:

  • <localleader>f auto-formats the current paragraph (uses vim9script and requires VIM >= v8.2.2725)
  • <localleader>F auto-formats the current buffer/file (uses vim9script and requires VIM >= v8.2.2725)

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

  • <localleader>r evaluates the current file (in a terminal)
  • <localleader>R evaluates the current file and puts the output in a new split with syntax highlighting
  • <localleader>v prints the solver's version (handy if you switch often)

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

Here you can see it in action: asciicast

Installation

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

Configuration

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:

  • let g:smt2_formatter_short_length = 80 defines the length of "short" S-expressions -- these are formatted without line breaks
  • let g:smt2_formatter_indent_str = " " defines two spaces as the string to use for indentation

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

  • have z3 or boolector in your $PATH, or
  • set g:smt2_solver_command in your ~/.vimrc to the command for calling the solver of your choice (e.g. let g:smt2_solver_command="boolector -m") and also
  • set g:smt2_solver_version_switch to the solver's command line switch for printing it's version (default: --version).

FAQ

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:

filetype plugin on

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.

Contribute

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].