this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Cleanup nvim configuration

+8 -1476
+1
git/ignore
··· 55 55 .meteor/ 56 56 .tags 57 57 .gdb_history 58 + perf.data* 58 59 # }}} 59 60 60 61 # vim: foldmethod=marker foldlevel=0 foldenable
-17
nvim/after/ftplugin/cucumber.vim
··· 1 - " Make sure that proper indenting is maintained in Ruby files 2 - setlocal shiftwidth=2 3 - setlocal softtabstop=2 4 - setlocal tabstop=2 5 - 6 - inoremap <silent> <Bar> <Bar><Esc>:call <SID>align()<CR>a 7 - 8 - function! s:align() 9 - let p = '^\s*|\s.*\s|\s*$' 10 - if exists(':Tabularize') && getline('.') =~# '^\s*|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p) 11 - let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g')) 12 - let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*')) 13 - Tabularize/|/l1 14 - normal! 0 15 - call search(repeat('[^|]*|',column).'\s\{-\}'.repeat('.',position),'ce',line('.')) 16 - endif 17 - endfunction
nvim/after/ftplugin/gitcommit.vim nvim/ftplugin/gitcommit.vim
-5
nvim/after/ftplugin/ruby_swapit.vim
··· 1 - ClearSwapList 2 - 3 - SwapList 'if/unless' if unless 4 - SwapList 'while/until' while until 5 - SwapList 'else/elsif' else elsif
+1 -3
nvim/ftdetect/ktap.vim
··· 1 - augroup filetype 2 - au BufNewFile,BufRead *.kp set filetype=ktap 3 - augroup end 1 + au BufNewFile,BufRead *.kp set filetype=ktap
-1
nvim/ftdetect/scala.vim
··· 1 - au BufRead,BufNewFile *.scala set ft=scala syn=scala
-2
nvim/ftplugin/c.vim
··· 1 - setlocal omnifunc=ccomplete#Complete 2 - setlocal tags+=~/.vim/tags/stdlib
-1
nvim/ftplugin/ruby.vim
··· 1 - noremap <F9> :w !ruby -cw<CR> 2 1 noremap <F12> :!ripper-tags -f .tags -R . --exclude vendor<CR> 3 2 4 3 imap ,, =>
+1
nvim/ftplugin/rust.vim
··· 6 6 noremap <leader>rt :call VimuxRunCommand("clear; cargo test")<CR> 7 7 8 8 au BufWrite rust :Autoformat 9 + au BufWrite rust :silent !ctags -R .
-1
nvim/ftplugin/sass.vim
··· 1 - map <F9> :w !sass -c<CR>
-1
nvim/ftplugin/scss.vim
··· 1 - map <F9> :w !scss -c<CR>
-85
nvim/indent/scala.vim
··· 1 - " Vim indent file 2 - " Language : Scala (http://scala-lang.org/) 3 - " Maintainer : Stefan Matthias Aust 4 - " Last Change: 2006 Apr 13 5 - 6 - if exists("b:did_indent") 7 - finish 8 - endif 9 - let b:did_indent = 1 10 - 11 - setlocal indentexpr=GetScalaIndent() 12 - 13 - setlocal indentkeys=0{,0},0),!^F,<>>,<CR> 14 - 15 - setlocal autoindent shiftwidth=2 tabstop=2 softtabstop=2 expandtab 16 - 17 - if exists("*GetScalaIndent") 18 - finish 19 - endif 20 - 21 - function! CountParens(line) 22 - let line = substitute(a:line, '"\(.\|\\"\)*"', '', 'g') 23 - let open = substitute(line, '[^(]', '', 'g') 24 - let close = substitute(line, '[^)]', '', 'g') 25 - return strlen(open) - strlen(close) 26 - endfunction 27 - 28 - function! GetScalaIndent() 29 - " Find a non-blank line above the current line. 30 - let lnum = prevnonblank(v:lnum - 1) 31 - 32 - " Hit the start of the file, use zero indent. 33 - if lnum == 0 34 - return 0 35 - endif 36 - 37 - let ind = indent(lnum) 38 - let prevline = getline(lnum) 39 - 40 - "Indent html literals 41 - if prevline !~ '/>\s*$' && prevline =~ '^\s*<[a-zA-Z][^>]*>\s*$' 42 - return ind + &shiftwidth 43 - endif 44 - 45 - " Add a 'shiftwidth' after lines that start a block 46 - " If if, for or while end with ), this is a one-line block 47 - " If val, var, def end with =, this is a one-line block 48 - if prevline =~ '^\s*\<\(\(else\s\+\)\?if\|for\|while\)\>.*[)]\s*$' 49 - \ || prevline =~ '^\s*\<\(\(va[lr]\|def\)\>.*[=]\s*$' 50 - \ || prevline =~ '^\s*\<else\>\s*$' 51 - \ || prevline =~ '{\s*$' 52 - let ind = ind + &shiftwidth 53 - endif 54 - 55 - " If parenthesis are unbalanced, indent or dedent 56 - let c = CountParens(prevline) 57 - echo c 58 - if c > 0 59 - let ind = ind + &shiftwidth 60 - elseif c < 0 61 - let ind = ind - &shiftwidth 62 - endif 63 - 64 - " Dedent after if, for, while and val, var, def without block 65 - let pprevline = getline(prevnonblank(lnum - 1)) 66 - if pprevline =~ '^\s*\<\(\(else\s\+\)\?if\|for\|while\)\>.*[)]\s*$' 67 - \ || pprevline =~ '^\s*\<\(\va[lr]\|def\)\>.*[=]\s*$' 68 - \ || pprevline =~ '^\s*\<else\>\s*$' 69 - let ind = ind - &shiftwidth 70 - endif 71 - 72 - " Align 'for' clauses nicely 73 - if prevline =~ '^\s*\<for\> (.*;\s*$' 74 - let ind = ind - &shiftwidth + 5 75 - endif 76 - 77 - " Subtract a 'shiftwidth' on '}' or html 78 - let thisline = getline(v:lnum) 79 - if thisline =~ '^\s*[})]' 80 - \ || thisline =~ '^\s*</[a-zA-Z][^>]*>' 81 - let ind = ind - &shiftwidth 82 - endif 83 - 84 - return ind 85 - endfunction
-4
nvim/init.vim
··· 132 132 " Choose window 133 133 nmap wc <Plug>(choosewin) 134 134 135 - " Ctrl-F12 to generate ctags for current project 136 - noremap <silent> <F12> :!ctags -R .<CR> 137 - set tags=.tags 138 - 139 135 " Yanks 140 136 noremap <Leader>p "+p 141 137 noremap <Leader>P "+P
nvim/plugin/delimmate.vim nvim/plugin/delimitmate.vim
+5 -5
nvim/plugin/navigate.vim
··· 1 - " Changing windows 2 - noremap <C-k> <C-w>k 3 - noremap <C-h> <C-w>h 4 - noremap <C-l> <C-w>l 5 - noremap <C-j> <C-w>j 1 + map <M-Left> <C-T> 2 + map <M-Right> <C-]> 3 + 4 + set tags=.tags 5 + noremap <F12> :silent !ctags -R .<CR>
-9
nvim/snippets/_.snippets
··· 1 - # Global snippets 2 - 3 - # (c) holds no legal value ;) 4 - snippet c) 5 - Copyright `&enc[:2] == "utf" ? "©" : "(c)"` `strftime("%Y")` ${1:`g:snips_author`}. All Rights Reserved.${2} 6 - snippet date 7 - `strftime("%Y-%m-%d")` 8 - snippet ddate 9 - `strftime("%B %d, %Y")`
-110
nvim/snippets/c.snippets
··· 1 - # main() 2 - snippet main 3 - int main(int argc, const char *argv[]) { 4 - ${1} 5 - return 0; 6 - } 7 - snippet mainn 8 - int main(void) { 9 - ${1} 10 - return 0; 11 - } 12 - # #include <...> 13 - snippet inc 14 - #include <${1:stdio}.h>${2} 15 - # #include "..." 16 - snippet Inc 17 - #include "${1:`Filename("$1.h")`}"${2} 18 - # #ifndef ... #define ... #endif 19 - snippet Def 20 - #ifndef $1 21 - #define ${1:SYMBOL} ${2:value} 22 - #endif${3} 23 - snippet def 24 - #define 25 - snippet ifdef 26 - #ifdef ${1:FOO} 27 - ${2:#define } 28 - #endif 29 - snippet #if 30 - #if ${1:FOO} 31 - ${2} 32 - #endif 33 - # Header Include-Guard 34 - snippet once 35 - #ifndef ${1:`toupper(Filename('$1_H', 'UNTITLED_H'))`} 36 - 37 - #define $1 38 - 39 - ${2} 40 - 41 - #endif /* end of include guard: $1 */ 42 - # If Condition 43 - snippet if 44 - if (${1:/* condition */}) { 45 - ${2:/* code */} 46 - } 47 - snippet el 48 - else { 49 - ${1} 50 - } 51 - # Ternary conditional 52 - snippet t 53 - ${1:/* condition */} ? ${2:a} : ${3:b} 54 - # Do While Loop 55 - snippet do 56 - do { 57 - ${2:/* code */} 58 - } while (${1:/* condition */}); 59 - # While Loop 60 - snippet wh 61 - while (${1:/* condition */}) { 62 - ${2:/* code */} 63 - } 64 - # For Loop 65 - snippet for 66 - for (${2:i} = 0; $2 < ${1:count}; $2${3:++}) { 67 - ${4:/* code */} 68 - } 69 - # Custom For Loop 70 - snippet forr 71 - for (${1:i} = ${2:0}; ${3:$1 < 10}; $1${4:++}) { 72 - ${5:/* code */} 73 - } 74 - # Function 75 - snippet fun 76 - ${1:void} ${2:function_name}(${3}) { 77 - ${4:/* code */} 78 - } 79 - # Function Declaration 80 - snippet fund 81 - ${1:void} ${2:function_name}(${3});${4} 82 - # Typedef 83 - snippet td 84 - typedef ${1:int} ${2:MyCustomType};${3} 85 - # Struct 86 - snippet st 87 - struct ${1:`Filename('$1_t', 'name')`} { 88 - ${2:/* data */} 89 - }${3: /* optional variable list */};${4} 90 - # Typedef struct 91 - snippet tds 92 - typedef struct ${2:_$1 } { 93 - ${3:/* data */} 94 - } ${1:`Filename('$1_t', 'name')`}; 95 - # Typdef enum 96 - snippet tde 97 - typedef enum { 98 - ${1:/* data */} 99 - } ${2:foo}; 100 - # printf 101 - # unfortunately version this isn't as nice as TextMates's, given the lack of a 102 - # dynamic `...` 103 - snippet pr 104 - printf("${1:%s}\n"${2});${3} 105 - # fprintf (again, this isn't as nice as TextMate's version, but it works) 106 - snippet fpr 107 - fprintf(${1:stderr}, "${2:%s}\n"${3});${4} 108 - # This is kind of convenient 109 - snippet . 110 - [${1}]${2}
-190
nvim/snippets/html.snippets
··· 1 - # Some useful Unicode entities 2 - # Non-Breaking Space 3 - snippet nbs 4 - &nbsp; 5 - # ← 6 - snippet left 7 - &#x2190; 8 - # → 9 - snippet right 10 - &#x2192; 11 - # ↑ 12 - snippet up 13 - &#x2191; 14 - # ↓ 15 - snippet down 16 - &#x2193; 17 - # ↩ 18 - snippet return 19 - &#x21A9; 20 - # ⇤ 21 - snippet backtab 22 - &#x21E4; 23 - # ⇥ 24 - snippet tab 25 - &#x21E5; 26 - # ⇧ 27 - snippet shift 28 - &#x21E7; 29 - # ⌃ 30 - snippet control 31 - &#x2303; 32 - # ⌅ 33 - snippet enter 34 - &#x2305; 35 - # ⌘ 36 - snippet command 37 - &#x2318; 38 - # ⌥ 39 - snippet option 40 - &#x2325; 41 - # ⌦ 42 - snippet delete 43 - &#x2326; 44 - # ⌫ 45 - snippet backspace 46 - &#x232B; 47 - # ⎋ 48 - snippet escape 49 - &#x238B; 50 - # Generic Doctype 51 - snippet doctype HTML 4.01 Strict 52 - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 53 - "http://www.w3.org/TR/html4/strict.dtd"> 54 - snippet doctype HTML 4.01 Transitional 55 - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 56 - "http://www.w3.org/TR/html4/loose.dtd"> 57 - snippet doctype HTML 5 58 - <!DOCTYPE HTML> 59 - snippet doctype XHTML 1.0 Frameset 60 - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 61 - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 62 - snippet doctype XHTML 1.0 Strict 63 - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 64 - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 65 - snippet doctype XHTML 1.0 Transitional 66 - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 67 - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 68 - snippet doctype XHTML 1.1 69 - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 70 - "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 71 - # HTML Doctype 4.01 Strict 72 - snippet docts 73 - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 74 - "http://www.w3.org/TR/html4/strict.dtd"> 75 - # HTML Doctype 4.01 Transitional 76 - snippet doct 77 - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 78 - "http://www.w3.org/TR/html4/loose.dtd"> 79 - # HTML Doctype 5 80 - snippet doct5 81 - <!DOCTYPE HTML> 82 - # XHTML Doctype 1.0 Frameset 83 - snippet docxf 84 - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" 85 - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> 86 - # XHTML Doctype 1.0 Strict 87 - snippet docxs 88 - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 89 - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 90 - # XHTML Doctype 1.0 Transitional 91 - snippet docxt 92 - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 93 - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 94 - # XHTML Doctype 1.1 95 - snippet docx 96 - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 97 - "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 98 - snippet html 99 - <html> 100 - ${1} 101 - </html> 102 - snippet xhtml 103 - <html xmlns="http://www.w3.org/1999/xhtml"> 104 - ${1} 105 - </html> 106 - snippet body 107 - <body> 108 - ${1} 109 - </body> 110 - snippet head 111 - <head> 112 - <meta http-equiv="content-type" content="text/html; charset=utf-8"`Close()`> 113 - 114 - <title>${1:`substitute(Filename('', 'Page Title'), '^.', '\u&', '')`}</title> 115 - ${2} 116 - </head> 117 - snippet title 118 - <title>${1:`substitute(Filename('', 'Page Title'), '^.', '\u&', '')`}</title>${2} 119 - snippet script 120 - <script type="text/javascript" charset="utf-8"> 121 - ${1} 122 - </script>${2} 123 - snippet scriptsrc 124 - <script src="${1}.js" type="text/javascript" charset="utf-8"></script>${2} 125 - snippet style 126 - <style type="text/css" media="${1:screen}"> 127 - ${2} 128 - </style>${3} 129 - snippet base 130 - <base href="${1}" target="${2}"`Close()`> 131 - snippet r 132 - <br`Close()[1:]`> 133 - snippet div 134 - <div id="${1:name}"> 135 - ${2} 136 - </div> 137 - # Embed QT Movie 138 - snippet movie 139 - <object width="$2" height="$3" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" 140 - codebase="http://www.apple.com/qtactivex/qtplugin.cab"> 141 - <param name="src" value="$1"`Close()`> 142 - <param name="controller" value="$4"`Close()`> 143 - <param name="autoplay" value="$5"`Close()`> 144 - <embed src="${1:movie.mov}" 145 - width="${2:320}" height="${3:240}" 146 - controller="${4:true}" autoplay="${5:true}" 147 - scale="tofit" cache="true" 148 - pluginspage="http://www.apple.com/quicktime/download/" 149 - `Close()[1:]`> 150 - </object>${6} 151 - snippet fieldset 152 - <fieldset id="$1"> 153 - <legend>${1:name}</legend> 154 - 155 - ${3} 156 - </fieldset> 157 - snippet form 158 - <form action="${1:`Filename('$1_submit')`}" method="${2:get}" accept-charset="utf-8"> 159 - ${3} 160 - 161 - 162 - <p><input type="submit" value="Continue &rarr;"`Close()`></p> 163 - </form> 164 - snippet h1 165 - <h1 id="${1:heading}">${2:$1}</h1> 166 - snippet input 167 - <input type="${1:text/submit/hidden/button}" name="${2:some_name}" value="${3}"`Close()`>${4} 168 - snippet label 169 - <label for="${2:$1}">${1:name}</label><input type="${3:text/submit/hidden/button}" name="${4:$2}" value="${5}" id="${6:$2}"`Close()`>${7} 170 - snippet link 171 - <link rel="${1:stylesheet}" href="${2:/css/master.css}" type="text/css" media="${3:screen}" charset="utf-8"`Close()`>${4} 172 - snippet mailto 173 - <a href="mailto:${1:joe@example.com}?subject=${2:feedback}">${3:email me}</a> 174 - snippet meta 175 - <meta name="${1:name}" content="${2:content}"`Close()`>${3} 176 - snippet opt 177 - <option value="${1:option}">${2:$1}</option>${3} 178 - snippet optt 179 - <option>${1:option}</option>${2} 180 - snippet select 181 - <select name="${1:some_name}" id="${2:$1}"> 182 - <option value="${3:option}">${4:$3}</option> 183 - </select>${5} 184 - snippet table 185 - <table border="${1:0}"> 186 - <tr><th>${2:Header}</th></tr> 187 - <tr><th>${3:Data}</th></tr> 188 - </table>${4} 189 - snippet textarea 190 - <textarea name="${1:Name}" rows="${2:8}" cols="${3:40}">${4}</textarea>${5}
-80
nvim/snippets/javascript.snippets
··· 1 - # Prototype 2 - snippet proto 3 - ${1:class_name}.prototype.${2:method_name} = 4 - function(${3:first_argument}) { 5 - ${4:// body...} 6 - }; 7 - # Function 8 - snippet fun 9 - function ${1:function_name} (${2:argument}) { 10 - ${3:// body...} 11 - } 12 - # Anonymous Function 13 - snippet f 14 - function(${1}) {${2}}; 15 - # if 16 - snippet if 17 - if (${1:true}) {${2}} 18 - # if ... else 19 - snippet ife 20 - if (${1:true}) {${2}} 21 - else{${3}} 22 - # tertiary conditional 23 - snippet t 24 - ${1:/* condition */} ? ${2:a} : ${3:b} 25 - # switch 26 - snippet switch 27 - switch(${1:expression}) { 28 - case '${3:case}': 29 - ${4:// code} 30 - break; 31 - ${5} 32 - default: 33 - ${2:// code} 34 - } 35 - # case 36 - snippet case 37 - case '${1:case}': 38 - ${2:// code} 39 - break; 40 - ${3} 41 - # for (...) {...} 42 - snippet for 43 - for (var ${2:i} = 0; $2 < ${1:Things}.length; $2${3:++}) { 44 - ${4:$1[$2]} 45 - }; 46 - # for (...) {...} (Improved Native For-Loop) 47 - snippet forr 48 - for (var ${2:i} = ${1:Things}.length - 1; $2 >= 0; $2${3:--}) { 49 - ${4:$1[$2]} 50 - }; 51 - # while (...) {...} 52 - snippet wh 53 - while (${1:/* condition */}) { 54 - ${2:/* code */} 55 - } 56 - # do...while 57 - snippet do 58 - do { 59 - ${2:/* code */} 60 - } while (${1:/* condition */}); 61 - # Object Method 62 - snippet :f 63 - ${1:method_name}: function(${2:attribute}) { 64 - ${4} 65 - }${3:,} 66 - # setTimeout function 67 - snippet timeout 68 - setTimeout(function() {${3}}${2}, ${1:10}; 69 - # Get Elements 70 - snippet get 71 - getElementsBy${1:TagName}('${2}')${3} 72 - # Get Element 73 - snippet gett 74 - getElementBy${1:Id}('${2}')${3} 75 - # HTML5 query selector 76 - snippet q 77 - querySelector('${1}')${2} 78 - # HTML5 select all 79 - snippet qa 80 - querySelectorAll('${1}')${2}
-521
nvim/snippets/ruby.snippets
··· 1 - # #!/usr/bin/env ruby 2 - snippet #! 3 - #!/usr/bin/env ruby 4 - 5 - # New Block 6 - snippet =b 7 - =begin rdoc 8 - ${1} 9 - =end 10 - snippet y 11 - :yields: ${1:arguments} 12 - snippet rb 13 - #!/usr/bin/env ruby -wKU 14 - snippet beg 15 - begin 16 - ${3} 17 - rescue ${1:Exception} => ${2:e} 18 - end 19 - 20 - snippet req 21 - require '${1}'${2} 22 - snippet # 23 - # => 24 - snippet end 25 - __END__ 26 - snippet case 27 - case ${1:object} 28 - when ${2:condition} 29 - ${3} 30 - end 31 - snippet when 32 - when ${1:condition} 33 - ${2} 34 - end 35 - snippet def 36 - def ${1:method_name} 37 - ${2} 38 - end 39 - snippet deft 40 - def test_${1:case_name} 41 - ${2} 42 - end 43 - snippet if 44 - if ${1:condition} 45 - ${2} 46 - end 47 - snippet ife 48 - if ${1:condition} 49 - ${2} 50 - else 51 - ${3} 52 - end 53 - snippet elsif 54 - elsif ${1:condition} 55 - ${2} 56 - snippet unless 57 - unless ${1:condition} 58 - ${2} 59 - end 60 - snippet while 61 - while ${1:condition} 62 - ${2} 63 - end 64 - snippet for 65 - for ${1:e} in ${2:c} 66 - ${3} 67 - end 68 - snippet until 69 - until ${1:condition} 70 - ${2} 71 - end 72 - snippet cla class .. end 73 - class ${1:`substitute(Filename(), '^.', '\u&', '')`} 74 - ${2} 75 - end 76 - snippet cla class .. initialize .. end 77 - class ${1:`substitute(Filename(), '^.', '\u&', '')`} 78 - def initialize(${2:args}) 79 - ${3} 80 - end 81 - 82 - 83 - end 84 - snippet cla class .. < ParentClass .. initialize .. end 85 - class ${1:`substitute(Filename(), '^.', '\u&', '')`} < ${2:ParentClass} 86 - def initialize(${3:args}) 87 - ${4} 88 - end 89 - 90 - 91 - end 92 - snippet cla ClassName = Struct .. do .. end 93 - ${1:`substitute(Filename(), '^.', '\u&', '')`} = Struct.new(:${2:attr_names}) do 94 - def ${3:method_name} 95 - ${4} 96 - end 97 - 98 - 99 - end 100 - snippet cla class BlankSlate .. initialize .. end 101 - class ${1:BlankSlate} 102 - instance_methods.each { |meth| undef_method(meth) unless meth =~ /\A__/ } 103 - snippet cla class << self .. end 104 - class << ${1:self} 105 - ${2} 106 - end 107 - # class .. < DelegateClass .. initialize .. end 108 - snippet cla- 109 - class ${1:`substitute(Filename(), '^.', '\u&', '')`} < DelegateClass(${2:ParentClass}) 110 - def initialize(${3:args}) 111 - super(${4:del_obj}) 112 - 113 - ${5} 114 - end 115 - 116 - 117 - end 118 - snippet mod module .. end 119 - module ${1:`substitute(Filename(), '^.', '\u&', '')`} 120 - ${2} 121 - end 122 - snippet mod module .. module_function .. end 123 - module ${1:`substitute(Filename(), '^.', '\u&', '')`} 124 - module_function 125 - 126 - ${2} 127 - end 128 - snippet mod module .. ClassMethods .. end 129 - module ${1:`substitute(Filename(), '^.', '\u&', '')`} 130 - module ClassMethods 131 - ${2} 132 - end 133 - 134 - module InstanceMethods 135 - 136 - end 137 - 138 - def self.included(receiver) 139 - receiver.extend ClassMethods 140 - receiver.send :include, InstanceMethods 141 - end 142 - end 143 - # attr_reader 144 - snippet r 145 - attr_reader :${1:attr_names} 146 - # attr_writer 147 - snippet w 148 - attr_writer :${1:attr_names} 149 - # attr_accessor 150 - snippet rw 151 - attr_accessor :${1:attr_names} 152 - # include Enumerable 153 - snippet Enum 154 - include Enumerable 155 - 156 - def each(&block) 157 - ${1} 158 - end 159 - # include Comparable 160 - snippet Comp 161 - include Comparable 162 - 163 - def <=>(other) 164 - ${1} 165 - end 166 - # extend Forwardable 167 - snippet Forw- 168 - extend Forwardable 169 - # def self 170 - snippet defs 171 - def self.${1:class_method_name} 172 - ${2} 173 - end 174 - # def method_missing 175 - snippet defmm 176 - def method_missing(meth, *args, &blk) 177 - ${1} 178 - end 179 - snippet defd 180 - def_delegator :${1:@del_obj}, :${2:del_meth}, :${3:new_name} 181 - snippet defds 182 - def_delegators :${1:@del_obj}, :${2:del_methods} 183 - snippet am 184 - alias_method :${1:new_name}, :${2:old_name} 185 - snippet app 186 - if __FILE__ == $PROGRAM_NAME 187 - ${1} 188 - end 189 - # usage_if() 190 - snippet usai 191 - if ARGV.${1} 192 - abort 'Usage: #{$PROGRAM_NAME} ${2:ARGS_GO_HERE}'${3} 193 - end 194 - # usage_unless() 195 - snippet usau 196 - unless ARGV.${1} 197 - abort 'Usage: #{$PROGRAM_NAME} ${2:ARGS_GO_HERE}'${3} 198 - end 199 - snippet array 200 - Array.new(${1:10}) { |${2:i}| ${3} } 201 - snippet hash 202 - Hash.new { |${1:hash}, ${2:key}| $1[$2] = ${3} } 203 - snippet file File.foreach() { |line| .. } 204 - File.foreach(${1:'path/to/file'}) { |${2:line}| ${3} } 205 - snippet file File.read() 206 - File.read(${1:'path/to/file'})${2} 207 - snippet Dir Dir.global() { |file| .. } 208 - Dir.glob(${1:'dir/glob/*'}) { |${2:file}| ${3} } 209 - snippet Dir Dir['..'] 210 - Dir[${1:'glob/**/*.rb'}]${2} 211 - snippet dir 212 - Filename.dirname(__FILE__) 213 - snippet deli 214 - delete_if { |${1:e}| ${2} } 215 - snippet fil 216 - fill(${1:range}) { |${2:i}| ${3} } 217 - # flatten_once() 218 - snippet flao 219 - inject(Array.new) { |${1:arr}, ${2:a}| $1.push(*$2)}${3} 220 - snippet zip 221 - zip(${1:enums}) { |${2:row}| ${3} } 222 - # downto(0) { |n| .. } 223 - snippet dow 224 - downto(${1:0}) { |${2:n}| ${3} } 225 - snippet ste 226 - step(${1:2}) { |${2:n}| ${3} } 227 - snippet tim 228 - times { |${1:n}| ${2} } 229 - snippet upt 230 - upto(${1:1.0/0.0}) { |${2:n}| ${3} } 231 - snippet loo 232 - loop { ${1} } 233 - snippet ea 234 - each { |${1:e}| ${2} } 235 - snippet ead 236 - each do |${1:e}| 237 - ${2} 238 - end 239 - snippet eab 240 - each_byte { |${1:byte}| ${2} } 241 - snippet eac- each_char { |chr| .. } 242 - each_char { |${1:chr}| ${2} } 243 - snippet eac- each_cons(..) { |group| .. } 244 - each_cons(${1:2}) { |${2:group}| ${3} } 245 - snippet eai 246 - each_index { |${1:i}| ${2} } 247 - snippet eaid 248 - each_index do |${1:i}| 249 - end 250 - snippet eak 251 - each_key { |${1:key}| ${2} } 252 - snippet eakd 253 - each_key do |${1:key}| 254 - ${2} 255 - end 256 - snippet eal 257 - each_line { |${1:line}| ${2} } 258 - snippet eald 259 - each_line do |${1:line}| 260 - ${2} 261 - end 262 - snippet eap 263 - each_pair { |${1:name}, ${2:val}| ${3} } 264 - snippet eapd 265 - each_pair do |${1:name}, ${2:val}| 266 - ${3} 267 - end 268 - snippet eas- 269 - each_slice(${1:2}) { |${2:group}| ${3} } 270 - snippet easd- 271 - each_slice(${1:2}) do |${2:group}| 272 - ${3} 273 - end 274 - snippet eav 275 - each_value { |${1:val}| ${2} } 276 - snippet eavd 277 - each_value do |${1:val}| 278 - ${2} 279 - end 280 - snippet eawi 281 - each_with_index { |${1:e}, ${2:i}| ${3} } 282 - snippet eawid 283 - each_with_index do |${1:e},${2:i}| 284 - ${3} 285 - end 286 - snippet reve 287 - reverse_each { |${1:e}| ${2} } 288 - snippet reved 289 - reverse_each do |${1:e}| 290 - ${2} 291 - end 292 - snippet inj 293 - inject(${1:init}) { |${2:mem}, ${3:var}| ${4} } 294 - snippet injd 295 - inject(${1:init}) do |${2:mem}, ${3:var}| 296 - ${4} 297 - end 298 - snippet map 299 - map { |${1:e}| ${2} } 300 - snippet mapd 301 - map do |${1:e}| 302 - ${2} 303 - end 304 - snippet mapwi- 305 - enum_with_index.map { |${1:e}, ${2:i}| ${3} } 306 - snippet sor 307 - sort { |a, b| ${1} } 308 - snippet sorb 309 - sort_by { |${1:e}| ${2} } 310 - snippet ran 311 - sort_by { rand } 312 - snippet all 313 - all? { |${1:e}| ${2} } 314 - snippet any 315 - any? { |${1:e}| ${2} } 316 - snippet cl 317 - classify { |${1:e}| ${2} } 318 - snippet col 319 - collect { |${1:e}| ${2} } 320 - snippet cold 321 - collect do |${1:e}| 322 - ${2} 323 - end 324 - snippet det 325 - detect { |${1:e}| ${2} } 326 - snippet detd 327 - detect do |${1:e}| 328 - ${2} 329 - end 330 - snippet fet 331 - fetch(${1:name}) { |${2:key}| ${3} } 332 - snippet fin 333 - find { |${1:e}| ${2} } 334 - snippet find 335 - find do |${1:e}| 336 - ${2} 337 - end 338 - snippet fina 339 - find_all { |${1:e}| ${2} } 340 - snippet finad 341 - find_all do |${1:e}| 342 - ${2} 343 - end 344 - snippet gre 345 - grep(${1:/pattern/}) { |${2:match}| ${3} } 346 - snippet sub 347 - ${1:g}sub(${2:/pattern/}) { |${3:match}| ${4} } 348 - snippet sca 349 - scan(${1:/pattern/}) { |${2:match}| ${3} } 350 - snippet scad 351 - scan(${1:/pattern/}) do |${2:match}| 352 - ${3} 353 - end 354 - snippet max 355 - max { |a, b| ${1} } 356 - snippet min 357 - min { |a, b| ${1} } 358 - snippet par 359 - partition { |${1:e}| ${2} } 360 - snippet pard 361 - partition do |${1:e}| 362 - ${2} 363 - end 364 - snippet rej 365 - reject { |${1:e}| ${2} } 366 - snippet rejd 367 - reject do |${1:e}| 368 - ${2} 369 - end 370 - snippet sel 371 - select { |${1:e}| ${2} } 372 - snippet seld 373 - select do |${1:e}| 374 - ${2} 375 - end 376 - snippet lam 377 - lambda { |${1:args}| ${2} } 378 - snippet do noarg do 379 - do 380 - ${1} 381 - end 382 - snippet do arg do 383 - do |${1:variable}| 384 - ${2} 385 - end 386 - snippet : 387 - :${1:key} => ${2:'value'}${3} 388 - snippet ope 389 - open(${1:'path/or/url/or/pipe'}, '${2:w}') { |${3:io}| ${4} } 390 - # path_from_here() 391 - snippet patfh 392 - File.join(File.dirname(__FILE__), *%2[${1:rel path here}])${2} 393 - # unix_filter {} 394 - snippet unif 395 - ARGF.each_line${1} do |${2:line}| 396 - ${3} 397 - end 398 - # option_parse {} 399 - snippet optp 400 - require 'optparse' 401 - 402 - options = {${1:default => 'args'}} 403 - 404 - ARGV.options do |opts| 405 - opts.banner = 'Usage: #{File.basename($PROGRAM_NAME)} 406 - snippet opt 407 - opts.on('-${1:o}', '--${2:long-option-name}', ${3:String}, 408 - '${4:Option description.}') do |${5:opt}| 409 - ${6} 410 - end 411 - snippet tc 412 - require 'test/unit' 413 - 414 - require '${1:library_file_name}' 415 - 416 - class Test${2:$1} < Test::Unit::TestCase 417 - def test_${3:case_name} 418 - ${4} 419 - end 420 - end 421 - snippet ts 422 - require 'test/unit' 423 - 424 - require 'tc_${1:test_case_file}' 425 - require 'tc_${2:test_case_file}'${3} 426 - snippet as 427 - assert(${1:test}, '${2:Failure message.}')${3} 428 - snippet ase 429 - assert_equal(${1:expected}, ${2:actual})${3} 430 - snippet asne 431 - assert_not_equal(${1:unexpected}, ${2:actual})${3} 432 - snippet asid 433 - assert_in_delta(${1:expected_float}, ${2:actual_float}, ${3:2 ** -20})${4} 434 - snippet asio 435 - assert_instance_of(${1:ExpectedClass}, ${2:actual_instance})${3} 436 - snippet asko 437 - assert_kind_of(${1:ExpectedKind}, ${2:actual_instance})${3} 438 - snippet asn 439 - assert_nil(${1:instance})${2} 440 - snippet asnn 441 - assert_not_nil(${1:instance})${2} 442 - snippet asm 443 - assert_match(/${1:expected_pattern}/, ${2:actual_string})${3} 444 - snippet asnm 445 - assert_no_match(/${1:unexpected_pattern}/, ${2:actual_string})${3} 446 - snippet aso 447 - assert_operator(${1:left}, :${2:operator}, ${3:right})${4} 448 - snippet asr 449 - assert_raise(${1:Exception}) { ${2} } 450 - snippet asnr 451 - assert_nothing_raised(${1:Exception}) { ${2} } 452 - snippet asrt 453 - assert_respond_to(${1:object}, :${2:method})${3} 454 - snippet ass assert_same(..) 455 - assert_same(${1:expected}, ${2:actual})${3} 456 - snippet ass assert_send(..) 457 - assert_send([${1:object}, :${2:message}, ${3:args}])${4} 458 - snippet asns 459 - assert_not_same(${1:unexpected}, ${2:actual})${3} 460 - snippet ast 461 - assert_throws(:${1:expected}) { ${2} } 462 - snippet asnt 463 - assert_nothing_thrown { ${1} } 464 - snippet fl 465 - flunk('${1:Failure message.}')${2} 466 - # Benchmark.bmbm do .. end 467 - snippet bm- 468 - TESTS = ${1:10_000} 469 - Benchmark.bmbm do |results| 470 - ${2} 471 - end 472 - snippet rep 473 - results.report('${1:name}:') { TESTS.times { ${2} }} 474 - # Marshal.dump(.., file) 475 - snippet Md 476 - File.open(${1:'path/to/file.dump'}, 'wb') { |${2:file}| Marshal.dump(${3:obj}, $2) }${4} 477 - # Mashal.load(obj) 478 - snippet Ml 479 - File.open(${1:'path/to/file.dump'}, 'rb') { |${2:file}| Marshal.load($2) }${3} 480 - # deep_copy(..) 481 - snippet deec 482 - Marshal.load(Marshal.dump(${1:obj_to_copy}))${2} 483 - snippet Pn- 484 - PStore.new(${1:'file_name.pstore'})${2} 485 - snippet tra 486 - transaction(${1:true}) { ${2} } 487 - # xmlread(..) 488 - snippet xml- 489 - REXML::Document.new(File.read(${1:'path/to/file'}))${2} 490 - # xpath(..) { .. } 491 - snippet xpa 492 - elements.each(${1:'//Xpath'}) do |${2:node}| 493 - ${3} 494 - end 495 - # class_from_name() 496 - snippet clafn 497 - split('::').inject(Object) { |par, const| par.const_get(const) } 498 - # singleton_class() 499 - snippet sinc 500 - class << self; self end 501 - snippet nam 502 - namespace :${1:`Filename()`} do 503 - ${2} 504 - end 505 - snippet tas 506 - desc '${1:Task description\}' 507 - task :${2:task_name => [:dependent, :tasks]} do 508 - ${3} 509 - end 510 - snippet desc 511 - describe '${1}' do 512 - ${2} 513 - end 514 - snippet let 515 - let(:${1}) { ${2} } 516 - snippet sub 517 - subject { ${1} } 518 - snippet it 519 - it '${1}' do 520 - ${2} 521 - end
-29
nvim/snippets/sh.snippets
··· 1 - # #!/bin/bash 2 - snippet #! 3 - #!/bin/sh 4 - snippet #! 5 - #!/bin/bash 6 - snippet if 7 - if [[ ${1:condition} ]]; then 8 - ${2:#statements} 9 - fi 10 - snippet elif 11 - elif [[ ${1:condition} ]]; then 12 - ${2:#statements} 13 - snippet for 14 - for (( ${2:i} = 0; $2 < ${1:count}; $2++ )); do 15 - ${3:#statements} 16 - done 17 - snippet wh 18 - while [[ ${1:condition} ]]; do 19 - ${2:#statements} 20 - done 21 - snippet until 22 - until [[ ${1:condition} ]]; do 23 - ${2:#statements} 24 - done 25 - snippet case 26 - case ${1:word} in 27 - ${2:pattern}) 28 - ${3};; 29 - esac
-117
nvim/snippets/tex.snippets
··· 1 - # \begin{}...\end{} 2 - snippet begin 3 - \begin{${1:env}} 4 - ${2} 5 - \end{$1} 6 - # Tabular 7 - snippet tab 8 - \begin{${1:tabular}}{${2:c}} 9 - ${3} 10 - \end{$1} 11 - # Align(ed) 12 - snippet ali 13 - \begin{align${1:ed}} 14 - ${2} 15 - \end{align$1} 16 - # Gather(ed) 17 - snippet gat 18 - \begin{gather${1:ed}} 19 - ${2} 20 - \end{gather$1} 21 - # Equation 22 - snippet eq 23 - \begin{equation} 24 - ${1} 25 - \end{equation} 26 - # Unnumbered Equation 27 - snippet \ 28 - \\[ 29 - ${1} 30 - \\] 31 - # Enumerate 32 - snippet enum 33 - \begin{enumerate} 34 - \item ${1} 35 - \end{enumerate} 36 - # Itemize 37 - snippet item 38 - \begin{itemize} 39 - \item ${1} 40 - \end{itemize} 41 - # Description 42 - snippet desc 43 - \begin{description} 44 - \item[${1}] ${2} 45 - \end{description} 46 - # Matrix 47 - snippet mat 48 - \begin{${1:p/b/v/V/B/small}matrix} 49 - ${2} 50 - \end{$1matrix} 51 - # Cases 52 - snippet cas 53 - \begin{cases} 54 - ${1:equation}, &\text{ if }${2:case}\\ 55 - ${3} 56 - \end{cases} 57 - # Split 58 - snippet spl 59 - \begin{split} 60 - ${1} 61 - \end{split} 62 - # Part 63 - snippet part 64 - \part{${1:part name}} % (fold) 65 - \label{prt:${2:$1}} 66 - ${3} 67 - % part $2 (end) 68 - # Chapter 69 - snippet cha 70 - \chapter{${1:chapter name}} % (fold) 71 - \label{cha:${2:$1}} 72 - ${3} 73 - % chapter $2 (end) 74 - # Section 75 - snippet sec 76 - \section{${1:section name}} % (fold) 77 - \label{sec:${2:$1}} 78 - ${3} 79 - % section $2 (end) 80 - # Sub Section 81 - snippet sub 82 - \subsection{${1:subsection name}} % (fold) 83 - \label{sub:${2:$1}} 84 - ${3} 85 - % subsection $2 (end) 86 - # Sub Sub Section 87 - snippet subs 88 - \subsubsection{${1:subsubsection name}} % (fold) 89 - \label{ssub:${2:$1}} 90 - ${3} 91 - % subsubsection $2 (end) 92 - # Paragraph 93 - snippet par 94 - \paragraph{${1:paragraph name}} % (fold) 95 - \label{par:${2:$1}} 96 - ${3} 97 - % paragraph $2 (end) 98 - # Sub Paragraph 99 - snippet subp 100 - \subparagraph{${1:subparagraph name}} % (fold) 101 - \label{subp:${2:$1}} 102 - ${3} 103 - % subparagraph $2 (end) 104 - snippet itd 105 - \item[${1:description}] ${2:item} 106 - snippet it 107 - \item ${1:item} 108 - snippet figure 109 - ${1:Figure}~\ref{${2:fig:}}${3} 110 - snippet table 111 - ${1:Table}~\ref{${2:tab:}}${3} 112 - snippet listing 113 - ${1:Listing}~\ref{${2:list}}${3} 114 - snippet section 115 - ${1:Section}~\ref{${2:sec:}}${3} 116 - snippet page 117 - ${1:page}~\pageref{${2}}${3}
-32
nvim/snippets/vim.snippets
··· 1 - snippet header 2 - " File: ${1:`expand('%:t')`} 3 - " Author: ${2:`g:snips_author`} 4 - " Description: ${3} 5 - ${4:" Last Modified: `strftime("%B %d, %Y")`} 6 - snippet guard 7 - if exists('${1:did_`Filename()`}') || &cp${2: || version < 700} 8 - finish 9 - endif 10 - let $1 = 1${3} 11 - snippet f 12 - fun ${1:function_name}(${2}) 13 - ${3:" code} 14 - endf 15 - snippet for 16 - for ${1:needle} in ${2:haystack} 17 - ${3:" code} 18 - endfor 19 - snippet wh 20 - while ${1:condition} 21 - ${2:" code} 22 - endw 23 - snippet if 24 - if ${1:condition} 25 - ${2:" code} 26 - endif 27 - snippet ife 28 - if ${1:condition} 29 - ${2} 30 - else 31 - ${3} 32 - endif
-112
nvim/syntax/ktap.vim
··· 1 - " Vim syntax file 2 - " Language: ktap 3 - " Maintainer: Jovi Zhangwei <jovi.zhangwei@gmail.com> 4 - " First Author: Jovi Zhangwei <jovi.zhangwei@gmail.com> 5 - " Last Change: 2013 Dec 19 6 - 7 - " For version 5.x: Clear all syntax items 8 - " For version 6.x: Quit when a syntax file was already loaded 9 - if version < 600 10 - syn clear 11 - elseif exists("b:current_syntax") 12 - finish 13 - endif 14 - 15 - setlocal iskeyword=@,48-57,_,$ 16 - 17 - syn keyword ktapStatement break continue return 18 - syn keyword ktapRepeat while for in 19 - syn keyword ktapConditional if else elseif 20 - syn keyword ktapDeclaration trace trace_end 21 - syn keyword ktapIdentifier var 22 - syn keyword ktapFunction function 23 - syn match ktapBraces "[{}\[\]]" 24 - syn match ktapParens "[()]" 25 - syn keyword ktapReserved argstr probename arg0 arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9 26 - syn keyword ktapReserved cpu pid tid uid execname 27 - 28 - 29 - syn region ktapTraceDec start="\<trace\>"lc=5 end="{"me=s-1 contains=ktapString,ktapNumber 30 - syn region ktapTraceDec start="\<trace_end\>"lc=9 end="{"me=s-1 contains=ktapString,ktapNumber 31 - syn match ktapTrace contained "\<\w\+\>" containedin=ktapTraceDec 32 - 33 - syn region ktapFuncDec start="\<function\>"lc=8 end=":\|("me=s-1 contains=ktapString,ktapNumber 34 - syn match ktapFuncCall contained "\<\w\+\ze\(\s\|\n\)*(" 35 - syn match ktapFunc contained "\<\w\+\>" containedin=ktapFuncDec,ktapFuncCall 36 - 37 - syn match ktapStat contained "@\<\w\+\ze\(\s\|\n\)*(" 38 - 39 - " decimal number 40 - syn match ktapNumber "\<\d\+\>" 41 - " octal number 42 - syn match ktapNumber "\<0\o\+\>" contains=ktapOctalZero 43 - " Flag the first zero of an octal number as something special 44 - syn match ktapOctalZero contained "\<0" 45 - " flag an octal number with wrong digits 46 - syn match ktapOctalError "\<0\o*[89]\d*" 47 - " hex number 48 - syn match ktapNumber "\<0x\x\+\>" 49 - " numeric arguments 50 - syn match ktapNumber "\<\$\d\+\>" 51 - syn match ktapNumber "\<\$#" 52 - 53 - syn region ktapString oneline start=+"+ skip=+\\"+ end=+"+ 54 - " string arguments 55 - syn match ktapString "@\d\+\>" 56 - syn match ktapString "@#" 57 - syn region ktapString2 matchgroup=ktapString start="\[\z(=*\)\[" end="\]\z1\]" contains=@Spell 58 - 59 - " syn keyword ktapTodo contained TODO FIXME XXX 60 - 61 - syn match ktapComment "#.*" 62 - 63 - " treat ^#! as special 64 - syn match ktapSharpBang "^#!.*" 65 - 66 - 67 - syn keyword ktapFunc printf print print_hist stack 68 - syn keyword ktapFunc gettimeofday_us 69 - syn keyword ktapFunc pairs 70 - 71 - syn match ktapFunc /\<ffi\.cdef\>/ 72 - syn match ktapFunc /\<ffi\.new\>/ 73 - syn match ktapFunc /\<ffi\.free\>/ 74 - syn match ktapFunc /\<ffi\.C\>/ 75 - 76 - 77 - 78 - " Define the default highlighting. 79 - " For version 5.7 and earlier: only when not done already 80 - " For version 5.8 and later: only when an item doesn't have highlighting yet 81 - if version >= 508 || !exists("did_lua_syntax_inits") 82 - if version < 508 83 - let did_lua_syntax_inits = 1 84 - command -nargs=+ HiLink hi link <args> 85 - else 86 - command -nargs=+ HiLink hi def link <args> 87 - endif 88 - 89 - HiLink ktapNumber Number 90 - HiLink ktapOctalZero PreProc " c.vim does it this way... 91 - HiLink ktapOctalError Error 92 - HiLink ktapString String 93 - HiLink ktapString2 String 94 - HiLink ktapTodo Todo 95 - HiLink ktapComment Comment 96 - HiLink ktapSharpBang PreProc 97 - HiLink ktapStatement Statement 98 - HiLink ktapConditional Conditional 99 - HiLink ktapRepeat Repeat 100 - HiLink ktapTrace Function 101 - HiLink ktapFunc Function 102 - HiLink ktapStat Function 103 - HiLink ktapFunction Function 104 - HiLink ktapBraces Function 105 - HiLink ktapDeclaration Typedef 106 - HiLink ktapIdentifier Identifier 107 - HiLink ktapReserved Keyword 108 - 109 - delcommand HiLink 110 - endif 111 - 112 - let b:current_syntax = "ktap"
-151
nvim/syntax/scala.vim
··· 1 - " Vim syntax file 2 - " Language : Scala (http://scala-lang.org/) 3 - " Maintainers: Stefan Matthias Aust, Julien Wetterwald 4 - " Last Change: 2007 June 13 5 - 6 - if version < 600 7 - syntax clear 8 - elseif exists("b:current_syntax") 9 - finish 10 - endif 11 - 12 - syn case match 13 - syn sync minlines=50 14 - 15 - " most Scala keywords 16 - syn keyword scalaKeyword abstract case catch do else extends final finally for forSome if implicit lazy match new null override private protected requires return sealed super this throw try type while with yield 17 - syn match scalaKeyword "=>" 18 - syn match scalaKeyword "<-" 19 - syn match scalaKeyword "\<_\>" 20 - 21 - syn match scalaOperator ":\{2,\}" "this is not a type 22 - 23 - " package and import statements 24 - syn keyword scalaPackage package nextgroup=scalaFqn skipwhite 25 - syn keyword scalaImport import nextgroup=scalaFqn skipwhite 26 - syn match scalaFqn "\<[._$a-zA-Z0-9,]*" contained nextgroup=scalaFqnSet 27 - syn region scalaFqnSet start="{" end="}" contained 28 - 29 - " boolean literals 30 - syn keyword scalaBoolean true false 31 - 32 - " definitions 33 - syn keyword scalaDef def nextgroup=scalaDefName skipwhite 34 - syn keyword scalaVal val nextgroup=scalaValName skipwhite 35 - syn keyword scalaVar var nextgroup=scalaVarName skipwhite 36 - syn keyword scalaClass class nextgroup=scalaClassName skipwhite 37 - syn keyword scalaObject object nextgroup=scalaClassName skipwhite 38 - syn keyword scalaTrait trait nextgroup=scalaClassName skipwhite 39 - syn match scalaDefName "[^ =:;([]\+" contained nextgroup=scalaDefSpecializer skipwhite 40 - syn match scalaValName "[^ =:;([]\+" contained 41 - syn match scalaVarName "[^ =:;([]\+" contained 42 - syn match scalaClassName "[^ =:;(\[]\+" contained nextgroup=scalaClassSpecializer skipwhite 43 - syn region scalaDefSpecializer start="\[" end="\]" contained contains=scalaDefSpecializer 44 - syn region scalaClassSpecializer start="\[" end="\]" contained contains=scalaClassSpecializer 45 - 46 - " type constructor (actually anything with an uppercase letter) 47 - syn match scalaConstructor "\<[A-Z][_$a-zA-Z0-9]*\>" nextgroup=scalaConstructorSpecializer 48 - syn region scalaConstructorSpecializer start="\[" end="\]" contained contains=scalaConstructorSpecializer 49 - 50 - " method call 51 - syn match scalaRoot "\<[a-zA-Z][_$a-zA-Z0-9]*\."me=e-1 52 - syn match scalaMethodCall "\.[a-z][_$a-zA-Z0-9]*"ms=s+1 53 - 54 - " type declarations in val/var/def 55 - syn match scalaType ":\s*\(=>\s*\)\?[._$a-zA-Z0-9]\+\(\[[^]]*\]\+\)\?\(\s*\(<:\|>:\|#\|=>\)\s*[._$a-zA-Z0-9]\+\(\[[^]]*\]\+\)*\)*"ms=s+1 56 - 57 - " comments 58 - syn match scalaTodo "[tT][oO][dD][oO]" contained 59 - syn match scalaLineComment "//.*" contains=scalaTodo 60 - syn region scalaComment start="/\*" end="\*/" contains=scalaTodo 61 - syn case ignore 62 - syn include @scalaHtml syntax/html.vim 63 - unlet b:current_syntax 64 - syn case match 65 - syn region scalaDocComment start="/\*\*" end="\*/" contains=scalaDocTags,scalaTodo,@scalaHtml keepend 66 - syn region scalaDocTags start="{@\(link\|linkplain\|inherit[Dd]oc\|doc[rR]oot\|value\)" end="}" contained 67 - syn match scalaDocTags "@[a-z]\+" contained 68 - 69 - syn match scalaEmptyString "\"\"" 70 - 71 - " multi-line string literals 72 - syn region scalaMultiLineString start="\"\"\"" end="\"\"\"" contains=scalaUnicode 73 - syn match scalaUnicode "\\u[0-9a-fA-F]\{4}" contained 74 - 75 - " string literals with escapes 76 - syn region scalaString start="\"[^"]" skip="\\\"" end="\"" contains=scalaStringEscape " TODO end \n or not? 77 - syn match scalaStringEscape "\\u[0-9a-fA-F]\{4}" contained 78 - syn match scalaStringEscape "\\[nrfvb\\\"]" contained 79 - 80 - " symbol and character literals 81 - syn match scalaSymbol "'[_a-zA-Z0-9][_a-zA-Z0-9]*\>" 82 - syn match scalaChar "'[^'\\]'\|'\\.'\|'\\u[0-9a-fA-F]\{4}'" 83 - 84 - " number literals 85 - syn match scalaNumber "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>" 86 - syn match scalaNumber "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\=" 87 - syn match scalaNumber "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>" 88 - syn match scalaNumber "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>" 89 - 90 - " xml literals 91 - syn match scalaXmlTag "<[a-zA-Z]\_[^>]*/>" contains=scalaXmlQuote,scalaXmlEscape,scalaXmlString 92 - syn region scalaXmlString start="\"" end="\"" contained 93 - syn match scalaXmlStart "<[a-zA-Z]\_[^>]*>" contained contains=scalaXmlQuote,scalaXmlEscape,scalaXmlString 94 - syn region scalaXml start="<\([a-zA-Z]\_[^>]*\_[^/]\|[a-zA-Z]\)>" matchgroup=scalaXmlStart end="</\_[^>]\+>" contains=scalaXmlEscape,scalaXmlQuote,scalaXml,scalaXmlStart,scalaXmlComment 95 - syn region scalaXmlEscape matchgroup=scalaXmlEscapeSpecial start="{" matchgroup=scalaXmlEscapeSpecial end="}" contained contains=TOP 96 - syn match scalaXmlQuote "&[^;]\+;" contained 97 - syn match scalaXmlComment "<!--\_[^>]*-->" contained 98 - 99 - syn sync fromstart 100 - 101 - " map Scala groups to standard groups 102 - hi link scalaKeyword Keyword 103 - hi link scalaPackage Include 104 - hi link scalaImport Include 105 - hi link scalaBoolean Boolean 106 - hi link scalaOperator Normal 107 - hi link scalaNumber Number 108 - hi link scalaEmptyString String 109 - hi link scalaString String 110 - hi link scalaChar String 111 - hi link scalaMultiLineString String 112 - hi link scalaStringEscape Special 113 - hi link scalaSymbol Special 114 - hi link scalaUnicode Special 115 - hi link scalaComment Comment 116 - hi link scalaLineComment Comment 117 - hi link scalaDocComment Comment 118 - hi link scalaDocTags Special 119 - hi link scalaTodo Todo 120 - hi link scalaType Type 121 - hi link scalaTypeSpecializer scalaType 122 - hi link scalaXml String 123 - hi link scalaXmlTag Include 124 - hi link scalaXmlString String 125 - hi link scalaXmlStart Include 126 - hi link scalaXmlEscape Normal 127 - hi link scalaXmlEscapeSpecial Special 128 - hi link scalaXmlQuote Special 129 - hi link scalaXmlComment Comment 130 - hi link scalaDef Keyword 131 - hi link scalaVar Keyword 132 - hi link scalaVal Keyword 133 - hi link scalaClass Keyword 134 - hi link scalaObject Keyword 135 - hi link scalaTrait Keyword 136 - hi link scalaDefName Function 137 - hi link scalaDefSpecializer Function 138 - hi link scalaClassName Special 139 - hi link scalaClassSpecializer Special 140 - hi link scalaConstructor Special 141 - hi link scalaConstructorSpecializer scalaConstructor 142 - 143 - let b:current_syntax = "scala" 144 - 145 - " you might like to put these lines in your .vimrc 146 - " 147 - " customize colors a little bit (should be a different file) 148 - " hi scalaNew gui=underline 149 - " hi scalaMethodCall gui=italic 150 - " hi scalaValName gui=underline 151 - " hi scalaVarName gui=underline