-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of gitorious.atomicobject.com:vim-settings/colt…
…horp
- Loading branch information
Showing
271 changed files
with
20,898 additions
and
1,619 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule YouCompleteMe
added at
011af9
Submodule ctrlp-cmatcher
added at
cfe5bf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# vim-elixir | ||
|
||
This project contains some Vim configuration files to work with [Elixir](http://elixir-lang.org). | ||
|
||
So far it's included: | ||
|
||
* Syntax highlighting | ||
|
||
* Filetype detection | ||
|
||
* Auto indentation | ||
|
||
## Install | ||
|
||
* Copy the files to your `~/.vim` directory. | ||
|
||
* If you use vim-pathogen you can clone this repo into `~/.vim/bundle` | ||
|
||
## Snippets | ||
|
||
If you are looking for snipmate snippets take a look at: [elixir-snippets](https://github.com/carlosgaldino/elixir-snippets) |
2 changes: 2 additions & 0 deletions
2
bundle/optional/elixir-lang-vim-elixir-a4fbd1/ftdetect/elixir.vim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
au BufRead,BufNewFile *.ex,*.exs set filetype=elixir | ||
au FileType elixir setl sw=2 sts=2 et |
12 changes: 12 additions & 0 deletions
12
bundle/optional/elixir-lang-vim-elixir-a4fbd1/ftplugin/elixir.vim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
" Vim filetype plugin | ||
" Language: Elixir | ||
" Maintainer: Carlos Galdino <carloshsgaldino@gmail.com> | ||
" URL: https://github.com/elixir-lang/vim-elixir | ||
|
||
if (exists("b:did_ftplugin")) | ||
finish | ||
endif | ||
let b:did_ftplugin = 1 | ||
|
||
setlocal comments=:# | ||
setlocal commentstring=#\ %s |
74 changes: 74 additions & 0 deletions
74
bundle/optional/elixir-lang-vim-elixir-a4fbd1/indent/elixir.vim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
" Vim indent file | ||
" Language: Elixir | ||
" Maintainer: Carlos Galdino <carloshsgaldino@gmail.com> | ||
" Last Change: 2012 Mar 28 | ||
|
||
if exists("b:did_indent") | ||
finish | ||
endif | ||
let b:did_indent = 1 | ||
|
||
setlocal indentexpr=GetElixirIndent(v:lnum) | ||
setlocal indentkeys+==end,=else:,=match:,=elsif:,=catch:,=after:,=rescue: | ||
|
||
if exists("*GetElixirIndent") | ||
finish | ||
endif | ||
|
||
let s:elixir_indent_keywords = '\%(\<\(case\|if\|unless\|try\|loop\|receive\)\>\|' . | ||
\ '^\s*\(defmodule\|defimpl\|defmacro\|defdelegate\|defexception\|defp\|def\|test\|[a-z]\w*\(:\)\@=\)\|' . | ||
\ 'fn(.*)\s\(do\|->\)$\)' | ||
|
||
let s:elixir_clauses = '\(else\|match\|elsif\|catch\|after\|rescue\):\|end' | ||
|
||
function! s:BlockStarter(lnum, block_start_re) | ||
let lnum = a:lnum | ||
let maxindent = 10000 | ||
while lnum > 1 | ||
let lnum = prevnonblank(lnum - 1) | ||
if indent(lnum) < maxindent | ||
if getline(lnum) =~ a:block_start_re | ||
return lnum | ||
else | ||
let maxindent = indent(lnum) | ||
if maxindent == 0 | ||
return -1 | ||
endif | ||
endif | ||
endif | ||
endwhile | ||
return -1 | ||
endfunction | ||
|
||
function! GetElixirIndent(line_num) | ||
" don't indent if it's the first line of the file | ||
if a:line_num == 0 | ||
return 0 | ||
endif | ||
|
||
let this_line = getline(a:line_num) | ||
|
||
if this_line =~ s:elixir_clauses | ||
let bslnum = s:BlockStarter(a:line_num, s:elixir_indent_keywords) | ||
if bslnum > 0 | ||
return indent(bslnum) | ||
else | ||
return -1 | ||
endif | ||
endif | ||
|
||
let plnum = a:line_num - 1 | ||
let previous_line = getline(plnum) | ||
|
||
if previous_line =~ '\(do\|when\|->\)$\|^\s*\(if\>\|[a-z]\w*\(:\)\@=\)' | ||
return indent(plnum) + &sw | ||
endif | ||
|
||
" blank lines are indented based on the previous not blank line" | ||
if previous_line =~ '^\s*$' | ||
let nonblank = prevnonblank(a:line_num) | ||
return indent(nonblank) | ||
endif | ||
|
||
return indent(plnum) | ||
endfunction |
82 changes: 82 additions & 0 deletions
82
bundle/optional/elixir-lang-vim-elixir-a4fbd1/syntax/elixir.vim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
" Vim syntax file | ||
" Language: Elixir | ||
" Maintainer: Carlos Galdino <carloshsgaldino@gmail.com> | ||
" Last Change: 2012 May 28 | ||
|
||
if exists("b:current_syntax") | ||
finish | ||
endif | ||
|
||
" syncing starts 2000 lines before top line so docstrings don't screw things up | ||
syn sync minlines=2000 | ||
|
||
syn match elixirComment '#.*' | ||
|
||
syn match elixirKeyword '\<\%(case\|cond\|end\|bc\|lc\|if\|unless\|try\|loop\|receive\|fn\)\>[?!]\@!' | ||
syn match elixirKeyword '\<\%(defmodule\|defprotocol\|defimpl\|defrecord\|defmacrop\?\|defdelegate\|defexception\|defp\?\)\>[?!]\@!' | ||
syn match elixirKeyword '\<\%(exit\|raise\|throw\|after\|rescue\|catch\|else\)\>[?!]\@!' | ||
syn match elixirKeyword '\<\%(do\|->\)\>\s*' | ||
syn match elixirKeyword '\<\%(import\|require\|use\|recur\|quote\|unquote\|super\|alias\)\>[?!]\@!' | ||
|
||
syn match elixirOperator '\<\%(and\|not\|or\|when\|xor\|in\)\>' | ||
syn match elixirOperator '%=\|\*=\|\*\*=\|+=\|-=\|\^=\|||=' | ||
syn match elixirOperator "\%(<=>\|<\%(<\|=\)\@!\|>\%(<\|=\|>\)\@!\|<=\|>=\|===\|==\|=\~\|!=\|!\~\|?[ \t]\@=\)" | ||
syn match elixirOperator "!+[ \t]\@=\|&&\|||\|\^\|\*\|+\|-\|/" | ||
syn match elixirOperator "|\|++\|--\|\*\*\|\/\/\|<-\|<>\|<<\|>>\|=\|\." | ||
|
||
syn match elixirSymbol '\(:\)\@<!:\%([a-zA-Z_]\w*\%([?!]\|=[>=]\@!\)\?\|<>\|===\?\|>=\?\|<=\?\)' | ||
syn match elixirSymbol '\(:\)\@<!:\%(<=>\|&&\?\|%\(()\|\[\]\|{}\)\|++\?\|--\?\|||\?\|!\|//\|[%&`/|]\)' | ||
syn match elixirSymbol "\%([a-zA-Z_]\w*\([?!]\)\?\):\(:\)\@!" | ||
|
||
syn match elixirName '\<nil\>[?!]\@!\|\<[A-Z]\w*\>' | ||
|
||
syn match elixirBoolean 'true\|false' | ||
|
||
syn match elixirVariable '@[a-zA-Z_]\w*\|&\d' | ||
|
||
syn match elixirPseudoVariable '\<__\%(FILE\|MODULE\|MAIN\|ENV\|CALLER\)__\>[?!]\@!' | ||
|
||
syn match elixirNumber '\<\d\(_\?\d\)*\(\.[^[:space:][:digit:]]\@!\(_\?\d\)*\)\?\([eE][-+]\?\d\(_\?\d\)*\)\?\>' | ||
syn match elixirNumber '\<0[xX][0-9A-Fa-f]\+\>' | ||
syn match elixirNumber '\<0[bB][01]\+\>' | ||
|
||
syn match elixirRegexEscape "\\\\\|\\[aAbBcdDefGhHnrsStvVwW]\|\\\d\{3}\|\\x[0-9a-fA-F]\{2}" contained | ||
syn match elixirRegexEscapePunctuation "?\|\.\|*\|\[\|\]\|+\|\^\|\$\||\|(\|)\|{\|}" contained | ||
syn match elixirRegexQuantifier "[*?+][?+]\=" contained display | ||
syn match elixirRegexQuantifier "{\d\+\%(,\d*\)\=}?\=" contained display | ||
syn match elixirRegexCharClass "\[:\(alnum\|alpha\|ascii\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|word\|xdigit\):\]" contained display | ||
|
||
syn region elixirRegex matchgroup=elixirDelimiter start="%r/" end="/[uiomxfr]*" skip="\\\\" contains=@elixirRegexSpecial | ||
|
||
syn cluster elixirRegexSpecial contains=elixirRegexEscape,elixirRegexCharClass,elixirRegexQuantifier | ||
syn cluster elixirStringContained contains=elixirInterpolation,elixirRegexEscape,elixirRegexCharClass | ||
|
||
syn region elixirString matchgroup=elixirDelimiter start="'" end="'" | ||
syn region elixirString matchgroup=elixirDelimiter start='"' end='"' contains=@elixirStringContained | ||
syn region elixirInterpolation matchgroup=elixirDelimiter start="#{" end="}" contained contains=ALLBUT,elixirComment | ||
syn region elixirDocString start=+"""+ end=+"""+ | ||
syn region elixirDocString start=+'''+ end=+'''+ | ||
|
||
syn match elixirSymbolInterpolated ':\("\)\@=' contains=elixirString | ||
syn match elixirString "\(\w\)\@<!?\%(\\\(x\d{1,2}\|\h{1,2}\h\@!\>\|0[0-7]{0,2}[0-7]\@!\>\|[^x0MC]\)\|(\\[MC]-)+\w\|[^\s\\]\)" | ||
|
||
hi def link elixirComment Comment | ||
hi def link elixirKeyword Keyword | ||
hi def link elixirOperator Operator | ||
hi def link elixirSymbol Constant | ||
hi def link elixirPseudoVariable Constant | ||
hi def link elixirName Type | ||
hi def link elixirBoolean Boolean | ||
hi def link elixirVariable Identifier | ||
hi def link elixirNumber Number | ||
hi def link elixirDocString Comment | ||
hi def link elixirInterpolation Delimiter | ||
hi def link elixirSymbolInterpolated elixirSymbol | ||
hi def link elixirRegex elixirString | ||
hi def link elixirRegexEscape elixirSpecial | ||
hi def link elixirRegexEscapePunctuation elixirSpecial | ||
hi def link elixirRegexCharClass elixirSpecial | ||
hi def link elixirRegexQuantifier elixirSpecial | ||
hi def link elixirSpecial Special | ||
hi def link elixirString String | ||
hi def link elixirDelimiter Delimiter |
Oops, something went wrong.