From 8e7e2d4ee46f7b940a289e8afc3cb1a450aca232 Mon Sep 17 00:00:00 2001 From: ujihisa Date: Wed, 26 Sep 2012 19:02:30 -0700 Subject: [PATCH] expanding tabs to spaces. it'll indent well with 'expandtab' --- .../sources/snippets_complete/java.snip | 147 ++++++------------ .../sources/snippets_complete/javascript.snip | 52 +++---- .../sources/snippets_complete/lua.snip | 24 +-- doc/neocomplcache-snippets-complete.txt | 17 +- 4 files changed, 98 insertions(+), 142 deletions(-) diff --git a/autoload/neocomplcache/sources/snippets_complete/java.snip b/autoload/neocomplcache/sources/snippets_complete/java.snip index daad9b2..053666b 100644 --- a/autoload/neocomplcache/sources/snippets_complete/java.snip +++ b/autoload/neocomplcache/sources/snippets_complete/java.snip @@ -1,274 +1,229 @@ snippet pu public - snippet po protected - snippet pr private - snippet st static - snippet fi final - snippet ab abstract - snippet cl - class ${1} ${2:extends} ${3:Parent} ${4:implements} ${5:Interface} { - ${0} - } - + class ${1} ${2:extends} ${3:Parent} ${4:implements} ${5:Interface} { + ${0} + } snippet in - interface ${1} ${2:extends} ${3:Parent} { - ${0} - } - + interface ${1} ${2:extends} ${3:Parent} { + ${0} + } snippet m - ${1:void} ${2:method}(${3}) ${4:throws} { - ${0} - } + ${1:void} ${2:method}(${3}) ${4:throws} { + ${0} + } snippet v ${1:String} ${2:var}${3}; - snippet co static public final ${1:String} ${2:var} = ${3};${4} - snippet cos static public final String ${1:var} = "${2}";${4} - snippet re return - snippet as assert ${1:test} ${2:Failure message};${3} - snippet if - if (${1}) { - ${2} - } + if (${1}) { + ${2} + } snippet elif - else if (${1}) { - ${2} - } + else if (${1}) { + ${2} + } snippet wh - while (${1}) { - ${2} - } + while (${1}) { + ${2} + } snippet for - for (${1}; ${2}; ${3}) { - ${4} - } - - + for (${1}; ${2}; ${3}) { + ${4} + } + + snippet fore - for (${1} : ${2}) { - ${3} + for (${1} : ${2}) { + ${3} } - snippet sw - switch (${1}) { - ${2} - } + switch (${1}) { + ${2} + } snippet case abbr ce - case ${1}: - ${2} - ${0} - + case ${1}: + ${2} + ${0} + snippet br break; - snippet de - default: - ${0} - + default: + ${0} snippet ca - catch (${1:Exception} ${2:e}) { - ${0} - } + catch (${1:Exception} ${2:e}) { + ${0} + } snippet th throw ${0} - snippet sy synchronized - snippet im import - snippet pa package - snippet tc - public class ${1} extends ${2:TestCase} { - ${0} - } + public class ${1} extends ${2:TestCase} { + ${0} + } snippet test - public void test${1:Name}() throws Exception { - ${0} - } + public void test${1:Name}() throws Exception { + ${0} + } snippet imt - import junit.framework.TestCase; - ${0} + import junit.framework.TestCase; + ${0} snippet j.u java.util. - snippet j.i java.io. - snippet j.b java.beans. - snippet j.n java.net - snippet j.m java.math. - snippet main - public static void main(String[] args) { - ${0} - } + public static void main(String[] args) { + ${0} + } snippet pl System.out.println(${1});${0} - snippet p System.out.print(${1});${0} - #javadoc snippet c - /** - * ${0} - */ + /** + * ${0} + */ snippet a @author ${0:$TM_FULLNAME} - snippet {code abbr { {@code ${0} - snippet d @deprecated ${0:description} - snippet {docRoot abbr { {@docRoot - snippet {inheritDoc abbr { {@inheritDoc - snippet {link abbr { {@link ${1:target} ${0:label} - snippet {linkplain abbr { {@linkplain ${1:target} ${0:label} - snippet {literal abbr { {@literal ${0} - snippet param @param ${1:var} ${0:description} - snippet r @return ${0:description} - snippet s @see ${0:reference} - snippet se @serial ${0:description} - snippet sd @serialField ${0:description} - snippet sf @serialField ${1:name} ${2:type} ${0:description} - snippet si @since ${0:version} - snippet t @throws ${1:class} ${0:description} - snippet {value abbr { {@value ${0} - snippet ver @version ${0:version} - snippet null {@code null} diff --git a/autoload/neocomplcache/sources/snippets_complete/javascript.snip b/autoload/neocomplcache/sources/snippets_complete/javascript.snip index c2d3ff7..46216ca 100644 --- a/autoload/neocomplcache/sources/snippets_complete/javascript.snip +++ b/autoload/neocomplcache/sources/snippets_complete/javascript.snip @@ -1,49 +1,49 @@ snippet :f - ${1:method_name}: function(${2:attribute}) { - ${0} - } + ${1:method_name}: function(${2:attribute}) { + ${0} + } snippet func alias function - function ${1:function_name}(${2:argument}) { - ${0:// body...} - } + function ${1:function_name}(${2:argument}) { + ${0:// body...} + } snippet proto - ${1:class_name}.prototype.${2:method_name} = function(${3:first_argument}) { - ${0:// body...} - }; + ${1:class_name}.prototype.${2:method_name} = function(${3:first_argument}) { + ${0:// body...} + }; snippet f - function(${1}) { ${0:$TM_SELECTED_TEXT} }; + function(${1}) { ${0:$TM_SELECTED_TEXT} }; snippet if - if (${1:true}) { - ${0:$TM_SELECTED_TEXT} - } + if (${1:true}) { + ${0:$TM_SELECTED_TEXT} + } snippet ife - if (${1:true}) { - ${0:$TM_SELECTED_TEXT} - } else { - } + if (${1:true}) { + ${0:$TM_SELECTED_TEXT} + } else { + } snippet for - for (var ${2:i}=0; $2 < ${1:Things}.length; $2++) { - ${0} - } + for (var ${2:i}=0; $2 < ${1:Things}.length; $2++) { + ${0} + } snippet forin - for (var ${2:i} in ${1:Things}) { - ${0} - }; + for (var ${2:i} in ${1:Things}) { + ${0} + }; snippet ;, - ${1:value_name}:${0:value}, + ${1:value_name}:${0:value}, snippet key - ${1:key}: "${2:value}"}${3:, } + ${1:key}: "${2:value}"}${3:, } snippet timeout - setTimeout(function() {${0}}${2:}, ${1:10}); + setTimeout(function() {${0}}${2:}, ${1:10}); diff --git a/autoload/neocomplcache/sources/snippets_complete/lua.snip b/autoload/neocomplcache/sources/snippets_complete/lua.snip index 5ef3dcc..5389f1b 100644 --- a/autoload/neocomplcache/sources/snippets_complete/lua.snip +++ b/autoload/neocomplcache/sources/snippets_complete/lua.snip @@ -1,20 +1,20 @@ snippet func alias function - function ${1:function_name}(${2:argument}) - ${0:// body...} - end + function ${1:function_name}(${2:argument}) + ${0:// body...} + end snippet if - if (${1:true}) then - ${0:$TM_SELECTED_TEXT} - end + if (${1:true}) then + ${0:$TM_SELECTED_TEXT} + end snippet for - for ${2:i} = 0, ${1:Things} do - ${0} - end + for ${2:i} = 0, ${1:Things} do + ${0} + end snippet forin - for ${2:k}, ${3:v} in ${1:ipairs(xs)} do - ${0} - end + for ${2:k}, ${3:v} in ${1:ipairs(xs)} do + ${0} + end diff --git a/doc/neocomplcache-snippets-complete.txt b/doc/neocomplcache-snippets-complete.txt index 22ee0b9..b3a84d7 100644 --- a/doc/neocomplcache-snippets-complete.txt +++ b/doc/neocomplcache-snippets-complete.txt @@ -137,13 +137,13 @@ KEY MAPPINGS *neocomplcache-snippets-complete-key-mappings* neocomplcache#sources#snippets_complete#expandable() *neocomplcache#sources#snippets_complete#expandable()* Use this function with imap . It checks whether cursor - text is snippets trigger or existing placeholder in current - buffer. Useful for saving keymappings. - Return value is - 0 : not found - 1 : cursor text is snippets trigger - 2 : existing placeholder in current buffer - 3 : both found. + text is a snippet trigger or a placeholder exists in the + current buffer. It's useful for saving keymappings. + Return value is not just a boolean but either + 0: not found + 1: cursor text is a snippet trigger + 2: a placeholder exists in the current buffer + 3: both found > imap neocomplcache#sources#snippets_complete#expandable() ? \ "\(neocomplcache_snippets_expand)" : "\" @@ -151,7 +151,7 @@ neocomplcache#sources#snippets_complete#expandable() neocomplcache#sources#snippets_complete#force_expandable() *neocomplcache#sources#snippets_complete#force_expandable()* Use this function with imap . It checks whether cursor - text is snippets trigger. Useful for saving keymappings. + text is snippet trigger. Useful for saving keymappings. neocomplcache#sources#snippets_complete#jumpable() *neocomplcache#sources#snippets_complete#jumpable()* @@ -308,6 +308,7 @@ CHANGELOG *neocomplcache-snippets-complete-changelog* 2012-09-27 - Improved add placeholder behavior. +- Fixed wrong indentation when 'expandtab'. 2012-09-23 - Fixed substitute tab character.