sigma-andex / purescript-vim

Syntax highlighting and indentation for PureScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

purescript-vim

Maintainer: vladciobanu

Purescript language support for vim and neovim providing syntax highlighting and indentation based on based on idris-vim and haskell-vim.

See purescript-language-server for details on how to set up language server support for Purescript.

Installation

Manual Installation (no plugin manager)

Copy content of this repository into your ~/.vim directory (or %HOME%\vimfiles on Windows).

Be sure that the following lines are in your .vimrc

syntax on
filetype on
filetype plugin indent on

Vim 8 packages

If you have vim version 8 (vim --version | head -n1), you can install plugins with the native pack system:

mkdir -p ~/.vim/pack/plugins/start/
cd ~/.vim/pack/plugins/start/
git clone https://github.com/purescript-contrib/purescript-vim.git

Pathogen

If you are using Pathogen, clone this repo into your ~/.vim/bundle directory and you are ready to go.

cd ~/.vim/bundle
git clone https://github.com/purescript-contrib/purescript-vim.git

vim-plug

If you are using vim-plug, add the following line in between your plug#begin and plug#end calls for your vim config file:

Plug 'purescript-contrib/purescript-vim'

Save and restart (neo)vim and run :PlugInstall.

Configuration

Indentation

To configure indentation in purescript-vim you can use the following variables:

g:purescript_disable_indent

Disable indentation altogether.

let g:purescript_disable_indent = 1

g:purescript_indent_case

let g:purescript_indent_case = 5
        case xs of
        >>>>>[]     -> ...
        >>>>>(y:ys) -> ...

g:purescript_indent_let

let g:purescript_indent_let = 4
        let x = 0 in
        >>>>x

g:purescript_indent_in

let g:purescript_indent_in = 1
	let x = 0
	>in x

g:purescript_indent_where

let g:purescript_indent_where = 6
        where f :: Int -> Int
        >>>>>>f x = x

g:purescript_indent_do

let g:purescript_indent_do = 3
        do x <- a
        >>>y <- b

g:purescript_indent_dot

let g:purescript_indent_dot = 1
	unsnoc
	  :: forall a
	  >. List a
	  -> Maybe (List a, a)

Contributing

Contributing checklist:

  • Opened an issue before investing a significant amount of work into changes
  • Update README.md with any new configuration options and behavior
  • Update CHANGELOG.md with the proposed changes
  • Run generate-doc.sh to re-generate the documentation

About

Syntax highlighting and indentation for PureScript

License:BSD 2-Clause "Simplified" License


Languages

Language:Vim Script 99.5%Language:Shell 0.5%