Fork 0

1.9 KiB

slope vim syntax and language plugin

Vim syntax highlighting for the slope language.


The syntax is mostly what you'd expect and borrows a good bit from various scheme/lisp syntax files. It includes a simplified version of "rainbow parens" to try and help make sense of what can, admittedly, be a lot of parens. The rainbow effect is done in the syntax rather than as a plugin.


The plugin adds a few niceties (defines comments, sets lisp for the buffer to avoid C style settings, and sets tabs to 2 spaces).

The plugin also adds a few functions/mappings:

  • Typing sr while in normal mode will attempt to run the current buffer with the slope interpreter, it will be based on the last save point in the buffer so remember to :w
    • If slope is not on your path you can add: let g:slope_command = '~/somewhere/slope' (replacing the path with an actual path to a slope interpreter) to your .vimrc file
  • Typing sr while in visual mode will attempt to run the currently selected code
  • Typing sj while in normal or visual mode will move the cursor to the next opening parenthesis; (
  • Typing sk while in normal or visual mode will move the cursor to the previous opening parenthesis; (
  • Typing sp while in normal or visual mode will move the cursor to a matching parenthesis (if you are on a parenthesis)
    • This is just a remap of %, but makes it so you don't have to use the shift key (a presonal preference)

In the above mappings s is used as a leader key, which is the default set by the plugin. If you would like to override this you can add something like the following to your .vimrc:

" Map the slope leader to `L`
" Then run the file by typing `Lr`
" in normal mode, for example
let g:slope_leader="L"


make # from the root of the repo


Written by sloum with help from samhunter (thanks!)