[
  {
    "path": "README.md",
    "content": "Idris mode for vim\n==================\n\nThis is an [Idris][] mode for vim which features syntax highlighting, indentation\nand optional syntax checking via [Syntastic][]. If you need a REPL I recommend using\n[Vimshell][].\n\n![Screenshot](http://raichoo.github.io/images/vim.png)\n\n## Installation\n\nI recommend using [Pathogen][] for installation. Simply clone\nthis repo into your `~/.vim/bundle` directory and you are ready to go.\n\n    cd ~/.vim/bundle\n    git clone https://github.com/idris-hackers/idris-vim.git\n\n### Manual Installation\n\nCopy content into your `~/.vim` directory.\n\nBe sure that the following lines are in your\n`.vimrc`\n\n\n    syntax on\n    filetype on\n    filetype plugin indent on\n\n## Features\n\nApart from syntax highlighting, indentation, and unicode character concealing,\nidris-vim offers some neat interactive editing features. For more information on\nhow to use it, read this blog article by Edwin Brady on [Interactive Idris editing with vim][].\n\n## Interactive Editing Commands\n\n[Idris][] mode for vim offers interactive editing capabilities, the following\ncommands are supported.\n\n`<LocalLeader>r` reload file\n\n`<LocalLeader>t` show type\n\n`<LocalLeader>d` Create an initial clause for a type declaration.\n\n`<LocalLeader>b` Same as \\d but for an initial typeclass method impl.\n\n`<LocalLeader>md` Same as \\d but for a proof clause\n\n`<LocalLeader>c` case split\n\n`<LocalLeader>mc` make case\n\n`<LocalLeader>w` add with clause\n\n`<LocalLeader>e` evaluate expression\n\n`<LocalLeader>l` make lemma\n\n`<LocalLeader>m` add missing clause\n\n`<LocalLeader>f` refine item\n\n`<LocalLeader>o` obvious proof search\n\n`<LocalLeader>p` proof search\n\n`<LocalLeader>i` open idris response window\n\n`<LocalLeader>h` show documentation\n\n## Configuration\n\n### Indentation\n\nTo configure indentation in `idris-vim` you can use the following variables:\n\n* `let g:idris_indent_if = 3`\n\n        if bool\n        >>>then ...\n        >>>else ...\n\n* `let g:idris_indent_case = 5`\n\n        case xs of\n        >>>>>[]      => ...\n        >>>>>(y::ys) => ...\n\n* `let g:idris_indent_let = 4`\n\n        let x = 0 in\n        >>>>x\n\n* `let g:idris_indent_where = 6`\n\n        where f : Int -> Int\n        >>>>>>f x = x\n\n* `let g:idris_indent_do = 3`\n\n        do x <- a\n        >>>y <- b\n\n* `let g:idris_indent_rewrite = 8`\n\n        rewrite prf in expr\n        >>>>>>>>x\n\n### Concealing\n\nConcealing with unicode characters is off by default, but `let g:idris_conceal = 1` turns it on.\n\n### Tab Characters\n\nIf you simply must use tab characters, and would prefer that the ftplugin not set expandtab add `let g:idris_allow_tabchar = 1`.\n\n\n[Idris]: http://www.idris-lang.org\n[Syntastic]: https://github.com/scrooloose/syntastic\n[Vimshell]: https://github.com/Shougo/vimshell.vim\n[Pathogen]: https://github.com/tpope/vim-pathogen\n[Interactive Idris editing with vim]: http://edwinb.wordpress.com/2013/10/28/interactive-idris-editing-with-vim/\n\n"
  },
  {
    "path": "after/ftplugin/idris.vim",
    "content": "setlocal iskeyword+='\n"
  },
  {
    "path": "after/syntax/idris.vim",
    "content": "\" This script allows for unicode concealing of certain characters\n\" For instance -> goes to →\n\"\n\" It needs vim >= 7.3, set nocompatible, set enc=utf-8\n\"\n\" If you want to turn this on, let g:idris_conceal = 1\n\nif !exists('g:idris_conceal') || !has('conceal') || &enc != 'utf-8'\n    finish\nendif\n\n\" vim: set fenc=utf-8:\nsyntax match idrNiceOperator \"\\\\\\ze[[:alpha:][:space:]_([]\" conceal cchar=λ\nsyntax match idrNiceOperator \"<-\" conceal cchar=←\nsyntax match idrNiceOperator \"->\" conceal cchar=→\nsyntax match idrNiceOperator \"\\<sum\\>\" conceal cchar=∑\nsyntax match idrNiceOperator \"\\<product\\>\" conceal cchar=∏\nsyntax match idrNiceOperator \"\\<sqrt\\>\" conceal cchar=√\nsyntax match idrNiceOperator \"\\<pi\\>\" conceal cchar=π\nsyntax match idrNiceOperator \"==\" conceal cchar=≡\nsyntax match idrNiceOperator \"\\/=\" conceal cchar=≠\n\n\nlet s:extraConceal = 1\n\nlet s:doubleArrow = 1\n\" Set this to 0 to use the more technically correct arrow from bar\n\n\" Some windows font don't support some of the characters,\n\" so if they are the main font, we don't load them :)\nif has(\"win32\")\n    let s:incompleteFont = [ 'Consolas'\n                        \\ , 'Lucida Console'\n                        \\ , 'Courier New'\n                        \\ ]\n    let s:mainfont = substitute( &guifont, '^\\([^:,]\\+\\).*', '\\1', '')\n    for s:fontName in s:incompleteFont\n        if s:mainfont ==? s:fontName\n            let s:extraConceal = 0\n            break\n        endif\n    endfor\nendif\n\nif s:extraConceal\n    syntax match idrNiceOperator \"Void\" conceal cchar=⊥\n\n    \" Match greater than and lower than w/o messing with Kleisli composition\n    syntax match idrNiceOperator \"<=\\ze[^<]\" conceal cchar=≤\n    syntax match idrNiceOperator \">=\\ze[^>]\" conceal cchar=≥\n\n    if s:doubleArrow\n      syntax match idrNiceOperator \"=>\" conceal cchar=⇒\n    else\n      syntax match idrNiceOperator \"=>\" conceal cchar=↦\n    endif\n\n    syntax match idrNiceOperator \"=\\zs<<\" conceal cchar=«\n\n    syntax match idrNiceOperator \"++\" conceal cchar=⧺\n    syntax match idrNiceOperator \"::\" conceal cchar=∷\n    syntax match idrNiceOperator \"-<\" conceal cchar=↢\n    syntax match idrNiceOperator \">-\" conceal cchar=↣\n    syntax match idrNiceOperator \"-<<\" conceal cchar=⤛\n    syntax match idrNiceOperator \">>-\" conceal cchar=⤜\n\n    \" Only replace the dot, avoid taking spaces around.\n    syntax match idrNiceOperator /\\s\\.\\s/ms=s+1,me=e-1 conceal cchar=∘\n    syntax match idrNiceOperator \"\\.\\.\" conceal cchar=‥\n\n    syntax match idrNiceOperator \"`elem`\" conceal cchar=∈\n    syntax match idrNiceOperator \"`notElem`\" conceal cchar=∉\nendif\n\nhi link idrNiceOperator Operator\nhi! link Conceal Operator\nsetlocal conceallevel=2\n\n"
  },
  {
    "path": "doc/idris-vim.txt",
    "content": "*idris-vim.txt*   Last change 2014 April 24\n===============================================================================\n===============================================================================\n   @@@@ @@@@@@@@  @@@@@@@@  @@@@  @@@@@@          @@     @@ @@@@ @@     @@\n    @@  @@     @@ @@     @@  @@  @@    @@         @@     @@  @@  @@@   @@@\n    @@  @@     @@ @@     @@  @@  @@               @@     @@  @@  @@@@ @@@@\n    @@  @@     @@ @@@@@@@@   @@   @@@@@@  @@@@@@@ @@     @@  @@  @@ @@@ @@\n    @@  @@     @@ @@   @@    @@        @@          @@   @@   @@  @@     @@\n    @@  @@     @@ @@    @@   @@  @@    @@           @@ @@    @@  @@     @@\n   @@@@ @@@@@@@@  @@     @@ @@@@  @@@@@@             @@@    @@@@ @@     @@\n===============================================================================\nCONTENTS                                                   *idris-vim-contents*\n\n  1. Features:                                   |idris-vim-features|\n  2. Requirements:                               |idris-vim-requirements|\n  3. Functions:                                  |idris-vim-functions|\n  4. Troubleshooting                             |idris-vim-troubleshooting|\n  5. Examples:                                   |idris-vim-examples|\n  6. Information:                                |idris-vim-information|\n\n===============================================================================\nFEATURES                                                   *idris-vim-features*\n\n  * Syntax Highlighting\n  * Indentation\n  * Unicode Concealing\n  * Syntax Checking (via Syntastic(https://github.com/scrooloose/syntastic))\n  * Interactive Editing via the REPL\n\n===============================================================================\nREQUIREMENTS                                           *idris-vim-requirements*\n\n  * Idris (http://www.idris-lang.org/)\n\n  OPTIONAL:\n\n    * Syntastic(https://github.com/scrooloose/syntastic) for syntax checking\n    * Vimshell(https://github.com/Shougo/vimshell.vim) for a REPL\n\n===============================================================================\nFUNCTIONS                                                 *idris-vim-functions*\n\nAll of the functions in idris-vim are essentially just calls back to the REPL,\nso documentation for each of them is also available there.\n\nIdrisDocumentation                                           *IdrisDocumentation*\n  Shows internal documentation of the primitive under the cursor.\n\n  Mapped to '<LocalLeader>_h' by default.\n\nIdrisResponseWin                                              *IdrisResponseWin*\n  This opens an idris response window in a new pane.\n\n  Mapped to '<LocalLeader>_i' by default.\n\nIdrisShowType                                                    *IdrisShowType*\n  This shows the type of the name under the cursor (or, if the cursor happens\n  to be over a metavariable, a bit more information about its context).\n\n  Mapped to '<LocalLeader>_t' by default.\n\nIdrisReload                                                        *IdrisReload*\n  This reloads the file and type-checks the file in the current buffer.\n\n  Mapped to '<LocalLeader>_r' by default.\n\nIdrisEval                                                            *IdrisEval*\n  This prompts for an expression and then evaluates it in the REPL, then\n  returns the result.\n\n  Mapped to '<LocalLeader>_e' by default.\n\nIdrisCaseSplit                                                 *IdrisCaseSplit*\n  When the cursor is over a variable in a pattern match clause or case\n  expression, this splits the variable into all well-typed patterns.\n\n  Mapped to '<LocalLeader>_c' by default\n\nIdrisAddClause                                                 *IdrisAddClause*\n  When the cursor is at a type declaration this creates a new clause for that\n  signature.\n\n  By default mapped to '<LocalLeader>_d' for an ordinary top-level definition,\n  '<LocalLeader>_b' for a typeclass instance definition, and\n  '<LocalLeader>_md' to add a pattern-matching proof clause.\n\nIdrisAddMissing:                                               *IdrisAddMissing*\n  When the cursor is over a function, this adds all clauses necessary to make\n  that function cover all inputs.  This also eliminates clauses which would\n  lead to unification errors from appearing.\n\n  Mapped to '<LocalLeader>_m' by default\n\nIdrisRefine:                                                      *IdrisRefine*\n  Refines the item the cursor is over (applies the name and fills in any\n  arguments which can be filled in via unification)\n\n  Mapped to '<LocalLeader>_f' by default\n\nIdrisProofSearch:                                             *IdrisProofSearch*\n  This attempts to find a value for the metavariable it was called on by\n  looking at the rest of the code.  It can also be called with hints, which\n  are functions that can apply to help solve for the metavariable.\n\n  Mapped to '<LocalLeader>_o' without hints and '<LocalLeader>p' with hints by\n  default\n\nIdrisMakeWith:                                                   *IdrisMakeWith*\n  When the cursor is over a pattern clause and this is called, it creates a\n  new with clause.\n\n  Mapped to '<LocalLeader>_w' by default\n\nIdrisMakeLemma:                                                   *IdrisMakeLemma*\n  When the cursor is over a metavariable and this is called, it creates a new\n  top-level definition to solve the metavariable.\n\n  Mapped to '<LocalLeader>_l' by default\n\n===============================================================================\nTROUBLESHOOTING                                      *idris-vim-troubleshooting*\n\nIf this isn't working for you, make sure that:\n\n  * There is an Idris REPL running\n  * For syntax checking, you have syntastic installed\n  * The plugins mappings exists and don't conflict with anything else installed\n    (You can use ':map' to check. There should be mappings similar to\n    '\\h * :call IdrisShowDoc()'.)\n  * Vim recognizes you're in an idris file (you can use ':verb set ft' to check)\n\nIf none of this works, check to issue tracker on github and if nothing is\nthere create an issue with a detailed description of the problem.\n\n===============================================================================\nEXAMPLES                                                    *idris-vim-examples*\n\nSome excellent tutorials/examples for interactive editing using the above\nfunctions can be found at:\n  http://edwinb.wordpress.com/2013/10/28/interactive-idris-editing-with-vim/\nand\n  http://www.scribd.com/doc/214031954/60/Interactive-Editing-in-Vim\n\n===============================================================================\nINFORMATION                                              *idris-vim-information*\n\nAuthor: edwinb\nRepo: https://github.com/idris-hackers/idris-vim\n\nDocumentation by japesinator\n\n===============================================================================\n===============================================================================\n\" vim:ft=help:et:ts=2:sw=2:sts=2:norl:\n"
  },
  {
    "path": "ftdetect/idris.vim",
    "content": "au BufNewFile,BufRead *.idr setf idris\nau BufNewFile,BufRead idris-response setf idris\n"
  },
  {
    "path": "ftdetect/lidris.vim",
    "content": "au BufNewFile,BufRead *.lidr setf lidris\n"
  },
  {
    "path": "ftplugin/idris.vim",
    "content": "if bufname('%') == \"idris-response\"\n  finish\nendif\n\nif exists(\"b:did_ftplugin\")\n  finish\nendif\n\nsetlocal shiftwidth=2\nsetlocal tabstop=2\nif !exists(\"g:idris_allow_tabchar\") || g:idris_allow_tabchar == 0\n\tsetlocal expandtab\nendif\nsetlocal comments=s1:{-,mb:-,ex:-},:\\|\\|\\|,:--\nsetlocal commentstring=--%s\nsetlocal iskeyword+=?\nsetlocal wildignore+=*.ibc\n\nlet idris_response = 0\nlet b:did_ftplugin = 1\n\n\" Text near cursor position that needs to be passed to a command.\n\" Refinment of `expand(<cword>)` to accomodate differences between\n\" a (n)vim word and what Idris requires.\nfunction! s:currentQueryObject()\n  let word = expand(\"<cword>\")\n  if word =~ '^?'\n    \" Cut off '?' that introduces a hole identifier.\n    let word = strpart(word, 1)\n  endif\n  return word\nendfunction\n\nfunction! s:IdrisCommand(...)\n  let idriscmd = shellescape(join(a:000))\n  return system(\"idris --client \" . idriscmd)\nendfunction\n\nfunction! IdrisDocFold(lineNum)\n  let line = getline(a:lineNum)\n\n  if line =~ \"^\\s*|||\"\n    return \"1\"\n  endif\n\n  return \"0\"\nendfunction\n\nfunction! IdrisFold(lineNum)\n  return IdrisDocFold(a:lineNum)\nendfunction\n\nsetlocal foldmethod=expr\nsetlocal foldexpr=IdrisFold(v:lnum)\n\nfunction! IdrisResponseWin()\n  if (!bufexists(\"idris-response\"))\n    botright 10split\n    badd idris-response\n    b idris-response\n    let g:idris_respwin = \"active\"\n    set buftype=nofile\n    wincmd k\n  elseif (bufexists(\"idris-response\") && g:idris_respwin == \"hidden\")\n    botright 10split\n    b idris-response\n    let g:idris_respwin = \"active\"\n    wincmd k\n  endif\nendfunction\n\nfunction! IdrisHideResponseWin()\n  let g:idris_respwin = \"hidden\"\nendfunction\n\nfunction! IdrisShowResponseWin()\n  let g:idris_respwin = \"active\"\nendfunction\n\nfunction! IWrite(str)\n  if (bufexists(\"idris-response\"))\n    let save_cursor = getcurpos()\n    b idris-response\n    %delete\n    let resp = split(a:str, '\\n')\n    call append(1, resp)\n    b #\n    call setpos('.', save_cursor)\n  else\n    echo a:str\n  endif\nendfunction\n\nfunction! IdrisReload(q)\n  w\n  let file = expand(\"%:p\")\n  let tc = s:IdrisCommand(\":l\", file)\n  if (! (tc is \"\"))\n    call IWrite(tc)\n  else\n    if (a:q==0)\n       echo \"Successfully reloaded \" . file\n       call IWrite(\"\")\n    endif\n  endif\n  return tc\nendfunction\n\nfunction! IdrisReloadToLine(cline)\n  return IdrisReload(1)\n  \"w\n  \"let file = expand(\"%:p\")\n  \"let tc = s:IdrisCommand(\":lto\", a:cline, file)\n  \"if (! (tc is \"\"))\n  \"  call IWrite(tc)\n  \"endif\n  \"return tc\nendfunction\n\nfunction! IdrisShowType()\n  w\n  let word = s:currentQueryObject()\n  let cline = line(\".\")\n  let tc = IdrisReloadToLine(cline)\n  if (! (tc is \"\"))\n    echo tc\n  else\n    let ty = s:IdrisCommand(\":t\", word)\n    call IWrite(ty)\n  endif\n  return tc\nendfunction\n\nfunction! IdrisShowDoc()\n  w\n  let word = expand(\"<cword>\")\n  let ty = s:IdrisCommand(\":doc\", word)\n  call IWrite(ty)\nendfunction\n\nfunction! IdrisProofSearch(hint)\n  let view = winsaveview()\n  w\n  let cline = line(\".\")\n  let word = s:currentQueryObject()\n  let tc = IdrisReload(1)\n\n  if (a:hint==0)\n     let hints = \"\"\n  else\n     let hints = input (\"Hints: \")\n  endif\n\n  if (tc is \"\")\n    let result = s:IdrisCommand(\":ps!\", cline, word, hints)\n    if (! (result is \"\"))\n       call IWrite(result)\n    else\n      e\n      call winrestview(view)\n    endif\n  endif\nendfunction\n\nfunction! IdrisMakeLemma()\n  let view = winsaveview()\n  w\n  let cline = line(\".\")\n  let word = s:currentQueryObject()\n  let tc = IdrisReload(1)\n\n  if (tc is \"\")\n    let result = s:IdrisCommand(\":ml!\", cline, word)\n    if (! (result is \"\"))\n       call IWrite(result)\n    else\n      e\n      call winrestview(view)\n      call search(word, \"b\")\n    endif\n  endif\nendfunction\n\nfunction! IdrisRefine()\n  let view = winsaveview()\n  w\n  let cline = line(\".\")\n  let word = expand(\"<cword>\")\n  let tc = IdrisReload(1)\n\n  let name = input (\"Name: \")\n\n  if (tc is \"\")\n    let result = s:IdrisCommand(\":ref!\", cline, word, name)\n    if (! (result is \"\"))\n       call IWrite(result)\n    else\n      e\n      call winrestview(view)\n    endif\n  endif\nendfunction\n\nfunction! IdrisAddMissing()\n  let view = winsaveview()\n  w\n  let cline = line(\".\")\n  let word = expand(\"<cword>\")\n  let tc = IdrisReload(1)\n\n  if (tc is \"\")\n    let result = s:IdrisCommand(\":am!\", cline, word)\n    if (! (result is \"\"))\n       call IWrite(result)\n    else\n      e\n      call winrestview(view)\n    endif\n  endif\nendfunction\n\nfunction! IdrisCaseSplit()\n  let view = winsaveview()\n  let cline = line(\".\")\n  let word = expand(\"<cword>\")\n  let tc = IdrisReloadToLine(cline)\n\n  if (tc is \"\")\n    let result = s:IdrisCommand(\":cs!\", cline, word)\n    if (! (result is \"\"))\n       call IWrite(result)\n    else\n      e\n      call winrestview(view)\n    endif\n  endif\nendfunction\n\nfunction! IdrisMakeWith()\n  let view = winsaveview()\n  w\n  let cline = line(\".\")\n  let word = s:currentQueryObject()\n  let tc = IdrisReload(1)\n\n  if (tc is \"\")\n    let result = s:IdrisCommand(\":mw!\", cline, word)\n    if (! (result is \"\"))\n       call IWrite(result)\n    else\n      e\n      call winrestview(view)\n      call search(\"_\")\n    endif\n  endif\nendfunction\n\nfunction! IdrisMakeCase()\n  let view = winsaveview()\n  w\n  let cline = line(\".\")\n  let word = s:currentQueryObject()\n  let tc = IdrisReload(1)\n\n  if (tc is \"\")\n    let result = s:IdrisCommand(\":mc!\", cline, word)\n    if (! (result is \"\"))\n       call IWrite(result)\n    else\n      e\n      call winrestview(view)\n      call search(\"_\")\n    endif\n  endif\nendfunction\n\nfunction! IdrisAddClause(proof)\n  let view = winsaveview()\n  w\n  let cline = line(\".\")\n  let word = expand(\"<cword>\")\n  let tc = IdrisReloadToLine(cline)\n\n  if (tc is \"\")\n    if (a:proof==0)\n      let fn = \":ac!\"\n    else\n      let fn = \":apc!\"\n    endif\n\n    let result = s:IdrisCommand(fn, cline, word)\n    if (! (result is \"\"))\n       call IWrite(result)\n    else\n      e\n      call winrestview(view)\n      call search(word)\n\n    endif\n  endif\nendfunction\n\nfunction! IdrisEval()\n  w\n  let tc = IdrisReload(1)\n  if (tc is \"\")\n     let expr = input (\"Expression: \")\n     let result = s:IdrisCommand(expr)\n     call IWrite(\" = \" . result)\n  endif\nendfunction\n\nnnoremap <buffer> <silent> <LocalLeader>t :call IdrisShowType()<ENTER>\nnnoremap <buffer> <silent> <LocalLeader>r :call IdrisReload(0)<ENTER>\nnnoremap <buffer> <silent> <LocalLeader>c :call IdrisCaseSplit()<ENTER>\nnnoremap <buffer> <silent> <LocalLeader>d 0:call search(\":\")<ENTER>b:call IdrisAddClause(0)<ENTER>w\nnnoremap <buffer> <silent> <LocalLeader>b 0:call IdrisAddClause(0)<ENTER>\nnnoremap <buffer> <silent> <LocalLeader>m :call IdrisAddMissing()<ENTER>\nnnoremap <buffer> <silent> <LocalLeader>md 0:call search(\":\")<ENTER>b:call IdrisAddClause(1)<ENTER>w\nnnoremap <buffer> <silent> <LocalLeader>f :call IdrisRefine()<ENTER>\nnnoremap <buffer> <silent> <LocalLeader>o :call IdrisProofSearch(0)<ENTER>\nnnoremap <buffer> <silent> <LocalLeader>p :call IdrisProofSearch(1)<ENTER>\nnnoremap <buffer> <silent> <LocalLeader>l :call IdrisMakeLemma()<ENTER>\nnnoremap <buffer> <silent> <LocalLeader>e :call IdrisEval()<ENTER>\nnnoremap <buffer> <silent> <LocalLeader>w 0:call IdrisMakeWith()<ENTER>\nnnoremap <buffer> <silent> <LocalLeader>mc :call IdrisMakeCase()<ENTER>\nnnoremap <buffer> <silent> <LocalLeader>i 0:call IdrisResponseWin()<ENTER>\nnnoremap <buffer> <silent> <LocalLeader>h :call IdrisShowDoc()<ENTER>\n\nmenu Idris.Reload <LocalLeader>r\nmenu Idris.Show\\ Type <LocalLeader>t\nmenu Idris.Evaluate <LocalLeader>e\nmenu Idris.-SEP0- :\nmenu Idris.Add\\ Clause <LocalLeader>d\nmenu Idris.Add\\ with <LocalLeader>w\nmenu Idris.Case\\ Split <LocalLeader>c\nmenu Idris.Add\\ missing\\ cases <LocalLeader>m\nmenu Idris.Proof\\ Search <LocalLeader>o\nmenu Idris.Proof\\ Search\\ with\\ hints <LocalLeader>p\n\nau BufHidden idris-response call IdrisHideResponseWin()\nau BufEnter idris-response call IdrisShowResponseWin()\n"
  },
  {
    "path": "indent/idris.vim",
    "content": "\" indentation for idris (idris-lang.org)\n\"\n\" Based on haskell indentation by motemen <motemen@gmail.com>\n\"\n\" author: raichoo (raichoo@googlemail.com)\n\"\n\" Modify g:idris_indent_if and g:idris_indent_case to\n\" change indentation for `if'(default 3) and `case'(default 5).\n\" Example (in .vimrc):\n\" > let g:idris_indent_if = 2\n\nif exists('b:did_indent')\n  finish\nendif\n\nlet b:did_indent = 1\n\nif !exists('g:idris_indent_if')\n  \" if bool\n  \" >>>then ...\n  \" >>>else ...\n  let g:idris_indent_if = 3\nendif\n\nif !exists('g:idris_indent_case')\n  \" case xs of\n  \" >>>>>[]      => ...\n  \" >>>>>(y::ys) => ...\n  let g:idris_indent_case = 5\nendif\n\nif !exists('g:idris_indent_let')\n  \" let x : Nat = O in\n  \" >>>>x\n  let g:idris_indent_let = 4\nendif\n\nif !exists('g:idris_indent_rewrite')\n  \" rewrite prf in expr\n  \" >>>>>>>>x\n  let g:idris_indent_rewrite = 8\nendif\n\nif !exists('g:idris_indent_where')\n  \" where f : Nat -> Nat\n  \" >>>>>>f x = x\n  let g:idris_indent_where = 6\nendif\n\nif !exists('g:idris_indent_do')\n  \" do x <- a\n  \" >>>y <- b\n  let g:idris_indent_do = 3\nendif\n\nsetlocal indentexpr=GetIdrisIndent()\nsetlocal indentkeys=!^F,o,O,}\n\nfunction! GetIdrisIndent()\n  let prevline = getline(v:lnum - 1)\n\n  if prevline =~ '\\s\\+(\\s*.\\+\\s\\+:\\s\\+.\\+\\s*)\\s\\+->\\s*$'\n    return match(prevline, '(')\n  elseif prevline =~ '\\s\\+{\\s*.\\+\\s\\+:\\s\\+.\\+\\s*}\\s\\+->\\s*$'\n    return match(prevline, '{')\n  endif\n\n  if prevline =~ '[!#$%&*+./<>?@\\\\^|~-]\\s*$'\n    let s = match(prevline, '[:=]')\n    if s > 0\n      return s + 2\n    else\n      return match(prevline, '\\S')\n    endif\n  endif\n\n  if prevline =~ '[{([][^})\\]]\\+$'\n    return match(prevline, '[{([]')\n  endif\n\n  if prevline =~ '\\<let\\>\\s\\+.\\+\\<in\\>\\s*$'\n    return match(prevline, '\\<let\\>') + g:idris_indent_let\n  endif\n\n  if prevline =~ '\\<rewrite\\>\\s\\+.\\+\\<in\\>\\s*$'\n    return match(prevline, '\\<rewrite\\>') + g:idris_indent_rewrite\n  endif\n\n  if prevline !~ '\\<else\\>'\n    let s = match(prevline, '\\<if\\>.*\\&.*\\zs\\<then\\>')\n    if s > 0\n      return s\n    endif\n\n    let s = match(prevline, '\\<if\\>')\n    if s > 0\n      return s + g:idris_indent_if\n    endif\n  endif\n\n  if prevline =~ '\\(\\<where\\>\\|\\<do\\>\\|=\\|[{([]\\)\\s*$'\n    return match(prevline, '\\S') + &shiftwidth\n  endif\n\n  if prevline =~ '\\<where\\>\\s\\+\\S\\+.*$'\n    return match(prevline, '\\<where\\>') + g:idris_indent_where\n  endif\n\n  if prevline =~ '\\<do\\>\\s\\+\\S\\+.*$'\n    return match(prevline, '\\<do\\>') + g:idris_indent_do\n  endif\n\n  if prevline =~ '^\\s*\\<\\(co\\)\\?data\\>\\s\\+[^=]\\+\\s\\+=\\s\\+\\S\\+.*$'\n    return match(prevline, '=')\n  endif\n\n  if prevline =~ '\\<with\\>\\s\\+([^)]*)\\s*$'\n    return match(prevline, '\\S') + &shiftwidth\n  endif\n\n  if prevline =~ '\\<case\\>\\s\\+.\\+\\<of\\>\\s*$'\n    return match(prevline, '\\<case\\>') + g:idris_indent_case\n  endif\n\n  if prevline =~ '^\\s*\\(\\<namespace\\>\\|\\<\\(co\\)\\?data\\>\\)\\s\\+\\S\\+\\s*$'\n    return match(prevline, '\\(\\<namespace\\>\\|\\<\\(co\\)\\?data\\>\\)') + &shiftwidth\n  endif\n\n  if prevline =~ '^\\s*\\(\\<using\\>\\|\\<parameters\\>\\)\\s*([^(]*)\\s*$'\n    return match(prevline, '\\(\\<using\\>\\|\\<parameters\\>\\)') + &shiftwidth\n  endif\n\n  if prevline =~ '^\\s*\\<mutual\\>\\s*$'\n    return match(prevline, '\\<mutual\\>') + &shiftwidth\n  endif\n\n  let line = getline(v:lnum)\n\n  if (line =~ '^\\s*}\\s*' && prevline !~ '^\\s*;')\n    return match(prevline, '\\S') - &shiftwidth\n  endif\n\n  return match(prevline, '\\S')\nendfunction\n"
  },
  {
    "path": "syntax/idris.vim",
    "content": "\" syntax highlighting for idris (idris-lang.org)\n\"\n\" Heavily modified version of the haskell syntax\n\" highlighter to support idris.\n\"\n\" author: raichoo (raichoo@googlemail.com)\n\nif exists(\"b:current_syntax\")\n  finish\nendif\n\nsyn match idrisTypeDecl \"[a-zA-Z][a-zA-z0-9_']*\\s\\+:\\s\\+\"\n  \\ contains=idrisIdentifier,idrisOperators\nsyn region idrisParens matchgroup=idrisDelimiter start=\"(\" end=\")\" contains=TOP,idrisTypeDecl\nsyn region idrisBrackets matchgroup=idrisDelimiter start=\"\\[\" end=\"]\" contains=TOP,idrisTypeDecl\nsyn region idrisBlock matchgroup=idrisDelimiter start=\"{\" end=\"}\" contains=TOP,idrisTypeDecl\nsyn keyword idrisModule module namespace\nsyn keyword idrisImport import\nsyn keyword idrisRefl refl\nsyn keyword idrisDeprecated class instance\nsyn keyword idrisStructure codata data record dsl interface implementation\nsyn keyword idrisWhere where\nsyn keyword idrisVisibility public abstract private export\nsyn keyword idrisBlock parameters mutual postulate using\nsyn keyword idrisTotality total partial covering\nsyn keyword idrisImplicit implicit\nsyn keyword idrisAnnotation auto impossible static constructor\nsyn keyword idrisStatement do case of rewrite with proof\nsyn keyword idrisLet let in\nsyn match idrisSyntax \"\\(pattern \\+\\|term \\+\\)\\?syntax\"\nsyn keyword idrisConditional if then else\nsyn match idrisTactic contained \"\\<\\(intros\\?\\|rewrite\\|exact\\|refine\\|trivial\\|let\\|focus\\|try\\|compute\\|solve\\|attack\\|reflect\\|fill\\|applyTactic\\)\\>\"\nsyn match idrisNumber \"\\<[0-9]\\+\\>\\|\\<0[xX][0-9a-fA-F]\\+\\>\\|\\<0[oO][0-7]\\+\\>\"\nsyn match idrisFloat \"\\<[0-9]\\+\\.[0-9]\\+\\([eE][-+]\\=[0-9]\\+\\)\\=\\>\"\nsyn match idrisDelimiter  \"[,;]\"\nsyn keyword idrisInfix prefix infix infixl infixr\nsyn match idrisOperators \"\\([-!#$%&\\*\\+./<=>\\?@\\\\^|~:]\\|\\<_\\>\\)\"\nsyn match idrisType \"\\<[A-Z][a-zA-Z0-9_']*\\>\"\nsyn keyword idrisTodo TODO FIXME XXX HACK contained\nsyn match idrisLineComment \"---*\\([^-!#$%&\\*\\+./<=>\\?@\\\\^|~].*\\)\\?$\" contains=idrisTodo,@Spell\nsyn match idrisDocComment \"|||\\([^-!#$%&\\*\\+./<=>\\?@\\\\^|~].*\\)\\?$\" contains=idrisTodo,@Spell\nsyn match idrisMetaVar \"?[a-z][A-Za-z0-9_']*\"\nsyn match idrisLink \"%\\(lib\\|link\\|include\\)\"\nsyn match idrisDirective \"%\\(access\\|assert_total\\|default\\|elim\\|error_reverse\\|hide\\|name\\|reflection\\|error_handlers\\|language\\|flag\\|dynamic\\|provide\\|inline\\|used\\|no_implicit\\|hint\\|extern\\|unqualified\\|error_handler\\)\"\nsyn keyword idrisDSL lambda variable index_first index_next\nsyn match idrisChar \"'[^'\\\\]'\\|'\\\\.'\\|'\\\\u[0-9a-fA-F]\\{4}'\"\nsyn match idrisBacktick \"`[A-Za-z][A-Za-z0-9_']*`\"\nsyn region idrisString start=+\"+ skip=+\\\\\\\\\\|\\\\\"+ end=+\"+ contains=@Spell\nsyn region idrisBlockComment start=\"{-\" end=\"-}\" contains=idrisBlockComment,idrisTodo,@Spell\nsyn region idrisProofBlock start=\"\\(default\\s\\+\\)\\?\\(proof\\|tactics\\) *{\" end=\"}\" contains=idrisTactic\nsyn match idrisIdentifier \"[a-zA-Z][a-zA-z0-9_']*\" contained\n\nhighlight def link idrisDeprecated Error\nhighlight def link idrisIdentifier Identifier\nhighlight def link idrisImport Structure\nhighlight def link idrisModule Structure\nhighlight def link idrisStructure Structure\nhighlight def link idrisStatement Statement\nhighlight def link idrisDSL Statement\nhighlight def link idrisBlock Statement\nhighlight def link idrisAnnotation Statement\nhighlight def link idrisWhere Structure\nhighlight def link idrisLet Structure\nhighlight def link idrisTotality Statement\nhighlight def link idrisImplicit Statement\nhighlight def link idrisSyntax Statement\nhighlight def link idrisVisibility Statement\nhighlight def link idrisConditional Conditional\nhighlight def link idrisProofBlock Macro\nhighlight def link idrisRefl Macro\nhighlight def link idrisTactic Identifier\nhighlight def link idrisLink Statement\nhighlight def link idrisDirective Statement\nhighlight def link idrisNumber Number\nhighlight def link idrisFloat Float\nhighlight def link idrisDelimiter Delimiter\nhighlight def link idrisInfix PreProc\nhighlight def link idrisOperators Operator\nhighlight def link idrisType Include\nhighlight def link idrisDocComment Comment\nhighlight def link idrisLineComment Comment\nhighlight def link idrisBlockComment Comment\nhighlight def link idrisTodo Todo\nhighlight def link idrisMetaVar Macro\nhighlight def link idrisString String\nhighlight def link idrisChar String\nhighlight def link idrisBacktick Operator\n\nlet b:current_syntax = \"idris\"\n"
  },
  {
    "path": "syntax/lidris.vim",
    "content": "\" Vim syntax file\n\" Language:    Literate Idris\n\" Maintainer:  Idris Hackers (https://github.com/idris-hackers/idris-vim)\n\" Last Change: 2014 Mar 4\n\" Version:     0.1\n\"\n\" This is just a minimal adaption of the Literate Haskell syntax file.\n\n\n\" Read Idris highlighting.\nif version < 600\n    syntax include @idrisTop <sfile>:p:h/idris.vim\nelse\n    syntax include @idrisTop syntax/idris.vim\nendif\n\n\" Recognize blocks of Bird tracks, highlight as Idris.\nsyntax region lidrisBirdTrackBlock start=\"^>\" end=\"\\%(^[^>]\\)\\@=\" contains=@idrisTop,lidrisBirdTrack\nsyntax match  lidrisBirdTrack \"^>\" contained\nhi def link   lidrisBirdTrack Comment\n\nlet b:current_syntax = \"lidris\"\n"
  },
  {
    "path": "syntax_checkers/idris/idris.vim",
    "content": "\"============================================================================\n\"File:        idris.vim\n\"Description: Syntax checking plugin for syntastic.vim\n\"Maintainer:  raichoo <raichoo at googlemail dot com>\n\"License:     This program is free software. It comes without any warranty,\n\"             to the extent permitted by applicable law. You can redistribute\n\"             it and/or modify it under the terms of the Do What The Fuck You\n\"             Want To Public License, Version 2, as published by Sam Hocevar.\n\"             See http://sam.zoy.org/wtfpl/COPYING for more details.\n\"\n\"============================================================================\n\nif exists(\"g:loaded_syntastic_idris_idris_checker\")\n    finish\nendif\nlet g:loaded_syntastic_idris_idris_checker=1\n\nfunction! SyntaxCheckers_idris_idris_IsAvailable()\n    return executable(\"idris\")\nendfunction\n\nif !exists(\"g:syntastic_idris_options\")\n    let g:syntastic_idris_options = \" \"\nendif\n\nfunction! SyntaxCheckers_idris_idris_GetLocList() dict\n    let makeprg = self.makeprgBuild({\n        \\ 'exe': 'idris',\n        \\ 'args': \"--client ':l\". g:syntastic_idris_options,\n        \\ 'post_args': \"'\",\n        \\ 'filetype': 'idris',\n        \\ 'subchecker': 'idris' })\n\n    let errorformat =\n        \\ '\"%f\" (line %l\\, column %c\\):,' .\n        \\ 'user error (%f\\:%l\\:%m\\),' .\n        \\ '%E%f:%l:%c: error: %m,' .\n        \\ '%E%f:%l:%c-%*[0-9]: error: %m,' .\n        \\ '%W%f:%l:%c: warning: %m,' .\n        \\ '%W%f:%l:%c-%*[0-9]: warning: %m,' .\n        \\ '%E%f:%l:%c:%m,' .\n        \\ '%E%f:%l:%c-%*[0-9]:%m,' .\n        \\ '%C%m,' .\n        \\ '%m'\n\n    return SyntasticMake({\n        \\ 'makeprg': makeprg,\n        \\ 'errorformat': errorformat,\n        \\ 'postprocess': ['compressWhitespace'] })\nendfunction\n\ncall g:SyntasticRegistry.CreateAndRegisterChecker({\n    \\ 'filetype': 'idris',\n    \\ 'name': 'idris'})\n"
  }
]