vim syntax highlighting and other simple niceties for slope editing in vim
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
sloum a47b8cccf5 Updates syntax to include for and coeval 1 day ago
ftdetect Initial commit 10 months ago
ftplugin Refactors run code 1 month ago
syntax Updates syntax to include for and coeval 1 day ago
Makefile Initial commit 10 months ago
README.md Updates logic for running file in normal mode and adds a variable for remapping the plugin's leder key 1 month ago

README.md

slope vim syntax and language plugin

Vim syntax highlighting for the slope language.

Syntax

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.

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"

Installation

make # from the root of the repo

Credits

Written by sloum with help from samhunter (thanks!)