A RetroSearch Logo

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

Search Query:

Showing content from https://github.com/purescript-contrib/purescript-vim below:

purescript-contrib/purescript-vim: Syntax highlighting and indentation for PureScript

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.

This project is licensed under The 2-Clause BSD License (BSD-2-Clause) — see the LICENSE file in this project for details.

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

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

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

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.

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
let g:purescript_indent_case = 5
        case xs of
        >>>>>[]     -> ...
        >>>>>(y:ys) -> ...
let g:purescript_indent_let = 4
let g:purescript_indent_in = 1
g:purescript_indent_where
let g:purescript_indent_where = 6
        where f :: Int -> Int
        >>>>>>f x = x
let g:purescript_indent_do = 3
let g:purescript_indent_dot = 1
  unsnoc
    :: forall a
    >. List a
    -> Maybe (List a, a)

If you wish to have some symbols concealed for their Unicode equivalents, you may use these options. Each setting will conceal the following ASCII code block for an example output.

sum :: forall a f. Foldable f => Semiring a => f a -> a
sum = foldl (\a b -> a + b) zero

sumMod2 :: forall f. Foldable f => f Int -> Int
sumMod2 xs = mod (sum xs) 2

isSumEven :: forall f. Foldable => f Int -> Boolean
isSumEven = (==) 0 <<< sumMod2
g:purescript_unicode_conceal_enable
let g:purescript_unicode_conceal_enable = 1

Enables concealing. Conceals as:

sum   a f. Foldable f  Semiring a  f a  a
sum = foldl (λa b → a + b) zero

sumMod2   f. Foldable f  f Int  Int
sumMod2 xs = mod (sum xs) 2

isSumEven   f. Foldable  f Int  Boolean
isSumEven = (≡) 0 ∘ sumMod2
g:purescript_unicode_conceal_disable_common
let g:purescript_unicode_conceal_disable_common = 1

Disables concealing common symbols and just uses ones the compiler supports. Concealed as:

sum   a f. Foldable f  Semiring a  f a  a
sum = foldl (\a b → a + b) zero

sumMod2   f. Foldable f  f Int  Int
sumMod2 xs = mod (sum xs) 2

isSumEven   f. Foldable  f Int  Boolean
isSumEven = (==) 0 <<< sumMod2
g:purescript_unicode_conceal_enable_discretionary
let g:purescript_unicode_conceal_enable_discretionary = 1

Enables discretionary symbols concealing less common symbols that deviate further from the written code. Concealed as:

  a f. Foldable f  Semiring a  f a  a
∑ = foldl (λa b → a + b) ∅

sumMod2   f. Foldable f  f ℤ
sumMod2 xs = mod (∑ xs) 2

isSumEven   f. Foldable  f 𝔹
isSumEven = (≡) 0 ∘ sumMod2

Grab the suggested Git config by including with

$ git config --local include.path ../.gitconfig

This includes .git-blame-ignore-revs.

Enter Nix dev shell (enable Flakes if needed)

Or you can get an automatic shell via direnv

$ echo "use flake" > .envrc
$ direnv allow

You can contribute to purescript-vim in several ways:

  1. If you encounter a problem or have a question, please open an issue or post to the mailing list. We’ll do our best to work with you to resolve or answer it.

  2. If you would like to contribute code, tests, or documentation, please read the contributor guide. It’s a short, helpful introduction to contributing to this library, including development instructions.

  3. If you have written a library, tutorial, guide, or other resource based on this package, please share it on the PureScript Discourse! Writing libraries and learning resources are a great way to help this library succ:eed.


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