diff options
35 files changed, 419 insertions, 13438 deletions
diff --git a/home/.Xresources b/home/.Xresources index 31b2f5d..bb16fde 100644 --- a/home/.Xresources +++ b/home/.Xresources @@ -6,7 +6,7 @@ ! Xft.lcdfilter: lcddefault ! for dpi also see ~/bin/environment -Xft.dpi: 140 +Xft.dpi: 157 Xft.antialias: true Xft.hinting: true Xft.autohint: 0 @@ -26,31 +26,32 @@ Xcursor.size: 32 ! X T E R M - Setting ! XTerm*Background: black -XTerm*Foreground: gray +XTerm*Foreground: gray -XTerm*cursorColor: white +XTerm*cursorColor: white -XTerm*colorBDMode: true -XTerm*highlightColor: darkgray +XTerm*colorBDMode: true +XTerm*highlightColor: darkgray -XTerm*geometry: 80x25 -!XTerm*faceName: inconsolata:pixelsize=26 -!XTerm*faceName: xft:Inconsolata for Powerline:style=Medium:regular:pixelsize=28:size=14:antialias=true -XTerm*faceName: xft:DejaVu Sans Mono:style=Book:regular:size=12:antialias=true +XTerm*geometry: 80x25 +!XTerm*faceName: inconsolata:pixelsize=26 +XTerm*faceName: xft:DejaVu Sans Mono:style=Book:regular:size=12:antialias=true !XTerm*font: -*-dina-medium-r-*-*-16-*-*-*-*-*-*-* -XTerm*font: -misc-inconsolata-medium-r-normal--0-0-0-0-p-0- -XTerm*dynamicColors: true -XTerm*utf8: 2 -XTerm*eightBitInput: false -XTerm*scrollTtyKeypress: true -XTerm*multiScroll: true -XTerm*toolBar: false - -XTerm*jumpScroll: true -XTerm*saveLines: 8192 -XTerm*scrollBar: false -XTerm*scrollKey: true -XTerm*scrollTtyOutput: false +XTerm*font: -misc-inconsolata-medium-r-normal--0-0-0-0-p-0- +XTerm*dynamicColors: true +XTerm*utf8: 2 +XTerm*eightBitInput: false +XTerm*scrollTtyKeypress: true +XTerm*multiScroll: true +XTerm*toolBar: false + +XTerm*jumpScroll: true +XTerm*saveLines: 65536 +XTerm*scrollBar: false +XTerm*scrollKey: true +XTerm*scrollTtyOutput: false + +XTerm*on3Clicks: regex ([[:alpha:]]+://)?([[:alnum:]!#+,./=?@_~-]|(%[[:xdigit:]][[:xdigit:]]))+ !black XTerm*color0: #2e3436 @@ -88,7 +89,7 @@ URxvt*termName: rxvt-256color URxvt*depth: 32 URxvt*background: rgba:0000/0000/0000/ffff -URxvt*foreground: rgba:aaaa/aaaa/aaaa/ffff +URxvt*foreground: rgba:dddd/dddd/dddd/ffff URxvt*cursorColor: white URxvt.colorBD: white URxvt.colorIT: green @@ -101,24 +102,10 @@ URxvt.letterSpace: -1 URxvt.iso14755: true URxvt.iso14755_52: false -!URxvt*font: xft:DejaVu Sans Mono:style=Book:regular:size=12:antialias=true -!URxvt*imFont: xft:DejaVu Sans Mono:style=Book:regular:size=12:antialias=true -!URxvt*boldFont: xft:DejaVu Sans Mono:style=Bold:bold:size=12:antialias=true -!URxvt*italicFont: xft:DejaVu Sans Mono:style=Oblique:italic:size=12:antialias=true -!URxvt*boldItalicFont: xft:DejaVu Sans Mono:style=Bold Oblique:bold:italic:size=12:antialias=true -!URxvt*font: xft:Inconsolata for Powerline:style=Medium:regular:pixelsize=26:size=14:antialias=true -!URxvt*imFont: xft:Inconsolata for Powerline:style=Medium:regular:pixelsize=26:size=14:antialias=true -!URxvt*boldFont: xft:Inconsolata for Powerline:style=Medium:bold:pixelsize=26:size=14:antialias=true -!URxvt*italicFont: xft:Inconsolata for Powerline:style=Medium:italic:pixelsize=26:size=14:antialias=true -!URxvt*boldItalicFont: xft:Inconsolata for Powerline:style=Medium:bold:italic:pixelsize=26:size=14:antialias=true -!#define fonts xft:Noto Mono:style=Regular +!#define fonts xft:Noto Mono:style=Regular,xft:PowerlineSymbols,xft:Noto Emoji !URxvt*font: fonts URxvt*font: xft:Noto Mono:style=Regular:pixelsize=22,xft:PowerlineSymbols:size=4:pixelsize=4:minspace=False,xft:Noto Emoji:style=Regular:pixelsize=22:minspace=False -!URxvt*font: xft:Noto Mono:size=14,xft:Noto Color Emoji:size=14 -!URxvt*imFont: xft:Noto Mono:size=14,xft:Noto Color Emoji:size=14 -!URxvt*boldFont: xft:Noto Mono:size=14:bold,xft:Noto Color Emoji:size=14 -!URxvt*italicFont: xft:Noto Mono:size=14:italic,xft:Noto Color Emoji:size=14 -!URxvt*boldItalicFont: xft:Noto Mono:size=14:italic:bold,xft:Noto Color Emoji:size=14 +!URxvt*font: xft:Noto Mono:style=Regular URxvt*scrollBar: false URxvt*jumpScroll: false diff --git a/home/.gitconfig b/home/.gitconfig index 3608066..6452b23 100644 --- a/home/.gitconfig +++ b/home/.gitconfig @@ -31,8 +31,7 @@ rebase = preserve [push] - #default = upstream - default = simple + default = upstream [rebase] autostash = true diff --git a/home/.tmux.conf b/home/.tmux.conf index 4f4d12b..302bd04 100644 --- a/home/.tmux.conf +++ b/home/.tmux.conf @@ -27,7 +27,8 @@ set-option -g set-titles on set-option -g bell-action any # If on, ring the terminal bell when an activity, content or silence alert # occurs. -set-option -g bell-on-alert on +set-option -g activity-action other +set-option -g silence-action other # visual-activity: on = status line message, off = bell on monitor-activity set-option -g visual-activity off diff --git a/home/.vim/after/filetype.vim b/home/.vim/after/filetype.vim deleted file mode 100644 index 5113453..0000000 --- a/home/.vim/after/filetype.vim +++ /dev/null @@ -1,8 +0,0 @@ - -autocmd BufNewFile,BufRead *.r set ft=r -autocmd BufNewFile,BufRead *.R set ft=r -autocmd BufNewFile,BufRead *.s set ft=r -autocmd BufNewFile,BufRead *.S set ft=r -autocmd BufRead *.Rout set ft=r -autocmd BufRead *.Rhistory set ft=r - diff --git a/home/.vim/autoload/Reflection.java b/home/.vim/autoload/Reflection.java deleted file mode 100644 index 5452b0f..0000000 --- a/home/.vim/autoload/Reflection.java +++ /dev/null @@ -1,670 +0,0 @@ -/** - * Reflection.java - * - * A utility class for javacomplete mainly for reading class or package information. - * Version: 0.77 - * Maintainer: cheng fang <fangread@yahoo.com.cn> - * Last Change: 2007-09-16 - * Copyright: Copyright (C) 2007 cheng fang. All rights reserved. - * License: Vim License (see vim's :help license) - * - */ - -import java.lang.reflect.*; -import java.io.*; -import java.util.*; -import java.util.zip.*; - -class Reflection { - static final String VERSION = "0.77"; - - static final int OPTION_FIELD = 1; - static final int OPTION_METHOD = 2; - static final int OPTION_STATIC_FIELD = 4; - static final int OPTION_STATIC_METHOD = 8; - static final int OPTION_CONSTRUCTOR = 16; - static final int OPTION_STATIC = 12; // compound static - static final int OPTION_INSTANCE = 15; // compound instance - static final int OPTION_ALL = 31; // compound all - static final int OPTION_SUPER = 32; - static final int OPTION_SAME_PACKAGE = 64; - - static final int STRATEGY_ALPHABETIC = 128; - static final int STRATEGY_HIERARCHY = 256; - static final int STRATEGY_DEFAULT = 512; - - static final int RETURN_ALL_PACKAGE_INFO = 0x1000; - - static final String KEY_NAME = "'n':"; // "'name':"; - static final String KEY_TYPE = "'t':"; // "'type':"; - static final String KEY_MODIFIER = "'m':"; // "'modifier':"; - static final String KEY_PARAMETERTYPES = "'p':"; // "'parameterTypes':"; - static final String KEY_RETURNTYPE = "'r':"; // "'returnType':"; - static final String KEY_DESCRIPTION = "'d':"; // "'description':"; - static final String KEY_DECLARING_CLASS = "'c':"; // "'declaringclass':"; - - static final String NEWLINE = ""; // "\r\n" - - static boolean debug_mode = false; - - static Hashtable htClasspath = new Hashtable(); - - public static boolean existed(String fqn) { - boolean result = false; - try { - Class.forName(fqn); - result = true; - } - catch (Exception ex) { - } - return result; - } - - public static String existedAndRead(String fqns) { - Hashtable mapPackages = new Hashtable(); // qualified name --> StringBuffer - Hashtable mapClasses = new Hashtable(); // qualified name --> StringBuffer - - for (StringTokenizer st = new StringTokenizer(fqns, ","); st.hasMoreTokens(); ) { - String fqn = st.nextToken(); - try { - Class clazz = Class.forName(fqn); - putClassInfo(mapClasses, clazz); - } - catch (Exception ex) { - String binaryName = fqn; - boolean found = false; - while (true) { - try { - int lastDotPos = binaryName.lastIndexOf('.'); - if (lastDotPos == -1) - break; - binaryName = binaryName.substring(0, lastDotPos) + '$' + binaryName.substring(lastDotPos+1, binaryName.length()); - Class clazz = Class.forName(binaryName); - putClassInfo(mapClasses, clazz); - found = true; - break; - } - catch (Exception e) { - } - } - if (!found) - putPackageInfo(mapPackages, fqn); - } - } - - if (mapPackages.size() > 0 || mapClasses.size() > 0) { - StringBuffer sb = new StringBuffer(4096); - sb.append("{"); - for (Enumeration e = mapPackages.keys(); e.hasMoreElements(); ) { - String s = (String)e.nextElement(); - sb.append("'").append( s.replace('$', '.') ).append("':").append(mapPackages.get(s)).append(","); - } - for (Enumeration e = mapClasses.keys(); e.hasMoreElements(); ) { - String s = (String)e.nextElement(); - sb.append("'").append( s.replace('$', '.') ).append("':").append(mapClasses.get(s)).append(","); - } - sb.append("}"); - return sb.toString(); - } - else - return ""; - } - - private static String getPackageList(String fqn) { - Hashtable mapPackages = new Hashtable(); - putPackageInfo(mapPackages, fqn); - return mapPackages.size() > 0 ? mapPackages.get(fqn).toString() : ""; - } - - private static Hashtable collectClassPath() { - if (!htClasspath.isEmpty()) - return htClasspath; - - // runtime classes - if ("Kaffe".equals(System.getProperty("java.vm.name"))) { - addClasspathesFromDir(System.getProperty("java.home") + File.separator + "share" + File.separator + "kaffe" + File.separator); - } - else if ("GNU libgcj".equals(System.getProperty("java.vm.name"))) { - if (new File(System.getProperty("sun.boot.class.path")).exists()) - htClasspath.put(System.getProperty("sun.boot.class.path"), ""); - } - - if (System.getProperty("java.vendor").toLowerCase(Locale.US).indexOf("microsoft") >= 0) { - // `*.ZIP` files in `Packages` directory - addClasspathesFromDir(System.getProperty("java.home") + File.separator + "Packages" + File.separator); - } - else { - // the following code works for several kinds of JDK - // - JDK1.1: classes.zip - // - JDK1.2+: rt.jar - // - JDK1.4+ of Sun and Apple: rt.jar + jce.jar + jsse.jar - // - JDK1.4 of IBM split rt.jar into core.jar, graphics.jar, server.jar - // combined jce.jar and jsse.jar into security.jar - // - JDK for MacOS X split rt.jar into classes.jar, ui.jar in Classes directory - addClasspathesFromDir(System.getProperty("java.home") + File.separator + "lib" + File.separator); - addClasspathesFromDir(System.getProperty("java.home") + File.separator + "jre" + File.separator + "lib" + File.separator); - addClasspathesFromDir(System.getProperty("java.home") + File.separator + ".." + File.separator + "Classes" + File.separator); - } - - // ext - String extdirs = System.getProperty("java.ext.dirs"); - for (StringTokenizer st = new StringTokenizer(extdirs, File.pathSeparator); st.hasMoreTokens(); ) { - addClasspathesFromDir(st.nextToken() + File.separator); - } - - // user classpath - String classPath = System.getProperty("java.class.path"); - StringTokenizer st = new StringTokenizer(classPath, File.pathSeparator); - while (st.hasMoreTokens()) { - String path = st.nextToken(); - File f = new File(path); - if (!f.exists()) - continue; - - if (path.endsWith(".jar") || path.endsWith(".zip")) - htClasspath.put(f.toString(), ""); - else { - if (f.isDirectory()) - htClasspath.put(f.toString(), ""); - } - } - - return htClasspath; - } - - private static void addClasspathesFromDir(String dirpath) { - File dir = new File(dirpath); - if (dir.isDirectory()) { - String[] items = dir.list(); // use list() instead of listFiles() since the latter are introduced in 1.2 - for (int i = 0; i < items.length; i++) { - File f = new File(dirpath + items[i]); - if (!f.exists()) - continue; - - if (items[i].endsWith(".jar") || items[i].endsWith(".zip") || items[i].endsWith(".ZIP")) { - htClasspath.put(f.toString(), ""); - } - else if (items.equals("classes")) { - if (f.isDirectory()) - htClasspath.put(f.toString(), ""); - } - } - } - } - - - /** - * If name is empty, put all loadable package info into map once. - */ - private static void putPackageInfo(Hashtable map, String name) { - String prefix = name.replace('.', '/') + "/"; - Hashtable subpackages = new Hashtable(); - Hashtable classes = new Hashtable(); - for (Enumeration e = collectClassPath().keys(); e.hasMoreElements(); ) { - String path = (String)e.nextElement(); - if (path.endsWith(".jar") || path.endsWith(".zip")) - appendListFromJar(subpackages, classes, path, prefix); - else - appendListFromFolder(subpackages, classes, path, prefix); - } - - if (subpackages.size() > 0 || classes.size() > 0) { - StringBuffer sb = new StringBuffer(1024); - sb.append("{'tag':'PACKAGE','subpackages':["); - for (Enumeration e = subpackages.keys(); e.hasMoreElements(); ) { - sb.append("'").append(e.nextElement()).append("',"); - } - sb.append("],'classes':["); - for (Enumeration e = classes.keys(); e.hasMoreElements(); ) { - sb.append("'").append(e.nextElement()).append("',"); - } - sb.append("]}"); - map.put(name, sb.toString()); - } - } - - public static void appendListFromJar(Hashtable subpackages, Hashtable classes, String path, String prefix) { - try { - for (Enumeration entries = new ZipFile(path).entries(); entries.hasMoreElements(); ) { - String entry = entries.nextElement().toString(); - int len = entry.length(); - if (entry.endsWith(".class") && entry.indexOf('$') == -1 - && entry.startsWith(prefix)) { - int splitPos = entry.indexOf('/', prefix.length()); - String shortname = entry.substring(prefix.length(), splitPos == -1 ? entry.length()-6 : splitPos); - if (splitPos == -1) { - if (!classes.containsKey(shortname)) - classes.put(shortname, ""); //classes.put(shortname, "{'tag':'CLASSDEF','name':'"+shortname+"'}"); - } - else { - if (!subpackages.containsKey(shortname)) - subpackages.put(shortname, ""); //subpackages.put(shortname, "{'tag':'PACKAGE','name':'" +shortname+"'}"); - } - } - } - } - catch (Throwable e) { - //e.printStackTrace(); - } - } - - public static void appendListFromFolder(Hashtable subpackages, Hashtable classes, String path, String prefix) { - try { - String fullPath = path + "/" + prefix; - File file = new File(fullPath); - if (file.isDirectory()) { - String[] descents = file.list(); - for (int i = 0; i < descents.length; i++) { - if (descents[i].indexOf('$') == -1) { - if (descents[i].endsWith(".class")) { - String shortname = descents[i].substring(0, descents[i].length()-6); - if (!classes.containsKey(shortname)) - classes.put(shortname, ""); - } - else if ((new File(fullPath + "/" + descents[i])).isDirectory()) { - if (!subpackages.containsKey(descents[i])) - subpackages.put(descents[i], ""); - } - } - } - } - } - catch (Throwable e) { - } - } - - private static int INDEX_PACKAGE = 0; - private static int INDEX_CLASS = 1; - - // generate information of all packages in jar files. - public static String getPackageList() { - Hashtable map = new Hashtable(); - - for (Enumeration e = collectClassPath().keys(); e.hasMoreElements(); ) { - String path = (String)e.nextElement(); - if (path.endsWith(".jar") || path.endsWith(".zip")) - appendListFromJar(path, map); - } - - StringBuffer sb = new StringBuffer(4096); - sb.append("{"); - //sb.append("'*':'").append( map.remove("") ).append("',"); // default package - for (Enumeration e = map.keys(); e.hasMoreElements(); ) { - String s = (String)e.nextElement(); - StringBuffer[] sbs = (StringBuffer[])map.get(s); - sb.append("'").append( s.replace('/', '.') ).append("':") - .append("{'tag':'PACKAGE'"); - if (sbs[INDEX_PACKAGE].length() > 0) - sb.append(",'subpackages':[").append(sbs[INDEX_PACKAGE]).append("]"); - if (sbs[INDEX_CLASS].length() > 0) - sb.append(",'classes':[").append(sbs[INDEX_CLASS]).append("]"); - sb.append("},"); - } - sb.append("}"); - return sb.toString(); - - } - - public static void appendListFromJar(String path, Hashtable map) { - try { - for (Enumeration entries = new ZipFile(path).entries(); entries.hasMoreElements(); ) { - String entry = entries.nextElement().toString(); - int len = entry.length(); - if (entry.endsWith(".class") && entry.indexOf('$') == -1) { - int slashpos = entry.lastIndexOf('/'); - String parent = entry.substring(0, slashpos); - String child = entry.substring(slashpos+1, len-6); - putItem(map, parent, child, INDEX_CLASS); - - slashpos = parent.lastIndexOf('/'); - if (slashpos != -1) { - AddToParent(map, parent.substring(0, slashpos), parent.substring(slashpos+1)); - } - } - } - } - catch (Throwable e) { - //e.printStackTrace(); - } - } - - public static void putItem(Hashtable map, String parent, String child, int index) { - StringBuffer[] sbs = (StringBuffer[])map.get(parent); - if (sbs == null) { - sbs = new StringBuffer[] { new StringBuffer(256), // packages - new StringBuffer(256) // classes - }; - } - if (sbs[index].toString().indexOf("'" + child + "',") == -1) - sbs[index].append("'").append(child).append("',"); - map.put(parent, sbs); - } - - public static void AddToParent(Hashtable map, String parent, String child) { - putItem(map, parent, child, INDEX_PACKAGE); - - int slashpos = parent.lastIndexOf('/'); - if (slashpos != -1) { - AddToParent(map, parent.substring(0, slashpos), parent.substring(slashpos+1)); - } - } - - - public static String getClassInfo(String className) { - Hashtable mapClasses = new Hashtable(); - try { - Class clazz = Class.forName(className); - putClassInfo(mapClasses, clazz); - } - catch (Exception ex) { - } - - if (mapClasses.size() == 1) { - return mapClasses.get(className).toString(); // return {...} - } - else if (mapClasses.size() > 1) { - StringBuffer sb = new StringBuffer(4096); - sb.append("["); - for (Enumeration e = mapClasses.keys(); e.hasMoreElements(); ) { - String s = (String)e.nextElement(); - sb.append(mapClasses.get(s)).append(","); - } - sb.append("]"); - return sb.toString(); // return [...] - } - else - return ""; - } - - private static void putClassInfo(Hashtable map, Class clazz) { - if (map.containsKey(clazz.getName())) - return ; - - try { - StringBuffer sb = new StringBuffer(1024); - sb.append("{") - .append("'tag':'CLASSDEF',").append(NEWLINE) - .append("'flags':'").append(Integer.toString(clazz.getModifiers(), 2)).append("',").append(NEWLINE) - .append("'name':'").append(clazz.getName().replace('$', '.')).append("',").append(NEWLINE) - //.append("'package':'").append(clazz.getPackage().getName()).append("',").append(NEWLINE) // no getPackage() in JDK1.1 - .append("'classpath':'1',").append(NEWLINE) - .append("'fqn':'").append(clazz.getName().replace('$', '.')).append("',").append(NEWLINE); - - Class[] interfaces = clazz.getInterfaces(); - if (clazz.isInterface()) { - sb.append("'extends':["); - } else { - Class superclass = clazz.getSuperclass(); - if (superclass != null && !"java.lang.Object".equals(superclass.getName())) { - sb.append("'extends':['").append(superclass.getName().replace('$', '.')).append("'],").append(NEWLINE); - putClassInfo(map, superclass); // !! - } - sb.append("'implements':["); - } - for (int i = 0, n = interfaces.length; i < n; i++) { - sb.append("'").append(interfaces[i].getName().replace('$', '.')).append("',"); - putClassInfo(map, interfaces[i]); // !! - } - sb.append("],").append(NEWLINE);; - - Constructor[] ctors = clazz.getConstructors(); - sb.append("'ctors':["); - for (int i = 0, n = ctors.length; i < n; i++) { - Constructor ctor = ctors[i]; - sb.append("{"); - appendModifier(sb, ctor.getModifiers()); - appendParameterTypes(sb, ctor.getParameterTypes()); - sb.append(KEY_DESCRIPTION).append("'").append(ctors[i].toString()).append("'"); - sb.append("},").append(NEWLINE); - } - sb.append("], ").append(NEWLINE); - - Field[] fields = clazz.getFields(); - //java.util.Arrays.sort(fields, comparator); - sb.append("'fields':["); - for (int i = 0, n = fields.length; i < n; i++) { - Field f = fields[i]; - int modifier = f.getModifiers(); - sb.append("{"); - sb.append(KEY_NAME).append("'").append(f.getName()).append("',"); - if (!f.getDeclaringClass().getName().equals(clazz.getName())) - sb.append(KEY_DECLARING_CLASS).append("'").append(f.getDeclaringClass().getName()).append("',"); - appendModifier(sb, modifier); - sb.append(KEY_TYPE).append("'").append(f.getType().getName()).append("'"); - sb.append("},").append(NEWLINE); - } - sb.append("], ").append(NEWLINE); - - Method[] methods = clazz.getMethods(); - //java.util.Arrays.sort(methods, comparator); - sb.append("'methods':["); - for (int i = 0, n = methods.length; i < n; i++) { - Method m = methods[i]; - int modifier = m.getModifiers(); - sb.append("{"); - sb.append(KEY_NAME).append("'").append(m.getName()).append("',"); - if (!m.getDeclaringClass().getName().equals(clazz.getName())) - sb.append(KEY_DECLARING_CLASS).append("'").append(m.getDeclaringClass().getName()).append("',"); - appendModifier(sb, modifier); - sb.append(KEY_RETURNTYPE).append("'").append(m.getReturnType().getName()).append("',"); - appendParameterTypes(sb, m.getParameterTypes()); - sb.append(KEY_DESCRIPTION).append("'").append(m.toString()).append("'"); - sb.append("},").append(NEWLINE); - } - sb.append("], ").append(NEWLINE); - - Class[] classes = clazz.getClasses(); - sb.append("'classes': ["); - for (int i = 0, n = classes.length; i < n; i++) { - Class c = classes[i]; - sb.append("'").append(c.getName().replace('$', '.')).append("',"); - putClassInfo(map, c); // !! - } - sb.append("], ").append(NEWLINE); - - appendDeclaredMembers(map, clazz, sb); - - sb.append("}"); - map.put(clazz.getName(), sb); - } - catch (Exception ex) { - //ex.printStackTrace(); - } - } - - private static void appendDeclaredMembers(Hashtable map, Class clazz, StringBuffer sb) { - Constructor[] ctors = clazz.getDeclaredConstructors(); - sb.append("'declared_ctors':["); - for (int i = 0, n = ctors.length; i < n; i++) { - Constructor ctor = ctors[i]; - if (!Modifier.isPublic(ctor.getModifiers())) { - sb.append("{"); - appendModifier(sb, ctor.getModifiers()); - appendParameterTypes(sb, ctor.getParameterTypes()); - sb.append(KEY_DESCRIPTION).append("'").append(ctors[i].toString()).append("'"); - sb.append("},").append(NEWLINE); - } - } - sb.append("], ").append(NEWLINE); - - Field[] fields = clazz.getDeclaredFields(); - sb.append("'declared_fields':["); - for (int i = 0, n = fields.length; i < n; i++) { - Field f = fields[i]; - int modifier = f.getModifiers(); - if (!Modifier.isPublic(modifier)) { - sb.append("{"); - sb.append(KEY_NAME).append("'").append(f.getName()).append("',"); - if (!f.getDeclaringClass().getName().equals(clazz.getName())) - sb.append(KEY_DECLARING_CLASS).append("'").append(f.getDeclaringClass().getName()).append("',"); - appendModifier(sb, modifier); - sb.append(KEY_TYPE).append("'").append(f.getType().getName()).append("'"); - sb.append("},").append(NEWLINE); - } - } - sb.append("], ").append(NEWLINE); - - Method[] methods = clazz.getDeclaredMethods(); - sb.append("'declared_methods':["); - for (int i = 0, n = methods.length; i < n; i++) { - Method m = methods[i]; - int modifier = m.getModifiers(); - if (!Modifier.isPublic(modifier)) { - sb.append("{"); - sb.append(KEY_NAME).append("'").append(m.getName()).append("',"); - if (!m.getDeclaringClass().getName().equals(clazz.getName())) - sb.append(KEY_DECLARING_CLASS).append("'").append(m.getDeclaringClass().getName()).append("',"); - appendModifier(sb, modifier); - sb.append(KEY_RETURNTYPE).append("'").append(m.getReturnType().getName()).append("',"); - appendParameterTypes(sb, m.getParameterTypes()); - sb.append(KEY_DESCRIPTION).append("'").append(m.toString()).append("'"); - sb.append("},").append(NEWLINE); - } - } - sb.append("], ").append(NEWLINE); - - Class[] classes = clazz.getDeclaredClasses(); - sb.append("'declared_classes': ["); - for (int i = 0, n = classes.length; i < n; i++) { - Class c = classes[i]; - if (!Modifier.isPublic(c.getModifiers())) { - sb.append("'").append(c.getName().replace('$', '.')).append("',"); - putClassInfo(map, c); // !! - } - } - sb.append("], ").append(NEWLINE); - } - - private static void appendModifier(StringBuffer sb, int modifier) { - sb.append(KEY_MODIFIER).append("'").append(Integer.toString(modifier, 2)).append("', "); - } - - private static void appendParameterTypes(StringBuffer sb, Class[] paramTypes) { - if (paramTypes.length == 0) return ; - - sb.append(KEY_PARAMETERTYPES).append("["); - for (int j = 0; j < paramTypes.length; j++) { - sb.append("'").append(paramTypes[j].getName()).append("',"); - } - sb.append("],"); - } - - private static boolean isBlank(String str) { - int len; - if (str == null || (len = str.length()) == 0) - return true; - for (int i = 0; i < len; i++) - if ((Character.isWhitespace(str.charAt(i)) == false)) - return false; - return true; - } - - // test methods - - static void debug(String s) { - if (debug_mode) - System.out.println(s); - } - static void output(String s) { - if (!debug_mode) - System.out.print(s); - } - - - private static void usage() { - System.out.println("Reflection for javacomplete (" + VERSION + ")"); - System.out.println(" java [-classpath] Reflection [-c] [-d] [-e] [-h] [-v] [-p] [-s] name[,comma_separated_name_list]"); - System.out.println("Options:"); - System.out.println(" -a list all members in alphabetic order"); - System.out.println(" -c list constructors"); - System.out.println(" -C return class info"); - System.out.println(" -d default strategy, i.e. instance fields, instance methods, static fields, static methods"); - System.out.println(" -e check class existed"); - System.out.println(" -E check class existed and read class information"); - System.out.println(" -D debug mode"); - System.out.println(" -p list package content"); - System.out.println(" -P print all package info in the Vim dictionary format"); - System.out.println(" -s list static fields and methods"); - System.out.println(" -h help"); - System.out.println(" -v version"); - } - - public static void main(String[] args) { - String className = null; - int option = 0x0; - boolean wholeClassInfo = false; - boolean onlyStatic = false; - boolean onlyConstructor = false; - boolean listPackageContent = false; - boolean checkExisted = false; - boolean checkExistedAndRead = false; - boolean allPackageInfo = false; - - for (int i = 0, n = args.length; i < n && !isBlank(args[i]); i++) { - //debug(args[i]); - if (args[i].charAt(0) == '-') { - if (args[i].length() > 1) { - switch (args[i].charAt(1)) { - case 'a': - break; - case 'c': // request constructors - option = option | OPTION_CONSTRUCTOR; - onlyConstructor = true; - break; - case 'C': // class info - wholeClassInfo = true; - break; - case 'd': // default strategy - option = option | STRATEGY_DEFAULT; - break; - case 'D': // debug mode - debug_mode = true; - break; - case 'e': // class existed - checkExisted = true; - break; - case 'E': // check existed and read class information - checkExistedAndRead = true; - break; - case 'h': // help - usage(); - return ; - case 'v': // version - System.out.println("Reflection for javacomplete (" + VERSION + ")"); - break; - case 'p': - listPackageContent = true; - break; - case 'P': - option = RETURN_ALL_PACKAGE_INFO; - break; - case 's': // request static members - option = option | OPTION_STATIC_METHOD | OPTION_STATIC_FIELD; - onlyStatic = true; - break; - default: - } - } - } - else { - className = args[i]; - } - } - if (className == null && (option & RETURN_ALL_PACKAGE_INFO) != RETURN_ALL_PACKAGE_INFO) { - return; - } - if (option == 0x0) - option = OPTION_INSTANCE; - - if (wholeClassInfo) - output( getClassInfo(className) ); - else if ((option & RETURN_ALL_PACKAGE_INFO) == RETURN_ALL_PACKAGE_INFO) - output( getPackageList() ); - else if (checkExistedAndRead) - output( existedAndRead(className) ); - else if (checkExisted) - output( String.valueOf(existed(className)) ); - else if (listPackageContent) - output( getPackageList(className) ); - } -} diff --git a/home/.vim/autoload/java_parser.vim b/home/.vim/autoload/java_parser.vim deleted file mode 100644 index 5e1ec38..0000000 --- a/home/.vim/autoload/java_parser.vim +++ /dev/null @@ -1,3500 +0,0 @@ -" Vim autoload script for a JAVA PARSER and more. -" Language: Java -" Maintainer: cheng fang <fangread@yahoo.com.cn> -" Last Changed: 2007-09-16 -" Version: 0.67 -" Copyright: Copyright (C) 2007 cheng fang. All rights reserved. -" License: Vim License (see vim's :help license) - - -if exists("g:loaded_javaparser") || version < 700 || &cp - finish -endif -let g:loaded_javaparser = 'v0.67' - - -" Constants used by scanner and parser {{{1 -let s:EOI = '' - -let s:keywords = {'+': 'PLUS', '-': 'SUB', '!': 'BANG', '%': 'PERCENT', '^': 'CARET', '&': 'AMP', '*': 'STAR', '|': 'BAR', '~': 'TILDE', '/': 'SLASH', '>': 'GT', '<': 'LT', '?': 'QUES', ':': 'COLON', '=': 'EQ', '++': 'PLUSPLUS', '--': 'SUBSUB', '==': 'EQEQ', '<=': 'LTEQ', '>=': 'GTEQ', '!=': 'BANGEQ', '<<': 'LTLT', '>>': 'GTGT', '>>>': 'GTGTGT', '+=': 'PLUSEQ', '-=': 'SUBEQ', '*=': 'STAREQ', '/=': 'SLASHEQ', '&=': 'AMPEQ', '|=': 'BAREQ', '^=': 'CARETEQ', '%=': 'PERCENTEQ', '<<=': 'LTLTEQ', '>>=': 'GTGTEQ', '>>>=': 'GTGTGTEQ', '||': 'BARBAR', '&&': 'AMPAMP', 'abstract': 'ABSTRACT', 'assert': 'ASSERT', 'boolean': 'BOOLEAN', 'break': 'BREAK', 'byte': 'BYTE', 'case': 'CASE', 'catch': 'CATCH', 'char': 'CHAR', 'class': 'CLASS', 'const': 'CONST', 'continue': 'CONTINUE', 'default': 'DEFAULT', 'do': 'DO', 'double': 'DOUBLE', 'else': 'ELSE', 'extends': 'EXTENDS', 'final': 'FINAL', 'finally': 'FINALLY', 'float': 'FLOAT', 'for': 'FOR', 'goto': 'GOTO', 'if': 'IF', 'implements': 'IMPLEMENTS', 'import': 'IMPORT', 'instanceof': 'INSTANCEOF', 'int': 'INT', 'interface': 'INTERFACE', 'long': 'LONG', 'native': 'NATIVE', 'new': 'NEW', 'package': 'PACKAGE', 'private': 'PRIVATE', 'protected': 'PROTECTED', 'public': 'PUBLIC', 'return': 'RETURN', 'short': 'SHORT', 'static': 'STATIC', 'strictfp': 'STRICTFP', 'super': 'SUPER', 'switch': 'SWITCH', 'synchronized': 'SYNCHRONIZED', 'this': 'THIS', 'throw': 'THROW', 'throws': 'THROWS', 'transient': 'TRANSIENT', 'try': 'TRY', 'void': 'VOID', 'volatile': 'VOLATILE', 'while': 'WHILE', 'true': 'TRUE', 'false': 'FALSE', 'null': 'NULL', '(': 'LPAREN', ')': 'RPAREN', '{': 'LBRACE', '}': 'RBRACE', '[': 'LBRACKET', ']': 'RBRACKET', ';': 'SEMI', ',': 'COMMA', '.': 'DOT', 'enum': 'ENUM', '...': 'ELLIPSIS', '@': 'MONKEYS_AT'} - -let s:Flags = {'PUBLIC': 0x1, 'PRIVATE': 0x2, 'PROTECTED': 0x4, 'STATIC': 0x8, 'FINAL': 0x10, 'SYNCHRONIZED': 0x20, 'VOLATILE': 0x40, 'TRANSIENT': 0x80, 'NATIVE': 0x100, 'INTERFACE': 0x200, 'ABSTRACT': 0x400, 'STRICTFP': 0x800, 'SYNTHETIC': 0x1000, 'ANNOTATION': 0x2000, 'ENUM': 0x4000, 'StandardFlags':0x0fff, 'ACC_SUPER': 0x20, 'ACC_BRIDGE': 0x40, 'ACC_VARARGS': 0x80, 'DEPRECATED': 0x20000, 'HASINIT': 0x40000, 'BLOCK': 0x100000, 'IPROXY': 0x200000, 'NOOUTERTHIS': 0x400000, 'EXISTS': 0x800000, 'COMPOUND': 0x1000000, 'CLASS_SEEN': 0x2000000, 'SOURCE_SEEN': 0x4000000, 'LOCKED': 0x8000000, 'UNATTRIBUTED': 0x10000000, 'ANONCONSTR': 0x20000000, 'ACYCLIC': 0x40000000, 'BRIDGE': 1.repeat('0', 31), 'PARAMETER': 1.repeat('0', 33), 'VARARGS': 1.repeat('0', 34), 'ACYCLIC_ANN': 1.repeat('0', 35), 'GENERATEDCONSTR': 1.repeat('0', 36), 'HYPOTHETICAL': 1.repeat('0', 37), 'PROPRIETARY': 1.repeat('0', 38)} - -let s:RE_ANYTHING_AND_NEWLINE = '\(\(.\|\n\)*\)' -let s:RE_LINE_COMMENT = '//.*$' -let s:RE_COMMENT_SP = '/\*\*/' -let s:RE_COMMENT = '' -let s:RE_BRACKETS = '\(\s*\[\s*\]\)' - -let s:RE_IDENTIFIER = '[a-zA-Z_$][a-zA-Z0-9_$]*' -let s:RE_QUALID = s:RE_IDENTIFIER. '\(\s*\.\s*' .s:RE_IDENTIFIER. '\)*' -let s:RE_TYPE_NAME = s:RE_QUALID -let s:RE_REFERENCE_TYPE = s:RE_QUALID . s:RE_BRACKETS . '*' " TypeName || Type[] -let s:RE_TYPE = s:RE_REFERENCE_TYPE " PrimitiveType || ReferenceType -let s:RE_TYPE_VARIABLE = s:RE_IDENTIFIER -let s:RE_VAR_DECL_ID = s:RE_IDENTIFIER . s:RE_BRACKETS . '*' - -let s:RE_TYPE_PARAMS = '' - -let s:RE_THROWS = 'throws\s\+' . s:RE_TYPE_NAME . '\(\s*,\s*' . s:RE_TYPE_NAME . '\)*' -let s:RE_FORMAL_PARAM = '\(final\s*\)\='. s:RE_TYPE . '\s\+' . s:RE_VAR_DECL_ID -let s:RE_FORMAL_PARAM_LIST = s:RE_FORMAL_PARAM . '\(\s*,\s*' . s:RE_FORMAL_PARAM . '\)*' -let s:RE_FORMAL_PARAM2 = '^\s*\(final\s*\)\=\('. s:RE_TYPE . '\)\s\+\(' . s:RE_IDENTIFIER . '\)' . s:RE_BRACKETS . '*' - -let s:RE_MEMBER_MODS = '\%(PUBLIC\|PROTECTED\|PRIVATE\|ABSTRACT\|STATIC\|FINAL\|TRANSIENT\|VOLATILE\|SYNCHRONIZED\|NATIVE\|STRICTFP\)' -let s:RE_MEMBER_HEADER = '\s*\(\%(' .s:RE_MEMBER_MODS. '\s\+\)\+\)\(' .s:RE_IDENTIFIER. '\%(\s*\.\s*' .s:RE_IDENTIFIER. '\)*\%(\s*\[\s*\]\)*\)\s\+\(' .s:RE_IDENTIFIER. '\)' - -" API {{{1 - -let s:PROTOTYPE = {'s:options': {}, 'b:buf': '', 'b:buflen': 0, 'b:lines': [], 'b:idxes': [0], 'b:bp': -1, 'b:ch': '', 'b:line': 0, 'b:col': 0, 'b:pos': 0, 'b:endPos': 0, 'b:prevEndPos': 0, 'b:errPos': -1, 'b:errorEndPos': -1, 'b:sbuf': '', 'b:name': '', 'b:token': '', 'b:docComment': '', 'b:radix': 0, 'b:unicodeConversionBp': -1, 'b:scanStrategy': 0, 'b:allowGenerics': 1, 'b:allowVarargs': 1, 'b:allowAsserts': 1, 'b:allowEnums': 1, 'b:allowForeach': 1, 'b:allowStaticImport': 1, 'b:allowAnnotations': 1, 'b:keepDocComments': 1, 'b:mode': 0, 'b:lastmode': 0, 'b:log': [], 'b:et_perf': '', 'b:et_nextToken_count': 0} - -" Function to initialize the parser -" parameters: -" - lines List of code text -" - options A set of options -fu! java_parser#InitParser(lines, ...) - let s:options = a:0 == 0 ? {} : a:1 - - " internal variables for scanning -" let b:buf = '' " The input buffer - let b:buflen = 0 " index of one past last character in buffer. also eofPos - let b:lines = a:lines " The input buffer - let b:idxes = [0] " Begin index of every lines - let b:bp = -1 " index of next character to be read. - let b:ch = '' " The current character. - let b:line = 0 " The line number position of the current character. - let b:col = 0 " The column number position of the current character. - let b:pos = 0 " The token's position, 0-based offset from beginning of text. - let b:endPos = 0 " Character position just after the last character of the token. - let b:prevEndPos = 0 " The last character position of the previous token. - let b:errPos = -1 " The position where a lexical error occurred - let b:errorEndPos = -1 " - let b:sbuf = '' " A character buffer for literals. - let b:name = '' " The name of an identifier or token: - let b:token = 0 " The token, set by s:nextToken(). - let b:docComment = '' - let b:radix = 0 " The radix of a numeric literal token. - let b:unicodeConversionBp =-1 " The buffer index of the last converted unicode character - - let b:scanStrategy = get(s:options, 'scanStrategy', -1) " 0 - only class members when parse full file; - " 1 - keep statement as a whole string; - " 2 - all - " -1 - enable quick recognition of declarations in common form. - - " language feature options. - let b:allowGenerics = get(s:options, 'allowGenerics', 1) - let b:allowVarargs = get(s:options, 'allowVarargs', 1) - let b:allowAsserts = get(s:options, 'allowAsserts', 1) - let b:allowEnums = get(s:options, 'allowEnums', 1) - let b:allowForeach = get(s:options, 'allowForeach', 1) - let b:allowStaticImport = get(s:options, 'allowStaticImport', 1) - let b:allowAnnotations = get(s:options, 'allowAnnotations', 1) - let b:keepDocComments = get(s:options, 'keepDocComments', 1) - - let b:mode = 0 " The current mode. - let b:lastmode = 0 " The mode of the term that was parsed last. - - - let b:log = [] - - let b:et_perf = '' - let b:et_nextToken_count = 0 - -" let b:buf = join(a:lines, "\r") -" let b:buflen = strlen(b:buf) - for line in a:lines - let b:buflen += strlen(line) + 1 - call add(b:idxes, b:buflen) - endfor - call add(b:lines, s:EOI) " avoid 'list index out of range' error from lines[] in java_scanChar - " if b:bp >= b:buflen - " return s:EOI - " endif - - " initialize scanner - call s:scanChar() " be ready for scanning - call s:nextToken() " prime the pump -endfu - -fu! java_parser#FreeParser() - for varname in keys(s:PROTOTYPE) - exe "if exists(" . string(varname) . ") | unlet " . varname . " | endif" - endfor -endfu - -fu! java_parser#GetSnapshot() - let snapshot = {} - for varname in keys(s:PROTOTYPE) - exe "let snapshot[" . string(varname) . "] = " . varname - endfor - return snapshot -endfu - -fu! java_parser#Restore(snapshot) - for key in keys(a:snapshot) - exe "let " . key . "=" . string(a:snapshot[key]) - endfor -endfu - -" move b:bp and b:pos to the specified position -fu! java_parser#GotoPosition(pos) - let b:bp = a:pos-1 - let b:pos = a:pos - let p = java_parser#DecodePos(b:bp) - let b:line = p.line - let b:col = p.col - call s:scanChar() - call s:nextToken() -endfu - -fu! java_parser#compilationUnit() - return s:compilationUnit() -endfu - -fu! java_parser#block() - return s:block() -endfu - -fu! java_parser#statement() - return s:blockStatements() -endfu - -fu! java_parser#expression() - return s:expression() -endfu - -fu! java_parser#nextToken() - return s:nextToken() -endfu - - -" Tree {{{1 -let s:TTree = {'tag': '', 'pos': 0} " Root class for AST nodes. - -" Tree maker functions {{{2 -fu! s:ClassDef(pos, mods, ...) - return {'tag': 'CLASSDEF', 'pos': a:pos, 'mods': a:mods, 'name': ''} -endfu - -fu! s:VarDef(pos, mods, name, vartype) - return {'tag': 'VARDEF', 'pos': a:pos, 'mods': a:mods, 'name': a:name, 'vartype': a:vartype} -endfu - -fu! s:Unary(pos, opcode, arg) - return {'tag': a:opcode, 'pos': a:pos, 'arg': a:arg} -endfu - -fu! s:Binary(pos, opcode, lhs, rhs, ...) - return {'tag': a:opcode, 'pos': a:pos, 'lhs': a:lhs, 'rhs': a:rhs} -endfu - -fu! s:TypeCast(pos, clazz, expr) - return {'tag': 'TYPECAST', 'pos': a:pos, 'clazz': a:clazz, 'expr': a:expr} -endfu - -fu! s:Select(pos, selected, name) - return {'tag': 'SELECT', 'pos': a:pos, 'selected': a:selected, 'name': a:name} -endfu - -fu! s:Ident(pos, name) - return {'tag': 'IDENT', 'pos': a:pos, 'name': a:name} -endfu - -fu! s:TypeArray(pos, elementtype) - return {'tag': 'TYPEARRAY', 'pos': a:pos, 'elementtype': a:elementtype} -endfu - -fu! s:Modifiers(pos, flags, annotations) - let noFlags = s:BitAnd(a:flags, s:Flags.StandardFlags) == 0 - let mods = {'tag': 'MODIFIERS', 'flags': a:flags} - let mods.pos = noFlags && empty(a:annotations) ? -1 : a:pos - if !empty(a:annotations) - let mods.annotations = a:annotations - endif - return mods -endfu - - -" {{{2 -fu! java_parser#IsStatement(tree) - return has_key(a:tree, 'tag') && a:tree.tag =~# '^\(CLASSDEF\|VARDEF\|BLOCK\|IF\|DOLOOP\|WHILELOOP\|FORLOOP\|FOREACHLOOP\|SWITCH\|TRY\|EXEC\|LABELLED\|SYNCHRONIZED\|CASE\|BREAK\|RETURN\|SKIP\|THROW\|ASSERT\|CONTINUE\)$' -endfu - -" Tree Helper {{{1 -fu! java_parser#type2Str(type) - if type(a:type) == type("") - return a:type - endif - - let t = a:type - if t.tag == 'IDENTIFIER' - return t.value - elseif t.tag == 'IDENT' - return t.name - elseif t.tag == 'TYPEIDENT' - return t.typetag - elseif t.tag == 'SELECT' - return java_parser#type2Str(t.selected) . '.' . t.name - elseif t.tag == 'TYPEARRAY' - return java_parser#type2Str(t.elementtype) . '[]' - elseif t.tag == 'TYPEAPPLY' - return t.clazz.name - elseif t.tag == 'TEMPLATE' - let s = t.clazz.value . '<' - for arg in t.arguments - let s .= arg.value - endfor - let s .= '>' - return s - endif -endfu - -fu! s:vardef2Str(vardef) - return java_parser#type2Str(a:vardef.vartype) . ' ' . a:vardef.name -endfu - -fu! s:method2Str(methoddef) - let m = a:methoddef - let desc = m.r . ' ' . m.n . '(' - for item in m.params - let desc .= s:vardef2Str(item) . ',' - endfor - let desc = substitute(desc, ',$', '', '') - let desc .= ')' - return desc -endfu - -" Scanner {{{1 - -" nextToken() {{{2 -fu! s:nextToken() - let b:prevEndPos = b:endPos - let b:et_nextToken_count += 1 - let b:sbuf = '' - while 1 - let b:pos = b:bp - if b:ch =~ '[ \t\r\n]' " - FF - " OAO optimized code: skip spaces - let b:col = match(b:lines[b:line], '[^ \t\r\n]\|$', b:col) - let b:bp = b:idxes[b:line] + b:col - call s:scanChar() - let b:endPos = b:bp - continue - - elseif b:ch =~ '[a-zA-Z$_]' - " read a identifier - call s:scanIdent() - return - - elseif b:ch == '0' - call s:scanChar() - " hex - if b:ch == 'x' || b:ch == 'X' - call s:scanChar() - if b:ch == '.' - call s:scanHexFractionAndSuffix(0) - elseif s:isDigit(16) - call s:scanNumber(16) - else - call s:LexError("invalid.hex.number") - endif - " oct - else - let b:sbuf .= '0' - call s:scanNumber(8) - endif - return - - elseif b:ch =~ '[1-9]' - " read number - call s:scanNumber(10) - return - - elseif b:ch == '.' - call s:scanChar() - if b:ch =~ '[0-9]' - let b:sbuf .= '.' - call s:scanFractionAndSuffix() - " JAVA5 ELLIPSIS - elseif b:ch == '.' - let b:sbuf .= '..' - call s:scanChar() - if b:ch == '.' - call s:scanChar() - let b:sbuf .= '.' - let b:token = 'ELLIPSIS' - else - call s:LexError('malformed.fp.lit') - endif - else - let b:token = 'DOT' - endif - return - - elseif b:ch =~ '[,;(){}[\]]' - let b:token = s:keywords[b:ch] - call s:scanChar() - return - - elseif b:ch == '/' - let status = s:scanComment() - if status == 1 - continue - elseif status == 2 - return - elseif b:ch == '=' - let b:name = '/=' - let b:token = 'SLASHEQ' - call s:scanChar() - else - let b:name = '/' - let b:token = 'SLASH' - endif - return - - - elseif b:ch == "'" - call s:scanSingleQuote() - return - - elseif b:ch == '"' - call s:scanDoubleQuote() - return - - else - if s:IsSpecial(b:ch) - call s:scanOperator() - elseif b:ch =~ '[a-zA-Z_]' - call s:scanIdent() - elseif b:bp >= b:buflen - let b:token = 'EOF' - else - call s:LexError("illegal.char '" . b:ch . "'") - call s:scanChar() - endif - return - endif - endwhile -endfu - -" scanChar() Read next character. {{{2 -" one buf version -"fu! s:scanChar() -" let b:bp += 1 -" if b:bp % 256 == 0 -" let b:buf2 = strpart(b:buf, b:bp, 256) -" endif -" let b:ch = b:buf2[b:bp % 256] -"" let b:ch = b:buf[b:bp] " it will be extremely slow when buf is large -" "call s:Trace( "'" . b:ch . "'" ) -" -" if b:ch == "\r" -" let b:line += 1 -" let b:col = 0 -" elseif b:ch == "\n" -" if b:bp == 0 || b:buf[b:bp-1] == "\r" -" let b:line += 1 -" let b:col = 0 -" endif -" else -" let b:col += 1 -" endif -"endfu - -" Read next character. multiple lines version -fu! s:scanChar() - let b:bp+=1 - let b:ch=b:lines[b:line][b:col] - let b:col+=1 - if b:ch=='' - let b:ch="\r" - let b:line+=1 - let b:col=0 - endif - - if b:ch == '\' - call s:convertUnicode() - endif -endfu - -fu! java_parser#CharAt(line, col) - let ch=b:lines[a:line][a:col] - if ch == '' - let ch = "\r" - endif - return ch -endfu - -fu! s:convertUnicode() - if b:ch == '\' && b:unicodeConversionBp != b:bp - "if java_parser#CharAt(b:bp+1) == 'u' - "call s:scanChar() - "endif - endif -endfu - -" putChar() is substituted with -" let b:sbuf .= '.' - -" scanIdent() {{{2 -" OAO optimized code -fu! s:scanIdent() - let col_old = b:col - let b:col = match(b:lines[b:line], '[^a-zA-Z0-9$_]\|$', b:col) - let b:name = strpart(b:lines[b:line], col_old-1, b:col-col_old+1) - let b:token = get(s:keywords, b:name, 'IDENTIFIER') - call s:Debug('name: "' . b:name . '" of token type ' . b:token ) - let b:bp = b:idxes[b:line] + b:col - call s:scanChar() -endfu - -" Standard implementation -fu! s:scanIdent_old() - " do ... while () - let b:sbuf .= b:ch - call s:scanChar() - if b:ch !~ '[a-zA-Z0-9$_]' || b:bp >= b:buflen - let b:name = b:sbuf - let b:token = has_key(s:keywords, b:name) ? s:keywords[b:name] : 'IDENTIFIER' - call s:Debug('name: "' . b:name . '" of token type ' . b:token ) - return - endif - - while (1) - let b:sbuf .= b:ch - call s:scanChar() - if b:ch !~ '[a-zA-Z0-9$_]' || b:bp >= b:buflen - let b:name = b:sbuf - let b:token = has_key(s:keywords, b:name) ? s:keywords[b:name] : 'IDENTIFIER' - call s:Debug('name: "' . b:name . '" of token type ' . b:token ) - break - endif - endwhile -endfu - -" digit() {{{2 -" Convert an ASCII digit from its base (8, 10, or 16) to its value. -" NOTE: This only implement isdigit() check -fu! s:digit(base) - let c = b:ch - "let result = -endfu - -fu! s:isDigit(base) - if a:base == 8 - return b:ch =~ '[0-7]' - elseif a:base == 16 - return b:ch =~ '[0-9a-fA-F]' - elseif a:base == 10 - return b:ch =~ '[0-9]' - endif -endfu - -" scanNumber() {{{2 -fu! s:scanNumber(radix) - let b:radix = a:radix - let digitRadix = a:radix <= 10 ? 10 : 16 - let seendigit = 0 - while s:isDigit(a:radix) - let seendigit = 1 - let b:sbuf .= b:ch - call s:scanChar() - endwhile - if a:radix == 16 && b:ch == '.' - call s:scanHexFractionAndSuffix(seendigit) - elseif seendigit && a:radix == 16 && (b:ch == 'p' || b:ch == 'P') - call s:scanHexExponentAndSuffix() - elseif a:radix <= 10 && b:ch == '.' - let b:sbuf .= b:ch - call s:scanChar() - call s:scanFractionAndSuffix() - elseif a:radix <= 10 && b:ch =~ '[eEfFdD]' - call s:scanFractionAndSuffix() - else - if b:ch == 'l' || b:ch == 'L' - call s:scanChar() - let b:token = 'LONGLITERAL' - else - let b:token = 'INTLITERAL' - endif - endif -endfu - -fu! s:scanHexExponentAndSuffix() - if b:ch == 'p' || b:ch == 'P' - let b:sbuf .= b:ch - call s:scanChar() - if b:ch == '+' || b:ch == '-' - let b:sbuf .= b:ch - call s:scanChar() - endif - - if '0' <= b:ch && b:ch <= '9' - let b:sbuf .= b:ch - call s:scanChar() - while '0' <= b:ch && b:ch <= '9' - let b:sbuf .= b:ch - call s:scanChar() - endwhile - - "if !b:allowHexFloats - "elseif !b:hexFloatsWork - " call s:LexError("unsupported.cross.fp.lit") - "endif - else - call s:LexError("malformed.fp.lit") - endif - else - call s:LexError("malformed.fp.lit") - endif - - if b:ch == 'f' || b:ch == 'F' - let b:sbuf .= b:ch - call s:scanChar() - let b:token = 'FLOATLITERAL' - else - if b:ch == 'f' || b:ch == 'F' - let b:sbuf .= b:ch - call s:scanChar() - endif - let b:token = 'DOUBLELITERAL' - endif -endfu - -fu! s:scanFraction() - " scan fraction - while b:ch =~ '[0-9]' - let b:sbuf .= b:ch - call s:scanChar() - endwhile - - " floating point number - if b:ch == 'e' || b:ch == 'E' - let b:sbuf .= b:ch - call s:scanChar() - - if b:ch == '+' || b:ch == '-' - let b:sbuf .= b:ch - call s:scanChar() - endif - - if b:ch =~ '[0-9]' - let b:sbuf .= b:ch - call s:scanChar() - while b:ch =~ '[0-9]' - let b:sbuf .= b:ch - call s:scanChar() - endwhile - return - endif - - call s:LexError("malformed.fp.lit") - endif -endfu - -" Read fractional part and 'd' or 'f' suffix of floating point number. -fu! s:scanFractionAndSuffix() - call s:scanFraction() - if b:ch == 'f' || b:ch == 'F' - let b:sbuf .= b:ch - call s:scanChar() - let b:token = 'FLOATLITERAL' - else - if b:ch == 'd' || b:ch == 'D' - let b:sbuf .= b:ch - call s:scanChar() - endif - let b:token = 'DOUBLELITERAL' - endif -endfu - -fu! s:scanHexFractionAndSuffix(seendigit) - let seendigit = a:seendigit - let b:radix = 16 - if b:ch != '.' | echoerr "b:ch != '.'" | endif - - let b:sbuf .= b:ch - call s:scanChar() - while s:isDigit(16) - let seendigit = 1 - let b:sbuf .= b:ch - call s:scanChar() - endwhile - - if !seendigit - call s:LexError("invalid.hex.number") - else - call s:scanHexExponentAndSuffix() - endif -endfu - -" scanLitChar() {{{2 -fu! s:scanLitChar() - if b:ch == '\' - call s:scanChar() - if b:ch =~ '[0-7]' - let leadch = b:ch - let oct = b:ch - call s:scanChar() - if b:ch =~ '[0-7]' - let oct = oct * 8 + b:ch - call s:scanChar() - if leadch <= '3' && '0' <= b:ch && b:ch <= '7' - let oct = oct * 8 + b:ch - call s:scanChar() - endif - endif - let b:sbuf .= oct - - elseif b:ch == "'" || b:ch =~ '[btnfr"\\]' - let b:sbuf .= b:ch - call s:scanChar() - - " unicode escape - elseif b:ch == 'u' - while b:ch =~ '[a-zA-Z0-9]' - call s:scanChar() - endwhile - - else - call s:LexError("illegal.esc.char") - endif - - elseif b:bp < b:buflen - let b:sbuf .= b:ch - call s:scanChar() - endif -endfu - -" scanOperator() {{{2 -fu! s:scanOperator() - while 1 - if !has_key(s:keywords, b:sbuf . b:ch) - break - endif - - let b:sbuf .= b:ch - let b:token = get(s:keywords, b:sbuf, 'IDENTIFIER') - call s:Debug('sbuf: "' . b:sbuf . '" of token type ' . b:token ) - call s:scanChar() - if !s:IsSpecial(b:ch) - break - endif - endwhile -endfu - -" NOTE: add @ for JAVA5 -fu! s:IsSpecial(ch) - return a:ch =~ '[!%&*?+-:<=>^|~@]' -endfu - -" scan comment {{{2 -" return 0 - not comment, 1 - succeeded to scan comment, 2 - unclosed comment -fu! s:scanComment() - call s:scanChar() - " line comment - if b:ch == '/' - let b:token = 'LINECOMMENT' - call s:Info('line comment') - call s:SkipLineComment() - let b:endPos = b:bp - return 1 - - " classic comment - " test cases: /**/, /***/, /*******/, /*** astatement; /***/, /*/ - elseif b:ch == '*' - let b:token = 'BLOCKCOMMENT' - call s:Info('block comment') - call s:scanChar() - let time = reltime() - " javadoc - if b:ch == '*' - let b:docComment = s:scanDocComment() - " normal comment - else - call s:skipComment() - endif - let b:et_perf .= "\r" . 'comment ' . reltimestr(reltime(time)) - - if b:ch == '/' - call s:Info('end block comment') - call s:scanChar() - let b:endPos = b:bp - return 1 - else - call s:LexError('unclosed.comment') - return 2 - endif - endif - return 0 -endfu - -fu! s:SkipLineComment() - " OAO optimized code - let b:ch = "\r" - let b:line += 1 - let b:col = 0 - let b:bp = b:idxes[b:line] + b:col - - " OLD - "call s:scanChar() - "while (b:ch != "\r") - " call s:scanChar() - "endwhile -endfu - -fu! s:skipComment() - if b:ch == '*' - call s:scanChar() - if b:ch == '/' - return - else " NOTE: go back - let b:ch = '*' - let b:bp -= 1 - let b:col -= 1 - endif - endif - - " OAO optimized code - if s:Stridx('*/') > -1 - call s:scanChar() - endif - -" " Standard implementation -" while b:bp < b:buflen -" if b:ch == '*' -" call s:scanChar() -" if b:ch == '/' -" break -" endif -" else -" call s:scanChar() -" endif -" endwhile -endfu - -fu! s:scanDocComment() - call s:Info('It is javadoc') - return s:skipComment() - - " skip star '*' - while (b:bp < b:buflen && b:ch == '*') - call s:scanChar() - endwhile - - if b:bp < b:buflen && b:ch == '/' - return '' - endif - - let result = '' - while b:bp < b:buflen - if b:ch == '*' - call s:scanChar() - if b:ch == '/' - break - else - let result .= b:ch - endif - else - call s:scanChar() - let result .= b:ch - endif - endwhile - - return result -endfu - -" scan single quote {{{2 -fu! s:scanSingleQuote() - call s:scanChar() - if (b:ch == "'") - call s:LexError("empty.char.lit") - else - if (b:ch =~ '[\r\n]') - call s:LexError("illegal.line.end.in.char.lit") - endif - - call s:scanLitChar() - if b:ch == "'" - call s:scanChar() - let b:token = 'CHARLITERAL' - else - call s:LexError("unclosed.char.lit") - endif - endif -endfu - -" scan double quote {{{2 -" test cases: -" 'a"";' -" 'a"b,c";' -" 'a"b,\"c";' -" 'a"b,\\"c";' -" 'a"b,\\\"c";' -" 'a"b,\\\\"c";' -" 'a"b,\\\"c;' " NOTE: cannot handle -fu! s:scanDoubleQuote() - if match(b:lines[b:line], '\\"', b:col) == -1 - let idx = matchend(b:lines[b:line], '\(\\\(["\\''ntbrf]\)\|[^"]\)*"', b:col) - if idx != -1 - let b:sbuf = strpart(b:lines[b:line], b:col, idx-b:col-1) - let b:col = idx-1 " back to the end - let b:bp = b:idxes[b:line] + b:col - call s:scanChar() - let b:token = 'STRINGLITERAL' - else - call s:LexError("unclosed.str.lit") - endif - call s:scanChar() - return - endif - - - call s:scanChar() - while b:ch !~ '["\r\n]' && b:bp < b:buflen - call s:scanLitChar() - endwhile - - if b:ch == '"' - let b:token = 'STRINGLITERAL' - call s:scanChar() - else - call s:LexError("unclosed.str.lit") - endif -endfu - -" lex errors {{{2 -fu! s:LexError(key, ...) - let pos = a:0 == 0 ? b:pos : a:1 - let b:token = 'ERROR' - let b:errPos = pos - call s:Log(4, b:pos, '[lex error]:' . s:Pos2Str(pos) . ': ' . a:key) -endfu - -" Scanner Helper {{{1 -" gotoMatchEnd {{{2 -fu! s:gotoMatchEnd(one, another, ...) - while b:bp < b:buflen - if b:ch == a:another - call s:scanChar() - if has_key(s:keywords, a:another) - let b:token = s:keywords[a:another] - else - echoerr '<strange>' - endif - break - - elseif b:ch == a:one - call s:scanChar() - call s:gotoMatchEnd(a:one, a:another) - - " skip commment - elseif b:ch == '/' - call s:scanComment() - - " skip literal character - elseif b:ch == "'" - call s:scanSingleQuote() - - " skip literal string - elseif b:ch == '"' - call s:scanDoubleQuote() - - else - " OAO - call s:Match('[' . a:one . a:another . '/"'']') - " OLD - "call s:scanChar() - endif - endwhile - - " For such situation: after accept one token, the next token is just the same. - let nextTokenIsLBRACE = a:0 == 0 ? 0 : a:1 - if nextTokenIsLBRACE - call s:gotoMatchEnd(a:one, a:another) - endif - - return b:bp -endfu - -" gotoSemi {{{2 -fu! s:gotoSemi() - while b:bp < b:buflen - if b:ch == ';' - let b:pos = b:bp - call s:scanChar() - let b:token = 'SEMI' - return - - " skip commment - elseif b:ch == '/' - call s:scanComment() - - " skip literal character - elseif b:ch == "'" - call s:scanSingleQuote() - - " skip literal string - elseif b:ch == '"' - call s:scanDoubleQuote() - - elseif b:ch == '{' - call s:scanChar() - call s:gotoMatchEnd('{', '}') - - elseif b:ch == '(' - call s:scanChar() - call s:gotoMatchEnd('(', ')') - - elseif b:ch == '[' - call s:scanChar() - call s:gotoMatchEnd('[', ']') - - else - " OAO - call s:Match('[;({[/"'']') - " OLD - "call s:scanChar() - endif - endwhile -endfu - -" s:Strpart(), s:Stridx(), s:Match() {{{2 -fu! Strpart(start, len) - let startline = java_parser#DecodePos(a:start).line - let endline = java_parser#DecodePos(a:start + a:len).line - let str = join(b:lines[startline:endline-1]) . b:lines[endline] - return strpart(str, a:start-b:idxes[startline], a:len) -endfu - -fu! s:Stridx(needle) - let found = 0 - while b:line < len(b:lines)-1 - let idx = stridx(b:lines[b:line], a:needle, b:col) - if idx > -1 - let found = 1 - let b:col = idx - break - endif - let b:line += 1 - let b:col = 0 - endwhile - - if found - let b:bp = b:idxes[b:line] + b:col - call s:scanChar() - return b:bp - else - let b:bp = b:buflen - let b:ch = s:EOI - return -1 - endif -endfu - -fu! s:Match(pat) - let bp_old = b:bp - let line_old = b:line - let col_old = b:col - - let found = 0 - while b:line < len(b:lines)-1 - let idx = match(b:lines[b:line], a:pat, b:col) - if idx > -1 - let found = 1 - let b:col = idx - break - endif - let b:line += 1 - let b:col = 0 - endwhile - - if found - let b:bp = b:idxes[b:line] + b:col-1 - call s:scanChar() - return b:bp - else - let b:bp = bp_old - let b:line = line_old - let b:col = col_old - call s:scanChar() - return -1 - endif -endfu - - -" conversion between position and (line, col) {{{2 -fu! java_parser#MakePos(line, col) - return b:idxes[a:line] + a:col -endfu - -fu! java_parser#DecodePos(pos) - let line = -1 - for idx in b:idxes - if idx > a:pos - break - endif - let line += 1 - endfor - let col = a:pos - b:idxes[line] - return {'line': line, 'col': col} -endfu - -fu! s:Pos2Str(pos) - let o = java_parser#DecodePos(a:pos) - return '(' . (o.line+1) . ',' . (o.col+1) . ')' -endfu - -" Bitwise operator emulators {{{1 -" NOTE: For more than 32 bit number, use the string bits form. - -" bit operator ~ -fu! s:BitNot(v) - return s:Bits2Number( s:BitNot_binary(s:Number2Bits(a:v)) ) -endfu - -fu! s:BitNot_binary(v) - let v = substitute(a:v, '^0*\([01]\+\)', '\1', 'g') - let v = substitute(v, '1', '2', 'g') - let v = substitute(v, '0', '1', 'g') - let v = substitute(v, '2', '0', 'g') - return v -endfu - -" bit operator & -fu! s:BitAnd(n1, n2) - if a:n1 == 0 || a:n2 == 0 | return 0 | endif - if a:n1 == a:n2 | return 1 | endif - return s:Bits2Number( s:BitOperator_binary(s:Number2Bits(a:n1), s:Number2Bits(a:n2), 'n1[i] == "1" && n2[i] == "1"') ) -endfu - -" bit operator | -fu! s:BitOr(n1, n2, ...) - if a:0 == 0 - if a:n1 == 0 - return a:n2 - elseif a:n2 == 0 - return a:n1 - endif - endif - let result = s:BitOperator_binary(s:Number2Bits(a:n1), s:Number2Bits(a:n2), 'n1[i] == "1" || n2[i] == "1"') - for a in a:000 - let result = s:BitOperator_binary(result, s:Number2Bits(a), 'n1[i] == "1" || n2[i] == "1"') - endfor - return s:Bits2Number( result ) -endfu - -" bit operator ^ -fu! s:BitXor(n1, n2) - if a:n1 == a:n2 | return 0 | endif - return s:Bits2Number( s:BitOperator_binary(s:Number2Bits(a:n1), s:Number2Bits(a:n2), 'n1[i] != n2[i]') ) -endfu - -fu! s:BitOperator_binary(n1, n2, comparator) - let n1 = a:n1 - let n2 = a:n2 - - let len1 = len(n1) - let len2 = len(n2) - let len = len1 - if len1 > len2 - let n2 = repeat('0', len1-len2) . n2 - else - let len = len2 - let n1 = repeat('0', len2-len1) . n1 - endif - - let i = 0 - let bits = '' - while i < len - let bits .= eval(a:comparator) ? '1' : '0' - let i += 1 - endwhile - return bits -endfu - -" bit operator << -fu! s:BitMoveLeft() -endfu - -" bit operator >> -fu! s:BitMoveRight() -endfu - -" helper function: convert a number to a string consisted of '0' or '1' indicating number -fu! s:Number2Bits(n, ...) - if type(a:n) == type("") | return a:n | endif - if a:n == 0 | return '0' | endif - - let n = a:n - let bits = '' - while n != 0 - let bit = n % 2 - "echo 'n: ' . n . ' bit: ' . bit - let bits = bit . bits - let n = (n-bit)/ 2 - endwhile - if a:0 > 0 - let bits = repeat(a:1 - len(bits)) . bits - endif - return bits -endfu - -" helper function: convert a string consisted of '0' or '1' indicating number to a number -" precondition: bits must not be empty string -fu! s:Bits2Number(bits) - let len = len(a:bits) - let n = a:bits[0] - let i = 1 - while i < len - let n = n * 2 + a:bits[i] - let i += 1 - endwhile - return n -endfu - - -let s:modifier_keywords = ['strictfp', 'abstract', 'interface', 'native', 'transient', 'volatile', 'synchronized', 'final', 'static', 'protected', 'private', 'public'] -fu! s:String2Flags(str) - let mod = [0,0,0,0,0,0,0,0,0,0,0,0,] - for item in split(a:str, '\s\+') - if index(s:modifier_keywords, item) != -1 - let mod[index(s:modifier_keywords, item)] = '1' - endif - endfor - return join(mod[index(mod, '1'):], '') -endfu - -" Log utilities {{{1 -" level -" 5 off/fatal -" 4 error -" 3 warn -" 2 info -" 1 debug -" 0 trace -fu! java_parser#SetLogLevel(level) - let b:loglevel = a:level -endfu - -fu! java_parser#GetLogLevel() - return exists('b:loglevel') ? b:loglevel : 3 -endfu - -fu! java_parser#GetLogContent() - return b:log -endfu - -fu! s:Trace(msg) - call s:Log(0, b:pos, a:msg) -endfu - -fu! s:Debug(msg) - call s:Log(1, b:pos, a:msg) -endfu - -fu! s:Info(msg) - call s:Log(2, b:pos, a:msg) -endfu - -fu! s:Log(level, pos, key, ...) - if a:level >= java_parser#GetLogLevel() - echo a:key - call add(b:log, a:key) - endif -endfu - -fu! s:ShowWatch(...) - let at = a:0 > 0 ? a:1 : '' - echo '-- b:bp ' . b:bp . string(java_parser#DecodePos(b:bp)) . ' b:ch "' . b:ch . '" b:name ' . b:name . ' b:token ' . b:token . ' b:pos ' .b:pos . ' endPos ' . b:endPos . ' prevEndPos ' . b:prevEndPos . ' errPos ' . b:errPos . ' errorEndPos ' . b:errorEndPos . at -endfu - -fu! java_parser#Exe(cmd) - exe a:cmd -endfu - -" Parser {{{1 -" skip() Skip forward until a suitable stop token is found. {{{2 -fu! s:skip(stopAtImport, stopAtMemberDecl, stopAtIdentifier, stopAtStatement) - while 1 - if b:token == 'SEMI' - call s:nextToken() - return - elseif b:token =~# '^\(PUBLIC\|FINAL\|ABSTRACT\|MONKEYS_AT\|EOF\|CLASS\|INTERFACE\|ENUM\)$' - return - elseif b:token == 'IMPORT' - if a:stopAtImport - return - endif - elseif b:token =~# '^\(LBRACE\|RBRACE\|PRIVATE\|PROTECTED\|STATIC\|TRANSIENT\|NATIVE\|VOLATILE\|SYNCHRONIZED\|STRICTFP\|LT\|BYTE\|SHORT\|CHAR\|INT\|LONG\|FLOAT\|DOUBLE\|BOOLEAN\|VOID\)$' - if a:stopAtMemberDecl - return - endif - elseif b:token == 'IDENTIFIER' - if a:stopAtIdentifier - return - endif - elseif b:token =~# '^\(CASE\|DEFAULT\|IF\|FOR\|WHILE\|DO\|TRY\|SWITCH\|RETURN\|THROW\|BREAK\|CONTINUE\|ELSE\|FINALLY\|CATCH\)$' - if a:stopAtStatement - return - endif - endif - call s:nextToken() - endwhile -endfu - -" syntax errors {{{2 -fu! s:SyntaxError(key, ...) - let pos = a:0 == 0 ? b:pos : a:1 - let errs = a:0 > 1 ? a:2 : [] - call s:setErrorEndPos(pos) - call s:ReportSyntaxError(pos, a:key) - return {'tag': 'ERRONEOUS', 'pos': pos, 'errs': errs} -endfu - -fu! s:ReportSyntaxError(pos, key, ...) - if a:pos > b:errPos || a:pos == -1 - let key = a:key . (b:token == 'EOF' ? ' and premature.eof' : '') - call s:Log(4, a:pos, '[syntax error]' . s:Pos2Str(a:pos) . ': ' . key) - endif - let b:errPos = a:pos -endfu - -" accept() {{{2 -fu! s:accept(token_type) - "call s:Debug(b:token . ' == ' . a:token_type . (b:token == a:token_type)) - if b:token == a:token_type - call s:nextToken() - else - call s:setErrorEndPos(b:pos) - call s:ReportSyntaxError(b:prevEndPos, s:token2string(a:token_type) . " expected") - "call s:nextToken() - endif -endfu - -fu! s:token2string(token) - if a:token =~# '^\(DOT\|COMMA\|SEMI\|LPAREN\|RPAREN\|LBRACKET\|RBRACKET\|LBRACE\|RBRACE\)$' - return "'" . a:token . "'" - endif - return a:token -endfu - - -" illegal() {{{2 -fu! s:illegal(...) - call s:setErrorEndPos(b:pos) - return s:SyntaxError(s:modeAndEXPR() ? 'illegal.start.of.expr' : 'illegal.start.of.type', a:0 == 0 ? b:pos : a:1) -endfu - -" setErrorEndPos() {{{2 -fu! s:setErrorEndPos(errPos) - if a:errPos > b:errorEndPos - let b:errorEndPos = a:errPos - endif -endfu - -" ident() {{{2 -" Ident = IDENTIFIER -fu! s:ident() - call s:Trace('s:ident ' . b:token) - - if b:token == 'IDENTIFIER' - let name = b:name - call s:nextToken() - return name - - elseif b:token == 'ASSERT' - if s:allowAsserts - call s:Log(4, b:pos, 'assert.as.identifier') - call s:nextToken() - return '<error>' - else - call s:Log(3, b:pos, 'assert.as.identifier') - let name = b:name - call s:nextToken() - return name - endif - - elseif b:token == 'ENUM' - if b:allowEnums - call s:Log(4, b:pos, 'enum.as.identifier') - call s:nextToken() - return '<error>' - else - call s:Log(3, b:pos, 'enum.as.identifier') - let name = b:name - call s:nextToken() - return name - endif - - else - call s:accept('IDENTIFIER') - return '<error>' - endif -endfu - -" qualident() {{{2 -" Qualident = Ident { DOT Ident } -fu! s:qualident() - let t = s:Ident(b:pos, s:ident()) - while b:token == 'DOT' - let pos = b:pos - call s:nextToken() - let t = s:Select(b:pos, t, s:ident()) - "let t.name .= '.' . s:ident() " FIXME - endwhile - return t -endfu - -" literal() {{{2 -" Literal = INTLITERAL | LONGLITERAL | FLOATLITERAL | DOUBLELITERAL | CHARLITERAL | STRINGLITERAL | TRUE | FALSE | NULL -fu! s:literal(prefix) - let t = {'tag': 'LITERAL', 'pos': b:pos} - if b:token == 'INTLITERAL' - let t.typetag = 'INT' - let t.value = b:sbuf - elseif b:token == 'LONGLITERAL' - let t.typetag = 'LONG' - let t.value = b:sbuf - elseif b:token == 'FLOATLITERAL' - let t.typetag = 'FLOAT' - let t.value = b:sbuf - elseif b:token == 'DOUBLELITERAL' - let t.typetag = 'DOUBLE' - let t.value = b:sbuf - elseif b:token == 'CHARLITERAL' - let t.typetag = 'CHAR' - let t.value = b:sbuf - elseif b:token == 'STRINGLITERAL' - let t.typetag = 'CLASS' - let t.value = b:sbuf - elseif b:token == 'TRUE' - let t.typetag = 'BOOLEAN' - let t.value = 1 - elseif b:token == 'FALSE' - let t.typetag = 'BOOLEAN' - let t.value = 0 - elseif b:token == 'NULL' - let t.typetag = 'BOT' - let t.value = 'null' - else - echoerr 'can not reach here' - endif - call s:nextToken() - return t -endfu - -" {{{2 -" terms, expression, type {{{2 -" When terms are parsed, the mode determines which is expected: -" mode = EXPR : an expression -" mode = TYPE : a type -" mode = NOPARAMS : no parameters allowed for type -" mode = TYPEARG : type argument -let s:EXPR = 1 -let s:TYPE = 2 -let s:NOPARAMS = 4 -let s:TYPEARG = 8 -let s:EXPR_OR_TYPE = 3 -let s:EXPR_OR_TYPE_OR_NOPARAMS = 7 -let s:TYPEARG_OR_NOPARAMS = 12 - -fu! s:modeAndEXPR() - return b:mode % 2 -endfu - -fu! s:modeAndTYPE() - return s:BitAnd(b:mode, s:TYPE) -endfu - -" terms can be either expressions or types. -fu! s:expression() - return s:term(s:EXPR) -endfu - -fu! s:type() - return s:term(s:TYPE) -endfu - -fu! s:typeList() - let ts = [] - call add(ts, s:type()) - while b:token == 'COMMA' - call s:nextToken() - call add(ts, s:type()) - endwhile - return ts -endfu - -" Expression = Expression1 [ExpressionRest] -" ExpressionRest = [AssignmentOperator Expression1] -" AssignmentOperator = "=" | "+=" | "-=" | "*=" | "/=" | "&=" | "|=" | "^=" | -" "%=" | "<<=" | ">>=" | ">>>=" -" Type = Type1 -" TypeNoParams = TypeNoParams1 -" StatementExpression = Expression -" ConstantExpression = Expression -fu! s:term(...) - let prevmode = b:mode - let b:mode = a:0 == 0 ? b:mode : a:1 - - let t = s:term1() - if s:modeAndEXPR() && b:token == 'EQ' || b:token =~# '^\(PLUSEQ\|SUBEQ\|STAREQ\|SLASHEQ\|AMPEQ\|BAREQ\|CARETEQ\|PERCENTEQ\|LTLTEQ\|GTGTEQ\|GTGTGTEQ\)$' - let t = s:termRest(t) - endif - - let b:lastmode = b:mode - let b:mode = prevmode - return t -endfu - -fu! s:termRest(t) - if b:token == 'EQ' - let pos = b:pos - call s:nextToken() - let b:mode = s:EXPR - return {'tag': 'ASSIGN', 'pos': pos, 'lhs': a:t, 'rhs': s:term()} - - elseif b:token =~# '^\(PLUSEQ\|SUBEQ\|STAREQ\|SLASHEQ\|PERCENTEQ\|AMPEQ\|BAREQ\|CARETEQ\|LTLTEQ\|GTGTEQ\|GTGTGTEQ\)$' - let pos = b:pos - let token = b:token - call s:nextToken() - let b:mode = s:EXPR - return {'tag': s:optag(token), 'pos': pos, 'lhs': a:t, 'rhs': s:term()} - - else - return a:t - endif -endfu - -" Expression1 = Expression2 [Expression1Rest] -" Type1 = Type2 -" TypeNoParams1 = TypeNoParams2 -fu! s:term1() - let t = s:term2() - if s:modeAndEXPR() && b:token == 'QUES' - let b:mode = s:EXPR - return s:term1Rest(t) - else - return t - endif -endfu - -" Expression1Rest = ["?" Expression ":" Expression1] -fu! s:term1Rest(t) - if b:token == 'QUES' - let t = {'tag': 'CONDEXPR', 'pos': b:pos, 'cond': a:t} - call s:nextToken() - let t.truepart = s:term() - call s:accept('COLON') - let t.falsepart = s:term1() - return t - else - return a:t - endif -endfu - -" Expression2 = Expression3 [Expression2Rest] -" Type2 = Type3 -" TypeNoParams2 = TypeNoParams3 -fu! s:term2() - let t = s:term3() - if s:modeAndEXPR() && s:prec(b:token) >= s:opprecedences.orPrec - let b:mode = s:EXPR - return s:term2Rest(t, s:opprecedences.orPrec) - else - return t - endif -endfu - -" Expression2Rest = {infixop Expression3} -"" | Expression3 instanceof Type -" infixop = "||" -" | "&&" -" | "|" -" | "^" -" | "&" -" | "==" | "!=" -" | "<" | ">" | "<=" | ">=" -" | "<<" | ">>" | ">>>" -" | "+" | "-" -" | "*" | "/" | "%" -fu! s:term2Rest(t, minprec) - let odStack = [a:t] " for expressions - let opStack = [] " for tokens - let top = 0 - let startPos = b:pos - let topOp = 'ERROR' - while s:prec(b:token) >= a:minprec - call add(opStack, topOp) - let top += 1 - let topOp = b:token - let pos = b:pos - call s:nextToken() - call add(odStack, topOp == 'INSTANCEOF' ? s:type() : s:term3()) - while top > 0 && s:prec(topOp) >= s:prec(b:token) - let odStack[top-1] = s:makeOp(pos, topOp, odStack[top-1], odStack[top]) - let top -= 1 - let topOp = opStack[top] - endwhile - endwhile - "assert top == 0 - let t = odStack[0] - - if t.tag == 'PLUS' - let buf = s:foldStrings(t) - if buf != '' - let t = {'tag': 'LITERAL', 'pos': startPos, 'typetag': 'CLASS', 'value': t} - endif - endif - return t -endfu - -fu! s:makeOp(pos, topOp, od1, od2) - if a:topOp == 'INSTANCEOF' - return {'tag': 'TYPETEST', 'pos': a:pos, 'expr': a:od1, 'clazz': a:od2} - else - return s:Binary(a:pos, s:optag(a:topOp), a:od1, a:od2) - endif -endfu - -fu! s:foldStrings(tree) - let tree = a:tree - let buf = '' - while 1 - if tree.tag == 'LITERAL' - let lit = tree - if lit.typetag == 'CLASS' - let sbuf = lit.value - if buf != '' - let sbuf .= buf - endif - return sbuf - endif - elseif tree.tag == 'PLUS' - let op = tree - if op.rhs.tag == 'LITERAL' - let lit = op.rhs - if lit.typetag == 'CLASS' - let buf = lit.value . buf - let tree = op.lhs - continue - endif - endif - endif - return '' - endwhile -endfu - -" Expression3 = PrefixOp Expression3 {{{2 -" | "(" Expr | TypeNoParams ")" Expression3 -" | Primary {Selector} {PostfixOp} -" Primary = "(" Expression ")" -" | Literal -" | [TypeArguments] THIS [Arguments] -" | [TypeArguments] SUPER SuperSuffix -" | NEW [TypeArguments] Creator -" | Ident { "." Ident } -" [ "[" ( "]" BracketsOpt "." CLASS | Expression "]" ) -" | Arguments -" | "." ( CLASS | THIS | [TypeArguments] SUPER Arguments | NEW [TypeArguments] InnerCreator ) -" ] -" | BasicType BracketsOpt "." CLASS -" PrefixOp = "++" | "--" | "!" | "~" | "+" | "-" -" PostfixOp = "++" | "--" -" Type3 = Ident { "." Ident } [TypeArguments] {TypeSelector} BracketsOpt -" | BasicType -" TypeNoParams3 = Ident { "." Ident } BracketsOpt -" Selector = "." [TypeArguments] Ident [Arguments] -" | "." THIS -" | "." [TypeArguments] SUPER SuperSuffix -" | "." NEW [TypeArguments] InnerCreator -" | "[" Expression "]" -" TypeSelector = "." Ident [TypeArguments] -" SuperSuffix = Arguments | "." Ident [Arguments] -" NOTE: We need only type expression. -fu! s:term3() - let pos = b:pos - let t = copy(s:TTree) - - call s:Debug('term3() b:token is ' . b:token) - let typeArgs = s:typeArgumentsOpt(s:EXPR) - - if b:token == 'QUES' - if s:modeAndTYPE() && s:BitAnd(b:mode, s:TYPEARG_OR_NOPARAMS) == s:TYPEARG - let b:mode = s:TYPE - return s:typeArgument() - else - return s:illegal() - endif - - elseif b:token =~# '^\(PLUSPLUS\|SUBSUB\|BANG\|TILDE\|PLUS\|SUB\)$' - if typeArgs == [] && s:modeAndEXPR() - let token = b:token - call s:nextToken() - let b:mode = s:EXPR - if token == 'SUB' && (b:token == 'INTLITERAL' || b:token == 'LONGLITERAL') && b:radix == 10 - let b:mode = s:EXPR - let t = s:literal('-') - else - let t = s:term3() - return s:Unary(pos, s:unoptag(token), t) - endif - else - return s:illegal() - endif - - elseif b:token == 'LPAREN' - if typeArgs == [] && s:modeAndEXPR() - call s:nextToken() - let b:mode = s:EXPR_OR_TYPE_OR_NOPARAMS - let t = s:term3() - if s:modeAndEXPR() && b:token == 'LT' - let op = 'LT' - let pos1 = b:pos - call s:nextToken() - let b:mode = s:BitAnd(b:mode, s:EXPR_OR_TYPE) - let b:mode = s:BitOr(b:mode, s:TYPEARG) - let t1 = s:term3() - if s:modeAndTYPE() && (b:token == 'COMMA' || b:token == 'GT') - let b:mode = s:TYPE - let args = [] - call add(args, t1) - while b:token == 'COMMA' - call s:nextToken() - call add(args, s:typeArgument()) - endwhile - call s:accept('GT') - let t = {'tag': 'TYPEAPPLY', 'pos': pos1, 'clazz': t, 'arguments': args} - " checkGenerics - let t = s:bracketsOpt(t) - elseif s:modeAndEXPR() - let b:mode = s:EXPR - let t = s:Binary(pos1, op, t, s:term2Rest(t1, s:opprecedences.shiftPrec)) - let t = s:termRest(s:term1Rest(s:term2Rest(t, s:opprecedences.orPrec))) - else - call s:accept('GT') - endif - else - let t = s:termRest(s:term1Rest(s:term2Rest(t, s:opprecedences.orPrec))) - endif - call s:accept('RPAREN') - let b:lastmode = b:mode - let b:mode = s:EXPR - if s:BitAnd(b:lastmode, s:EXPR) == 0 - return s:TypeCast(pos, t, s:term3()) - elseif s:BitAnd(b:lastmode, s:TYPE) != 0 - if b:token =~# '^\(BANG\|TILDE\|LPAREN\|THIS\|SUPER\|INTLITERAL\|LONGLITERAL\|FLOATLITERAL\|DOUBLELITERAL\|CHARLITERAL\|STRINGLITERAL\|TRUE\|FALSE\|NULL\|NEW\|IDENTIFIER\|ASSERT\|ENUM\|BYTE\|SHORT\|CHAR\|INT\|LONG\|FLOAT\|DOUBLE\|BOOLEAN\|VOID\)$' - return s:TypeCast(pos, t, s:term3()) - endif - endif - else - return s:illegal() - endif - let t = {'tag': 'PARENS', 'pos': pos, 'expr': t} - - elseif b:token == 'THIS' - if s:modeAndEXPR() - let b:mode = s:EXPR - let t = s:Ident(pos, 'this') - call s:nextToken() - if typeArgs == [] - let t = s:argumentsOpt([], t) - else - let t = s:arguments(typeArgs, t) - endif - let typeArgs = [] - else - return s:illegal() - endif - - elseif b:token == 'SUPER' - if s:modeAndEXPR() - let b:mode = s:EXPR - let t = s:superSuffix(typeArgs, s:Ident(pos, 'super')) - let typeArgs = [] - else - return s:illegal() - endif - - elseif b:token =~# '^\(INTLITERAL\|LONGLITERAL\|FLOATLITERAL\|DOUBLELITERAL\|CHARLITERAL\|STRINGLITERAL\|TRUE\|FALSE\|NULL\)$' - if typeArgs == [] && s:modeAndEXPR() - let b:mode = s:EXPR - let t = s:literal('') - else - return s:illegal() - endif - - elseif b:token == 'NEW' - if typeArgs != [] - return s:illegal() - endif - - if s:modeAndEXPR() - let b:mode = s:EXPR - call s:nextToken() - if b:token == 'LT' - let typeArgs = s:typeArguments() - endif - let t = s:creator(pos, typeArgs) - let typeArgs = [] - else - return s:illegal() - endif - - elseif b:token =~# '^\(IDENTIFIER\|ASSERT\|ENUM\)$' - if typeArgs != [] - return s:illegal() - endif - - let t = s:Ident(pos, s:ident()) - while 1 - if b:token == 'LBRACKET' - "let t.value = '[' " FIXME - call s:nextToken() - if b:token == 'RBRACKET' - "let t.value .= ']' - call s:nextToken() - let t = s:bracketsSuffix(s:TypeArray(pos, s:bracketsOpt(t))) - else - if s:modeAndEXPR() - let b:mode = s:EXPR - let t = {'tag': 'INDEXED', 'pos': pos, 'indexed': t, 'index': s:term()} - endif - call s:accept('RBRACKET') - "let t.value .= ']' - endif - break - - elseif b:token == 'LPAREN' - if s:modeAndEXPR() - let b:mode = s:EXPR - let t = s:arguments(typeArgs, t) - let typeArgs = [] - "call s:accept('LPAREN') - "call s:gotoMatchEnd('(', ')', b:token == 'LPAREN') - "call s:accept('RPAREN') - endif - break - - elseif b:token == 'DOT' - call s:nextToken() - let typeArgs = s:typeArgumentsOpt(s:EXPR) - if s:modeAndEXPR() - if b:token == 'CLASS' || b:token == 'THIS' - if typeArgs != [] - return s:illegal() - endif - let b:mode = s:EXPR - let t = s:Select(pos, t, b:token == 'CLASS' ? 'class' : 'this') - call s:nextToken() - break - elseif b:token == 'SUPER' - let b:mode = s:EXPR - let t = s:Select(pos, t, 'super') - let t = s:superSuffix(typeArgs, t) - let typeArgs = [] - break - elseif b:token == 'NEW' - if typeArgs != [] - return s:illegal() - endif - let b:mode = s:EXPR - let pos1 = b:pos - call s:nextToken() - if b:token == 'LT' - let typeArgs = s:typeArguments() - endif - let t = s:innerCreator(pos1, typeArgs, t) - let typeArgs = [] - break - endif - endif - let t = s:Select(pos, t, s:ident()) - else - break - endif - endwhile - if typeArgs != [] | call s:illegal() | endif - let t = s:typeArgumentsOpt2(t) - - elseif b:token =~# '^\(BYTE\|SHORT\|CHAR\|INT\|LONG\|FLOAT\|DOUBLE\|BOOLEAN\)$' - if typeArgs != [] | call s:illegal() | endif - let t = s:bracketsSuffix(s:bracketsOpt(s:basicType())) - - elseif b:token == 'VOID' - if typeArgs != [] | call s:illegal() | endif - if s:modeAndEXPR() - call s:nextToken() - if b:token == 'DOT' - let ti = {'tag': 'TYPEIDENT', 'pos': pos, 'typetag': 'void'} " FIXME - let t = s:bracketsSuffix(ti) - else - return s:illegal(pos) - endif - else - return s:illegal() - endif - - else - return s:illegal() - endif - - if typeArgs != [] - return s:illegal() - endif - - while 1 - let pos1 = b:pos - if b:token == 'LBRACKET' - call s:nextToken() - if s:modeAndEXPR() - let oldmode = b:mode - let b:mode = s:TYPE - if b:token == 'RBRACKET' - call s:nextToken() - let t = s:bracketsOpt(t) - let t = s:TypeArray(pos1, t) - return t - endif - let b:mode = oldmode - endif - if s:modeAndEXPR() - let b:mode = s:EXPR - let t = {'tag': 'INDEXED', 'pos': pos1, 'indexed': t, 'index': s:term()} - endif - call s:accept('RBRACKET') - - elseif b:token == 'DOT' - call s:nextToken() - let typeArgs = s:typeArgumentsOpt(s:EXPR) - if b:token == 'SUPER' && s:modeAndEXPR() - let b:mode = s:EXPR - let t = s:Select(pos1, t, 'super') - call s:nextToken() - let t = s:arguments(typeArgs, t) - let typeArgs = [] - elseif b:token == 'NEW' && s:modeAndEXPR() - if typeArgs != [] - return s:illegal() - endif - let b:mode = s:EXPR - let pos2 = b:pos - call s:nextToken() - if b:token == 'LT' - let typeArgs = s:typeArguments() - endif - let t = s:innerCreator(pos2, typeArgs, t) - let typeArgs = [] - else - let t = s:Select(pos1, t, s:ident()) - let t = s:argumentsOpt(typeArgs, s:typeArgumentsOpt2(t)) - let typeArgs = [] - endif - else - break - endif - endwhile - - - while (b:token == 'PLUSPLUS' || b:token == 'SUBSUB') && s:modeAndEXPR() - let b:mode = s:EXPR - let t = s:Unary(b:pos, b:token == 'PLUSPLUS' ? 'POSTINC' : 'POSTDEC', t) - call s:nextToken() - endwhile - return t -endfu - -fu! s:superSuffix(typeArgs, t) - let typeArgs = a:typeArgs - let t = a:t - call s:nextToken() - if b:token == 'LPAREN' || typeArgs != [] - let t = s:arguments(typeArgs, t) - else - let pos = b:pos - call s:accept('DOT') - let typeArgs = b:token == 'LT' ? s:typeArguments() : [] - let t = s:Select(pos, t, s:ident()) - let t = s:argumentsOpt(typeArgs, t) - endif - return t -endfu - -" BasicType = BYTE | SHORT | CHAR | INT | LONG | FLOAT | DOUBLE | BOOLEAN {{{2 -fu! s:basicType() - let t = {'tag': 'TYPEIDENT', 'pos': b:pos, 'typetag': s:typetag(b:token)} - call s:nextToken() - return t -endfu - -" ArgumentsOpt = [ Arguments ] {{{2 -fu! s:argumentsOpt(typeArgs, t) - if s:modeAndEXPR() && b:token == 'LPAREN' || a:typeArgs != [] - let b:mode = s:EXPR - return s:arguments(a:typeArgs, a:t) - else - return a:t - endif -endfu - -" Arguments = "(" [Expression { COMMA Expression }] ")" -fu! s:arguments(...) - let pos = b:pos - let args = [] - if b:token == 'LPAREN' - call s:nextToken() - if b:token != 'RPAREN' - call add(args, s:expression()) - while b:token == 'COMMA' - call s:nextToken() - call add(args, s:expression()) - endwhile - endif - call s:accept('RPAREN') - else - call s:SyntaxError(') expected') - endif - - if a:0 == 0 - return args - else - let typeArgs = a:1 - let t = a:2 - return {'tag': 'APPLY', 'pos': pos, 'typeargs': typeArgs, 'meth': t, 'args': args} - endif -endfu - -" typeArgument generic type {{{2 -fu! s:typeArgumentsOpt2(t) - if b:token == 'LT' && s:modeAndTYPE() && s:BitAnd(b:mode, s:NOPARAMS) == 0 - let b:mode = s:TYPE - " checkGenerics() - return s:typeArguments(a:t) - else - return a:t - endif -endfu - -fu! s:typeArgumentsOpt(...) - let useMode = a:0 == 0 ? s:TYPE : a:1 - - if b:token == 'LT' - " checkGenerics() - if s:BitAnd(b:mode, useMode) == 0 || s:BitAnd(b:mode, s:NOPARAMS) != 0 - return s:illegal() - endif - let b:mode = useMode - return s:typeArguments() - endif - return [] -endfu - -" TypeArguments = "<" TypeArgument {"," TypeArgument} ">" -fu! s:typeArguments(...) - let pos = b:pos - - let args = [] - if b:token == 'LT' - call s:nextToken() - call add(args, s:modeAndEXPR() ? s:type() : s:typeArgument()) - while b:token == 'COMMA' - call s:nextToken() - call add(args, s:modeAndEXPR() ? s:type() : s:typeArgument()) - endwhile - - if b:token == 'GTGTGTEQ' - let b:token = 'GTGTEQ' - elseif b:token == 'GTGTEQ' - let b:token = 'GTEQ' - elseif b:token == 'GTEQ' - let b:token = 'EQ' - elseif b:token == 'GTGTGT' - let b:token = 'GTGT' - elseif b:token == 'GTGT' - let b:token = 'GT' - else - call s:accept('GT') - endif - else - call s:SyntaxError("LT expected") - endif - - if a:0 == 0 - return args - else - return {'tag': 'TYPEAPPLY', 'pos': pos, 'clazz': a:1, 'arguments': args} - endif -endfu - -" TypeArgument = Type -" | "?" -" | "?" EXTENDS Type {"&" Type} -" | "?" SUPER Type -fu! s:typeArgument() - if b:token != 'QUES' - return s:type() - endif - - call s:nextToken() - if b:token == 'EXTENDS' - call s:nextToken() - return s:type() - elseif b:token == 'SUPER' - call s:nextToken() - return s:type() - elseif b:token == 'IDENTIFIER' - let id = ident() - else - endif -endfu - - -" BracketsOpt = {"[" "]"} {{{2 -fu! s:bracketsOpt(t) - let t = a:t - while b:token == 'LBRACKET' - let pos = b:pos - call s:nextToken() - let t = s:bracketsOptCont(t, pos) - endwhile - return t -endfu - -fu! s:bracketsOptCont(t, pos) - let t = a:t - call s:accept('RBRACKET') - let t = s:bracketsOpt(t) - return s:TypeArray(a:pos, t) -endfu - -" BracketsSuffixExpr = "." CLASS -" BracketsSuffixType = -fu! s:bracketsSuffix(t) - let t = a:t - if s:modeAndEXPR() && b:token == 'DOT' - let b:mode = s:EXPR - let pos = b:pos - call s:nextToken() - call s:accept('CLASS') - if b:pos == b:errorEndPos - let name = '' - if b:token == 'IDENTIFIER' - let name = b:name - call s:nextToken() - else - let name = '<error>' - endif - let t = {'tag': 'ERRONEOUS', 'pos': pos, 'errs': [s:Select(pos, t, name)]} - else - let t = s:Select(pos, t, 'class') - endif - elseif s:modeAndTYPE() - let b:mode = s:TYPE - else - call s:SyntaxError('dot.class.expected') - endif - return t -endfu - -" creator {{{2 -fu! s:creator(newpos, typeArgs) - if b:token =~# '^\(BYTE\|SHORT\|CHAR\|INT\|LONG\|FLOAT\|DOUBLE\|BOOLEAN\)$' - if a:typeArgs == [] - return s:arrayCreatorRest(a:newpos, s:basicType()) - endif - endif - - let t = s:qualident() - let oldmode = b:mode - let b:mode = s:TYPE - if b:token == 'LT' - "checkGenerics - let t = s:typeArguments(t) - endif - let b:mode = oldmode - - if b:token == 'LBRACKET' - return s:arrayCreatorRest(a:newpos, t) - elseif b:token == 'LPAREN' - return s:classCreatorRest(a:newpos, {}, a:typeArgs, t) - else - call s:ReportSyntaxError(b:pos, '( or [ expected') - let t = {'tag': 'NEWCLASS', 'encl': {}, 'typeargs': a:typeArgs, 'clazz': t, 'args': [], 'def': {}} - return {'tag': 'ERRONEOUS', 'pos': a:newpos, 'errs': [t]} - endif -endfu - -fu! s:innerCreator(newpos, typeArgs, encl) - let t = s:Ident(b:pos, s:ident()) - if b:token == 'LT' - " checkGenerics - let t = TypeArguments(t) - endif - return s:classCreatorRest(a:newpos, a:encl, a:typeArgs, t) -endfu - -fu! s:arrayCreatorRest(newpos, elemtype) - let elemtype = a:elemtype - call s:accept('LBRACKET') - if b:token == 'RBRACKET' - call s:accept('RBRACKET') - let elemtype = s:bracketsOpt(elemtype) - if b:token == 'LBRACE' - return s:arrayInitializer(a:newpos, elemtype) - else - return s:SyntaxError('array.dimension.missing') - endif - else - let dims = [s:expression()] - call s:accept('RBRACKET') - while b:token == 'LBRACKET' - let pos = b:pos - call s:nextToken() - if b:token == 'RBRACKET' - let elemtype = s:bracketsOptCont(elemtype, pos) - else - call add(dims, s:expression()) - call s:accept('RBRACKET') - endif - endwhile - return {'tag': 'NEWARRAY', 'pos': a:newpos, 'elemtype': elemtype, 'dims': dims, 'elems': {}} - endif -endfu - -fu! s:classCreatorRest(newpos, encl, typeArgs, t) - let args = s:arguments() - let body = {} - if b:token == 'LBRACE' - let body = s:ClassDef(b:pos, {}) - let body.defs = s:classOrInterfaceBody('', 0) - let body.endpos = b:pos - endif - return {'tag': 'NEWCLASS', 'encl': a:encl, 'typeargs': a:typeArgs, 'clazz': a:t, 'args': args, 'def': body} -endfu - -" ArrayInitializer = "{" [VariableInitializer {"," VariableInitializer}] [","] "}" {{{2 -fu! s:arrayInitializer(newpos, t) - call s:accept('LBRACE') - let elems = [] - if b:token == 'COMMA' - call s:nextToken() - elseif b:token != 'RBRACE' - call add(elems, s:variableInitializer()) - while b:token == 'COMMA' - call s:nextToken() - if b:token == 'RBRACE' - break - endif - call add(elems, s:variableInitializer()) - endwhile - endif - call s:accept('RBRACE') - return {'tag': 'NEWARRAY', 'pos': a:newpos, 'elemtype': a:t, 'dims': [], 'elems': elems} -endfu - -" VariableInitializer = ArrayInitializer | Expression {{{2 -fu! s:variableInitializer() - return b:token == 'LBRACE' ? s:arrayInitializer(b:pos, {}) : s:expression() -endfu - -" ParExpression = "(" Expression ")" {{{2 -fu! s:parExpression() - call s:accept('LPAREN') - let t = s:expression() - call s:accept('RPAREN') - return t -endfu - -" {{{2 -" Block = "{" BlockStatements "}" {{{2 -fu! s:block(...) - let t = {'tag': 'BLOCK', 'stats': []} - let t.pos = a:0 > 0 ? a:1 : b:pos - let t.flags = a:0 > 1 ? a:2 : 0 - - call s:accept('LBRACE') - - " scan strategy: ignore statements? - if a:0 > 2 && a:3 - if b:token !=# 'RBRACE' - let b:pos = s:gotoMatchEnd('{', '}', b:token == 'LBRACE') - endif - "let t.stats = Strpart(t.pos, t.endpos-t.pos-1) - else - let t.stats = s:blockStatements() - while b:token == 'CASE' || b:token == 'DEFAULT' - call s:SyntaxError("orphaned") - call s:switchBlockStatementGroups() - endwhile - endif - - let t.endpos = b:pos - call s:accept('RBRACE') - return t -endfu - -" BlockStatements = { BlockStatement } {{{2 -" BlockStatement = LocalVariableDeclarationStatement -" | ClassOrInterfaceOrEnumDeclaration -" | [Ident ":"] Statement -" LocalVariableDeclarationStatement -" = { FINAL | '@' Annotation } Type VariableDeclarators ";" -fu! s:blockStatements() - let lastErrPos = -1 - let stats = [] - while 1 - let pos = b:pos - if b:token =~# '^\(RBRACE\|CASE\|DEFAULT\|EOF\)$' - return stats - elseif b:token =~# '^\(LBRACE\|IF\|FOR\|WHILE\|DO\|TRY\|SWITCH\|SYNCHRONIZED\|RETURN\|THROW\|BREAK\|CONTINUE\|SEMI\|ELSE\|FINALLY\|CATCH\)$' - call add(stats, s:statement()) - elseif b:token =~# '^\(MONKEYS_AT\|FINAL\)' - let dc = b:docComment - let mods = s:modifiersOpt() - if b:token =~# '^\(INTERFACE\|CLASS\|ENUM\)$' - call add(stats, s:classOrInterfaceOrEnumDeclaration(mods, dc)) - else - let t = s:type() - let stats = stats + s:variableDeclarators(mods, t, []) - call s:accept('SEMI') - endif - elseif b:token =~# '^\(ABSTRACT\|STRICTFP\|CLASS\|INTERFACE\|ENUM\)$' - if b:token == 'ENUM' - call s:Log(4, b:pos, 'local.enum') - endif - call add(stats, s:classOrInterfaceOrEnumDeclaration(s:modifiersOpt(), b:docComment)) - elseif b:token == 'ASSERT' - call add(stats, s:statement()) - else - let name = b:name - let t = s:term(s:EXPR_OR_TYPE) - if b:token == 'COLON' && t.tag == 'IDENT' - call s:nextToken() - let stat = s:statement() - call add(stats, {'tag': 'LABELLED', 'pos': b:pos, 'label': name, 'body': stat}) - elseif s:BitAnd(b:lastmode, s:TYPE) && b:token =~# '^\(IDENTIFIER\|ASSERT\|ENUM\)$' - let pos = b:pos - let mods = {} " {'tag': 'MODIFIERS', 'pos': -1, 'flags': 0} - let stats = stats + s:variableDeclarators(mods, t, []) - call s:accept('SEMI') - else - call add(stats, {'tag': 'EXEC', 'pos': pos, 'expr': s:checkExprStat(t)}) " TODO - call s:accept('SEMI') - endif - endif - - if b:pos == lastErrPos - return stats - endif - if b:pos <= b:errorEndPos - call s:skip(0, 1, 1, 1) - let lastErrPos = b:pos - endif - - " resetDeprecatedFlag() - endwhile -endfu - -" Statement = Block {{{2 -" | IF ParExpression Statement [ELSE Statement] -" | FOR "(" ForInitOpt ";" [Expression] ";" ForUpdateOpt ")" Statement -" | FOR "(" FormalParameter : Expression ")" Statement -" | WHILE ParExpression Statement -" | DO Statement WHILE ParExpression ";" -" | TRY Block ( Catches | [Catches] FinallyPart ) -" | SWITCH ParExpression "{" SwitchBlockStatementGroups "}" -" | SYNCHRONIZED ParExpression Block -" | RETURN [Expression] ";" -" | THROW Expression ";" -" | BREAK [Ident] ";" -" | CONTINUE [Ident] ";" -" | ASSERT Expression [ ":" Expression ] ";" -" | ";" -" | ExpressionStatement -" | Ident ":" Statement -" called only by BlockStatements or self -fu! s:statement() - let pos = b:pos - if b:token == 'LBRACE' - return s:block() - elseif b:token == 'IF' - call s:nextToken() - let t = {'tag': 'IF', 'pos': pos, 'cond': s:parExpression(), 'thenpart': s:statement()} - if b:token == 'ELSE' - call s:nextToken() - let t.elsepart = s:statement() - endif - let t.endpos = b:pos - return t - - elseif b:token == 'FOR' - call s:nextToken() - call s:accept('LPAREN') - let inits = b:token == 'SEMI' ? [] : s:forInit() - " foreach - if len(inits) == 1 && inits[0].tag == 'VARDEF' && (!has_key(inits[0], 'init') || inits[0].init == {}) && b:token == 'COLON' - " checkForeach - let var = inits[0] - call s:accept('COLON') - let expr = s:expression() - call s:accept('RPAREN') - let body = s:statement() - return {'tag': 'FOREACHLOOP', 'pos': pos, 'endpos': b:pos, 'var': var, 'expr': expr, 'body': body} - else - call s:accept('SEMI') - let cond = b:token == 'SEMI' ? {} : s:expression() - call s:accept('SEMI') - let steps = b:token == 'RPAREN' ? [] : s:forUpdate() - call s:accept('RPAREN') - let body = s:statement() - return {'tag': 'FORLOOP', 'pos': pos, 'endpos': b:pos, 'init': inits, 'cond': cond, 'step': steps, 'body': body} - endif - - elseif b:token == 'WHILE' - call s:nextToken() - let cond = s:parExpression() - let body = s:statement() - return {'tag': 'WHILELOOP', 'pos': pos, 'endpos': b:pos, 'cond': cond, 'body': body} - - elseif b:token == 'DO' - call s:nextToken() - let body = s:statement() - call s:accept('WHILE') - let cond = s:parExpression() - let t = {'tag': 'DOLOOP', 'pos': pos, 'endpos': b:pos, 'cond': cond, 'body': body} - call s:accept('SEMI') - return t - - elseif b:token == 'TRY' - call s:nextToken() - let body = s:block() - let catchers = [] - let finalizer = {} - if b:token == 'CATCH' || b:token == 'FINALLY' - while b:token == 'CATCH' - call add(catchers, s:catchClause()) - endwhile - if b:token == 'FINALLY' - call s:nextToken() - let finalizer = s:block() - endif - else - call s:Log(4, b:pos, 'try.without.catch.or.finally') - endif - return {'tag': 'TRY', 'pos': pos, 'endpos': b:pos, 'body': body, 'catchers': catchers, 'finalizer': finalizer} - - elseif b:token == 'SWITCH' - call s:nextToken() - let selector = s:parExpression() - call s:accept('LBRACE') - let cases = s:switchBlockStatementGroups() - call s:accept('RBRACE') - return {'tag': 'SWITCH', 'pos': pos, 'endpos': b:pos, 'selector': selector, 'cases': cases} - - elseif b:token == 'SYNCHRONIZED' - call s:nextToken() - let lock = s:parExpression() - let body = s:block() - return {'tag': 'SYNCHRONIZED', 'pos': pos, 'endpos': b:pos, 'lock': lock, 'cases': body} - - elseif b:token == 'RETURN' - call s:nextToken() - let result = b:token == 'SEMI' ? {} : s:expression() - call s:accept('SEMI') - return {'tag': 'RETURN', 'pos': pos, 'endpos': b:pos, 'expr': result} - - elseif b:token == 'THROW' - call s:nextToken() - let exc = s:expression() - call s:accept('SEMI') - return {'tag': 'THROW', 'pos': pos, 'endpos': b:pos, 'expr': exc} - - elseif b:token == 'BREAK' || b:token == 'CONTINUE' - let token = b:token - call s:nextToken() - let label = b:token =~# '^\(IDENTIFIER\|ASSERT\|ENUM\)$' ? s:ident() : '' - call s:accept('SEMI') - return {'tag': token, 'pos': pos, 'endpos': b:pos, 'label': label} - - elseif b:token == 'SEMI' - call s:nextToken() - return {'tag': 'SKIP', 'pos': pos} - - elseif b:token == 'ELSE' - return s:SyntaxError("else.without.if") - elseif b:token == 'FINALLY' - return s:SyntaxError("finally.without.try") - elseif b:token == 'CATCH' - return s:SyntaxError("catch.without.try") - - elseif b:token == 'ASSERT' - "if b:allowAsserts && b:token == 'ASSERT' - call s:nextToken() - let t = {'tag': 'ASSERT', 'pos': pos, 'cond': s:expression()} - if b:token == 'COLON' - call s:nextToken() - let t.detail = s:expression() - endif - call s:accept('SEMI') - let t.endpos = b:pos - return t - "endif - - else " also ENUM - let name = b:name - let expr = s:expression() - if b:token == 'COLON' && expr.tag == 'IDENT' - call s:nextToken() - let stat = s:statement() - return {'tag': 'LABELLED', 'pos': pos, 'endpos': b:pos, 'label': name, 'body': stat} - else - let stat = {'tag': 'EXEC', 'pos': pos, 'endpos': b:pos, 'expr': s:checkExprStat(expr)} - call s:accept('SEMI') - return stat - endif - endif -endfu - -" CatchClause = CATCH "(" FormalParameter ")" Block -fu! s:catchClause() - let pos = b:pos - call s:accept('CATCH') - call s:accept('LPAREN') - let formal = s:variableDeclaratorId(s:optFinalParameter(), s:qualident()) - call s:accept('RPAREN') - let body = s:block() - return {'tag': 'CATCH', 'pos': pos, 'endpos': b:pos, 'param': formal, 'body': body} -endfu - -" SwitchBlockStatementGroups = { SwitchBlockStatementGroup } -" SwitchBlockStatementGroup = SwitchLabel BlockStatements -" SwitchLabel = CASE ConstantExpression ":" | DEFAULT ":" -fu! s:switchBlockStatementGroups() - let cases = [] - while 1 - let pos = b:pos - if b:token == 'CASE' || b:token == 'DEFAULT' - let token = b:token - call s:nextToken() - let pat = token == 'CASE' ? s:expression() : {} - call s:accept('COLON') - let stats = s:blockStatements() - call add(cases, {'tag': 'CASE', 'pos': pos, 'pat': pat, 'stats': stats}) - elseif b:token == 'RBRACE' || b:token == 'EOF' - return cases - else - call s:nextToken() - call s:SyntaxError('case.default.rbrace.expected') - endif - endwhile -endfu - -" MoreStatementExpressions = { COMMA StatementExpression } -fu! s:moreStatementExpressions(pos, first, stats) - call add(a:stats, {'tag': 'EXEC', 'pos': a:pos, 'expr': s:checkExprStat(a:first)}) - while b:token == 'COMMA' - call s:nextToken() - let pos = b:pos - let t = s:expression() - call add(a:stats, {'tag': 'EXEC', 'pos': pos, 'expr': s:checkExprStat(t)}) - endwhile - return a:stats -endfu - -" ForInit = StatementExpression MoreStatementExpressions -" | { FINAL | '@' Annotation } Type VariableDeclarators -fu! s:forInit() - let stats = [] - let pos = b:pos - if b:token == 'FINAL' || b:token == 'MONKEYS_AT' - return s:variableDeclarators(s:optFinal(0), s:type(), stats) - else - let t = s:term(s:EXPR_OR_TYPE) - if s:BitAnd(b:lastmode, s:TYPE) && b:token =~# '^\(IDENTIFIER\|ASSERT\|ENUM\)$' - return s:variableDeclarators(s:modifiersOpt(), t, stats) - else - return s:moreStatementExpressions(pos, t, stats) - endif - endif -endfu - -" ForUpdate = StatementExpression MoreStatementExpressions -fu! s:forUpdate() - return s:moreStatementExpressions(b:pos, s:expression(), []) -endfu - -" ModifiersOpt = { Modifier } {{{2 -" Modifier = PUBLIC | PROTECTED | PRIVATE | STATIC | ABSTRACT | FINAL -" | NATIVE | SYNCHRONIZED | TRANSIENT | VOLATILE | "@" -" | "@" Annotation -" NOTE: flags is a string, not a long number -fu! s:modifiersOpt(...) - let partial = a:0 == 0 ? {} : a:1 - - let flags = partial == {} ? 0 : partial.flags - let annotations = partial == {} ? [] : partial.annotations - " TODO: deprecatedFlag - - let pos = b:pos - let lastPos = -1 - while 1 - let flag = 0 - if b:token =~# '^\(PUBLIC\|PROTECTED\|PRIVATE\|STATIC\|ABSTRACT\|FINAL\|NATIVE\|SYNCHRONIZED\|TRANSIENT\|VOLATILE\|STRICTFP\|MONKEYS_AT\)$' - let flag = b:token == 'MONKEYS_AT' ? s:Flags.ANNOTATION : get(s:Flags, b:token, 0) - else - break - endif - "if s:BitAnd(flags, flag) != 0 - " "log.error(S.pos(), "repeated.modifier") - "endif - - let lastPos = b:pos - call s:nextToken() - - if flag == s:Flags.ANNOTATION - "call s:checkAnnotations() - if b:token != 'INTERFACE' - let ann = s:annotation(lastPos) - if flags == 0 && annotations == [] - let pos = ann.pos - endif - call add(annotations, ann) - let lastPos = ann.pos - let flag = 0 - endif - endif - let flags = s:BitOr(flags, flag) - endwhile - - if b:token == 'ENUM' - let flags = s:BitOr(flags, s:Flags.ENUM) - elseif b:token == 'INTERFACE' - let flags = s:BitOr(flags, s:Flags.INTERFACE) - endif - - if flags == 0 && empty(annotations) - let pos = -1 - endif - - return {'tag': 'MODIFIERS', 'pos': pos, 'flags': flags, 'annotations': annotations} -endfu - -" Annotation = "@" Qualident [ "(" AnnotationFieldValues ")" ] {{{2 -fu! s:annotation(pos) - "call s:checkAnnotations() - let ident = s:qualident() - "let endPos = b:prevEndPos - let fieldValues = s:annotationFieldValuesOpt() - - return {'tag': 'ANNOTATION', 'pos': a:pos, 'annotationType': ident, 'args': fieldValues} -endfu - -fu! s:annotationFieldValuesOpt() - return b:token == 'LPAREN' ? s:annotationFieldValues() : [] -endfu - -" AnnotationFieldValues = "(" [ AnnotationFieldValue { "," AnnotationFieldValue } ] ")" -fu! s:annotationFieldValues() - let buf = [] - call s:accept('LPAREN') - if b:token != 'RPAREN' - call add(buf, s:annotationFieldValue()) - while b:token == 'COMMA' - call s:nextToken() - call add(buf, s:annotationFieldValue()) - endwhile - endif - call s:accept('RPAREN') - return buf -endfu - -" AnnotationFieldValue = AnnotationValue | Identifier "=" AnnotationValue -fu! s:annotationFieldValue() - call s:Trace('s:annotationFieldValue ' . b:token) - if b:token == 'IDENTIFIER' - let b:mode = s:EXPR - let t1 = s:term1() - if t1.tag == 'IDENT' && b:token == 'EQ' - let pos = b:pos - call s:accept('EQ') - return {'tag': 'ASSIGN', 'pos': pos, 'lhs': t1, 'rhs': s:annotationValue()} - else - return t1 - endif - endif - return s:annotationValue() -endfu - -" AnnotationValue = ConditionalExpression | Annotation | "{" [ AnnotationValue { "," AnnotationValue } ] "}" -fu! s:annotationValue() - let pos = 0 - if b:token == 'MONKEYS_AT' - let pos = b:bp - call s:nextToken() - return s:annotation(pos) - elseif b:token == 'LBRACE' - let pos = b:pos - call s:accept('LBRACE') - let buf = [] - if b:token != 'RBRACE' - call add(buf, s:annotationValue()) - while b:token == 'COMMA' - call s:nextToken() - if b:token == 'RPAREN' - break - endif - call add(buf, s:annotationValue()) - endwhile - endif - call s:accept('RBRACE') - return buf - else - let b:mode = s:EXPR - return s:term1() - endif -endfu - -" AnnotationsOpt = { '@' Annotation } -fu! s:annotationsOpt() - if b:token != 'MONKEYS_AT' - return [] - endif - - let buf = [] - while b:token != 'MONKEYS_AT' - let pos = b:pos - call s:nextToken() - call add(buf, s:annotation(pos)) - endwhile - return buf -endfu - -" {{{2 -" CompilationUnit {{{2 -" CompilationUnit = [ { "@" Annotation } PACKAGE Qualident ";"] {ImportDeclaration} {TypeDeclaration} -fu! s:compilationUnit() - let unit = {'tag': 'TOPLEVEL', 'pos': b:pos} - - let mods = {} - if b:token == 'MONKEYS_AT' - let mods = s:modifiersOpt() - endif - - if b:token == 'PACKAGE' - if mods != {} - " checkNoMods(mods.flags) - let unit.packageAnnotations = mods.annotations - let mods = {} - endif - call s:nextToken() - let unit.pid = s:qualident() - let unit.package = java_parser#type2Str(unit.pid) - call s:accept('SEMI') - endif - - let imports = [] - let s:types = [] - let checkForImports = 1 - while b:token != 'EOF' - if b:pos <= b:errorEndPos - call s:skip(checkForImports, 0, 0, 0) - if b:token == 'EOF' - break - endif - endif - if checkForImports && mods == {} && b:token == 'IMPORT' - call add(imports, s:importDeclaration()) - else - let def = s:typeDeclaration(mods) - "if (def instanceof JCExpressionStatement) - " def = ((JCExpressionStatement)def).expr - "endif - call add(s:types, def) - if def.tag == 'CLASSDEF' - let checkForImports = 0 - endif - let mods = {} - endif - endwhile - let unit.imports = imports - let unit.types = s:types - unlet s:types - - return unit -endfu - -" ImportDeclaration = IMPORT [ STATIC ] Ident { "." Ident } [ "." "*" ] ";" {{{2 -" return fqn -fu! s:importDeclaration() - " OAO: Usualy it is in one line. - if b:scanStrategy < 0 - let idx = matchend(b:lines[b:line], '\(\s\+static\>\)\?\s\+\([_$a-zA-Z][_$a-zA-Z0-9_]*\)\(\s*\.\s*[_$a-zA-Z][_$a-zA-Z0-9_]*\)*\(\s*\.\s*\*\)\?;') - if idx != -1 - let fqn = strpart(b:lines[b:line], b:col, idx-b:col-1) - let b:col = idx - let b:bp = b:idxes[b:line] + b:col - call s:nextToken() - return fqn - endif - endif - - - call s:Info('==import==') - let pos = b:pos - call s:nextToken() - - let importStatic = 0 - if b:token == 'STATIC' - " checkStaticImports() - let importStatic = 1 - call s:nextToken() - endif - - let pid = s:Ident(b:pos, s:ident()) - - " - let pos1 = b:pos - call s:accept('DOT') - if b:token == 'STAR' - let pid = s:Select(pos1, pid, '*') - call s:nextToken() - else - let pid = s:Select(pos1, pid, s:ident()) - endif - while b:token == 'DOT' - let pos1 = b:pos - call s:accept('DOT') - if b:token == 'STAR' - let pid = s:Select(pos1, pid, '*') - call s:nextToken() - break - else - let pid = s:Select(pos1, pid, s:ident()) - endif - endwhile - let fqn = java_parser#type2Str(pid) - if b:token != 'SEMI' - let fqn .= '<SEMI expected>' - endif - call s:accept('SEMI') - "return {'tag': 'IMPORT', 'pos': b:pos, 'qualid': pid, 'staticImport': importStatic} - return fqn -endfu - -" TypeDeclaration = ClassOrInterfaceOrEnumDeclaration | ";" {{{2 -fu! s:typeDeclaration(mods) - let pos = b:pos - if a:mods == {} && b:token == 'SEMI' - call s:nextToken() - return {'tag': 'SKIP', 'pos': pos} - else - let dc = b:docComment - let mods = s:modifiersOpt(a:mods) - return s:classOrInterfaceOrEnumDeclaration(mods, dc) - endif -endfu - -fu! s:classOrInterfaceOrEnumDeclaration(mods, dc) - call s:Info('== type ==') - if b:token == 'CLASS' - return s:classDeclaration(a:mods, a:dc) - elseif b:token == 'INTERFACE' - return s:interfaceDeclaration(a:mods, a:dc) - elseif b:token == 'ENUM' - "if !exists('b:allowEnums') || !b:allowEnums - " call s:SyntaxError("enums.not.supported.in.source") - "endif - return s:enumDeclaration(a:mods, a:dc) - else - let pos = b:pos - let errs = [] - if b:token == 'IDENTIFIER' - call add(errs, s:ident()) - call s:setErrorEndPos(b:bp) - endif - return s:SyntaxError("class.or.intf.or.enum.expected", pos, errs) - endif -endfu - -" ClassDeclaration = CLASS Ident TypeParametersOpt [EXTENDS Type] [IMPLEMENTS TypeList] ClassBody {{{2 -fu! s:classDeclaration(mods, dc) - let type = s:ClassDef(b:pos, a:mods) - - call s:accept('CLASS') - let type.name = s:ident() - - let type.typarams = s:typeParametersOpt() - - " extends - if b:token == 'EXTENDS' - call s:nextToken() - let type.extends = [s:type()] - endif - - " implements - if b:token == 'IMPLEMENTS' - call s:nextToken() - let type.implements = s:typeList() - endif - - let type.defs = s:classOrInterfaceBody(type.name, 0) - let type.endpos = b:pos - return type -endfu - -" InterfaceDeclaration = INTERFACE Ident TypeParametersOpt [EXTENDS TypeList] InterfaceBody {{{2 -fu! s:interfaceDeclaration(mods, dc) - let type = s:ClassDef(b:pos, a:mods) - - call s:accept('INTERFACE') - let type.name = s:ident() - - let type.typarams = s:typeParametersOpt() - - " extends - if b:token == 'EXTENDS' - call s:nextToken() - let type.extends = s:typeList() - endif - - let type.defs = s:classOrInterfaceBody(type.name, 1) - let type.endpos = b:pos - return type -endfu - -" EnumDeclaration = ENUM Ident [IMPLEMENTS TypeList] EnumBody {{{2 -fu! s:enumDeclaration(mods, dc) - let type = s:ClassDef(b:pos, a:mods) - - call s:accept('ENUM') - let type.name = s:ident() - - if b:token == 'IMPLEMENTS' - call s:nextToken() - let type.implements = s:typeList() - endif - - let type.defs = s:enumBody(type.name) - let type.endpos = b:pos - return type -endfu - -" EnumBody = "{" { EnumeratorDeclarationList } [","] -" [ ";" {ClassBodyDeclaration} ] "}" -fu! s:enumBody(enumName) - let defs = [] - call s:accept('LBRACE') - - if b:token == 'COMMA' - call s:nextToken() - elseif b:token != 'RBRACE' && b:token != 'SEMI' - call add(defs, s:enumeratorDeclaration(a:enumName)) - while b:token == 'COMMA' - call s:nextToken() - if b:token == 'RBRACE' || b:token == 'SEMI' - break - endif - call add(defs, s:enumeratorDeclaration(a:enumName)) - endwhile - if b:token != 'RBRACE' && b:token != 'SEMI' - call s:SyntaxError('comma.or.rbrace.or.semi. expected') - call s:nextToken() - endif - endif - - if b:token == 'SEMI' - call s:nextToken() - while b:token != 'RBRACE' && b:token != 'EOF' - call add(defs, s:classOrInterfaceBodyDeclaration(a:enumName, 0)) - if b:pos <= b:errorEndPos - call s:skip(0, 1, 1, 0) - endif - endwhile - endif - - call s:accept('RBRACE') - return defs -endfu - -" EnumeratorDeclaration = AnnotationsOpt [TypeArguments] IDENTIFIER [ Arguments ] [ "{" ClassBody "}" ] -fu! s:enumeratorDeclaration(enumName) - let vardef = {'tag': 'VARDEF', 'pos': b:pos} - - let dc = b:docComment - let flags = 16409 " s:BitOr(s:Flags.PUBLIC, s:Flags.STATIC, s:Flags.FINAL, s:Flags.ENUM) - " if b:deprecatedFlag - " let flags = 147481 " s:BitOr(flags, s:Flags.DEPRECATED) - " let b:deprecatedFlag = 1 - " endif - let pos = b:pos - let annotations = s:annotationsOpt() - let vardef.mods = s:Modifiers(pos, flags, annotations) - let vardef.mods.pos = empty(annotations) ? -1 : pos - let vardef.m = s:Number2Bits(flags) - - let typeArgs = s:typeArgumentsOpt() - let identPos = b:pos - let vardef.name = s:ident() - let vardef.n = vardef.name - - let args = b:token == 'LPAREN' ? s:arguments() : [] - - " NOTE: It may be either a class body or a method body. I dont care, just record it - if b:token == 'LBRACE' - "call s:accept('LBRACE') - "if b:token !=# 'RBRACE' - " call s:gotoMatchEnd('{', '}') - "endif - "call s:accept('RBRACE') - - "let mods1 = s:Modifiers(-1, s:BitOr(s:Flags.ENUM, s:Flags.STATIC), []) - let defs = s:classOrInterfaceBody('', 0) - "let body = s:ClassDef(identPos, mods1) - "let body.defs = defs - endif - let vardef.endpos = b:bp - - " TODO: create new class - - return vardef -endfu - -" classOrInterfaceBody {{{2 -" ClassBody = "{" {ClassBodyDeclaration} "}" -" InterfaceBody = "{" {InterfaceBodyDeclaration} "}" -fu! s:classOrInterfaceBody(classname, isInterface) - call s:Info('== type definition body ==') - call s:accept('LBRACE') - - if b:pos <= b:errorEndPos - call s:skip(0, 1, 0, 0) - if b:token == 'LBRACE' - call s:nextToken() - endif - endif - - let defs = [] - while b:token != 'RBRACE' && b:token != 'EOF' - let defs += s:classOrInterfaceBodyDeclaration(a:classname, a:isInterface) - - if b:pos <= b:errorEndPos - call s:skip(0, 1, 1, 0) - endif - endwhile - call s:accept('RBRACE') - return defs -endfu - -" classOrInterfaceBodyDeclaration {{{2 -" ClassBodyDeclaration = -" ";" -" | [STATIC] Block -" | ModifiersOpt -" ( Type Ident -" ( VariableDeclaratorsRest ";" | MethodDeclaratorRest ) -" | VOID Ident MethodDeclaratorRest -" | TypeParameters (Type | VOID) Ident MethodDeclaratorRest -" | Ident ConstructorDeclaratorRest -" | TypeParameters Ident ConstructorDeclaratorRest -" | ClassOrInterfaceOrEnumDeclaration -" ) -" InterfaceBodyDeclaration = -" ";" -" | ModifiersOpt Type Ident -" ( ConstantDeclaratorsRest | InterfaceMethodDeclaratorRest ";" ) -fu! s:classOrInterfaceBodyDeclaration(classname, isInterface) - call s:Info('s:classOrInterfaceBodyDeclaration') - if b:token == 'SEMI' - call s:nextToken() - return [{'tag': 'BLOCK', 'pos': -1, 'endpos': -1, 'stats': []}] - else - if b:scanStrategy < 0 - let result = s:classOrInterfaceBodyDeclaration_opt(a:classname, a:isInterface) - if !empty(result) - return result - endif - endif - - - let dc = b:docComment - let pos = b:bp - let mods = s:modifiersOpt() - - if b:token =~# '^\(CLASS\|INTERFACE\|ENUM\)$' - return [s:classOrInterfaceOrEnumDeclaration(mods, dc)] - - " [STATIC] block - elseif b:token == 'LBRACE' && !a:isInterface - return [s:block(pos, mods.flags, b:scanStrategy < 1)] - - else - let typarams = s:typeParametersOpt() - - let token = b:token - let name = b:name - - let type = copy(s:TTree) - let isVoid = b:token == 'VOID' - if isVoid - let type = {'tag': 'TYPEIDENT', 'pos': pos, 'typetag': 'void'} " FIXME - let type.value = '' - call s:nextToken() - else - let time = reltime() - let type = s:type() - let b:et_perf .= "\r" . reltimestr(reltime(time)) . ' s:type() ' - endif - - - " ctor - if b:token == 'LPAREN' && !a:isInterface && type.tag == 'IDENT' - if a:isInterface || name != a:classname - call s:SyntaxError('invalid.meth.decl.ret.type.req') - endif - return [s:methodDeclaratorRest(pos, mods, type, name, typarams, a:isInterface, 1, dc)] - else - let name = s:ident() - " method - if b:token == 'LPAREN' - return [s:methodDeclaratorRest(pos, mods, type, name, typarams, a:isInterface, isVoid, dc)] - " field - elseif !isVoid && len(typarams) == 0 - let defs = s:variableDeclaratorsRest(pos, mods, type, name, a:isInterface, dc, copy([])) - call s:accept('SEMI') - return defs - else - call s:SyntaxError("LPAREN expected") - return [{}] - endif - endif - endif - endif -endfu - -" OAO: short way for common declaration of field or method, not for generic type yet. -fu! s:classOrInterfaceBodyDeclaration_opt(classname, isInterface) - let str = b:lines[b:line] - let idx = matchend(str, s:RE_MEMBER_HEADER) - if idx != -1 - let subs = split(substitute(strpart(str, 0, idx), s:RE_MEMBER_HEADER, '\1;\2;\3', ''), ';') - let name_ = subs[2] - let type_ = subs[1] - let flag_ = s:String2Flags(subs[0]) - -" if type_ =~# '^\(class\|interface\|enum\)$' -" return [s:classOrInterfaceOrEnumDeclaration(mods, dc)] -" else - " methodDeclarator - let idx = matchend(str, '^\s*[,=;(]', idx)-1 - if str[idx] == '(' - let methoddef = s:methodDeclaratorRest_opt(b:pos, flag_, type_, name_, [], a:isInterface, type_ == 'void', '', str, idx) - if !empty(methoddef) - return [methoddef] - endif - - " variableDeclarator - elseif str[idx] =~ '[=;]' - let vardef = {'tag': 'VARDEF', 'pos': b:pos, 'name': name_, 'n': name_, 'vartype': type_, 't': type_, 'm': flag_} - call s:gotoSemi() - call s:accept('SEMI') - let vardef.pos_end = b:pos - return [vardef] - - " variableDeclarators - elseif str[idx] == ',' - let ie = matchend(str, '^\(,\s*'. s:RE_IDENTIFIER .'\s*\)*;', idx) - if ie != -1 - let vardef = {'tag': 'VARDEF', 'pos': b:pos, 'name': name_, 'n': name_, 'vartype': type_, 't': type_, 'm': flag_} - let vars = [vardef] - for item in split(substitute(strpart(str, idx+1, ie-idx-2), '\s', '', 'g'), ',') - let vardef = copy(vardef) - let vardef.name = item - let vardef.n = item - call add(vars, vardef) - endfor - let b:col = ie - let b:bp = b:idxes[b:line] + b:col - call s:nextToken() - return vars - endif - endif -" endif - endif - - let RE_CTOR_HEADER = '^\s*\(\(public\|protected\|private\)\s\+\)\=\C' .a:classname. '\s*(' - let ie = matchend(str, RE_CTOR_HEADER) - if ie != -1 && !a:isInterface - let flag_ = s:String2Flags(substitute(strpart(str, 0, ie), RE_CTOR_HEADER, '\1', '')) - let methoddef = s:methodDeclaratorRest_opt(b:pos, flag_, a:classname, a:classname, [], a:isInterface, 1, '', str, ie-1) - if !empty(methoddef) - return [methoddef] - endif - endif - - let RE_METHOD_HEADER = '^\s*\(' .s:RE_IDENTIFIER. '\%(\s*\.\s*' .s:RE_IDENTIFIER. '\)*\%(\s*\[\s*\]\)\=\)\s\+\(' .s:RE_IDENTIFIER. '\)\s*(' - let ie = matchend(str, RE_METHOD_HEADER) - if ie != -1 - let subs = split(substitute(strpart(str, 0, ie), RE_METHOD_HEADER, '\1;\2', ''), ';') - let methoddef = s:methodDeclaratorRest_opt(b:pos, 0, subs[0], subs[1], [], a:isInterface, subs[0] == 'void', '', str, ie-1) - if !empty(methoddef) - return [methoddef] - endif - endif -endfu - - -" MethodDeclaratorRest = {{{2 -" FormalParameters BracketsOpt [Throws TypeList] ( MethodBody | [DEFAULT AnnotationValue] ";") -" VoidMethodDeclaratorRest = FormalParameters [Throws TypeList] ( MethodBody | ";") -" InterfaceMethodDeclaratorRest = FormalParameters BracketsOpt [THROWS TypeList] ";" -" VoidInterfaceMethodDeclaratorRest = FormalParameters [THROWS TypeList] ";" -" ConstructorDeclaratorRest = "(" FormalParameterListOpt ")" [THROWS TypeList] MethodBody -fu! s:methodDeclaratorRest(pos, mods, type, name, typarams, isInterface, isVoid, dc) - let time = reltime() - let methoddef = {'tag': 'METHODDEF', 'pos': a:pos, 'name': a:name, 'mods': a:mods, 'restype': a:type, 'typarams': a:typarams} - let methoddef.n = a:name - let methoddef.m = s:Number2Bits(a:mods.flags) - let methoddef.r = java_parser#type2Str(a:type) - - " parameters - let methoddef.params = s:formalParameters() - - " BracketsOpt - if !a:isVoid - let methoddef.r = java_parser#type2Str(s:bracketsOpt(a:type)) - endif - - - " throws - if b:token == 'THROWS' - call s:nextToken() - - " thrown = qualidentList() - let ts = [s:qualident()] - while b:token == 'COMMA' - call s:nextToken() - call add(ts, s:qualident()) - endwhile - let methoddef.throws = ts - endif - - " method body - if b:token == 'LBRACE' - let methoddef.body = s:block(b:pos, 0, b:scanStrategy < 1) - else - if b:token == 'DEFAULT' - call s:accept('DEFAULT') - let methoddef.defaultValue = s:annotationValue() - endif - call s:accept('SEMI') - - if b:pos <= b:errorEndPos - call s:skip(0, 1, 0, 0) - if b:token == 'LBRACE' - let methoddef.body = s:block(b:pos, 0, b:scanStrategy < 1) - endif - endif - endif - - let methoddef.d = s:method2Str(methoddef) - let b:et_perf .= "\r" . reltimestr(reltime(time)) . ' methodrest() ' - return methoddef -endfu - -" method header declared in one line, -" NOTE: RE_FORMAL_PARAM_LIST do not recognize varargs and nested comments -fu! s:methodDeclaratorRest_opt(pos, mods, type, name, typarams, isInterface, isVoid, dc, str, idx) - let str = a:str - let idx = a:idx - - " params - let idxend = matchend(str, '^(\s*)', idx) " no params - if idxend == -1 - let idxend = matchend(str, '^(\s*' . s:RE_FORMAL_PARAM_LIST . '\s*)', idx) - endif - if idxend == -1 - return - endif - - let methoddef = {'tag': 'METHODDEF', 'pos': a:pos, 'name': a:name, 'n': a:name, 'm': a:mods, 'r': a:type} - - " params - let methoddef.params = [] - let s = strpart(str, idx+1, idxend-idx-2) - if s !~ '^\s*$' - for item in split(s, ',') - let subs = split(substitute(item, s:RE_FORMAL_PARAM2, '\2;\5', ''), ';') - let param = {'tag': 'VARDEF', 'pos': -1} - let param.name = subs[1] - let param.vartype = substitute(subs[0], ' ', '', 'g') - let param.m = s:Flags.PARAMETER - call add(methoddef.params, param) - endfor - endif - - " throws - let idx2 = matchend(str, '^\s*' . s:RE_THROWS, idxend) - let idx = idx2 == -1 ? idxend : idx2 - if idx2 != -1 - "let throws = strpart(str, idxend, idx-idxend) - endif - - " in interface - if a:isInterface - let idx = matchend(str, '^\s*;', idx) - if idx != -1 - let b:token = 'SEMI' - let b:col = idx - let b:bp = b:idxes[b:line] + b:col - let b:pos = b:bp - 1 - let methoddef.d = substitute(str, '^\s*\([^{]*\)\s*;\=$', '\1', '') - return methoddef - endif - endif - - let idx = matchend(str, '^\s*{', idx) - if idx == -1 - let idx = matchend(b:lines[b:line+1], '^\s*{') - if idx != -1 - let b:line += 1 - endif - endif - if idx != -1 - let b:token = 'LBRACE' - let b:col = idx - let b:bp = b:idxes[b:line] + b:col - let b:pos = b:bp - 1 - let methoddef.d = substitute(str, '^\s*\([^{]*\)\s*{\=$', '\1', '') - let methoddef.body = s:block(b:pos, 0, b:scanStrategy < 1) - return methoddef - endif -endfu - -" VariableDeclarators = VariableDeclarator { "," VariableDeclarator } {{{2 -fu! s:variableDeclarators(mods, type, vdefs) - return s:variableDeclaratorsRest(b:pos, a:mods, a:type, s:ident(), 0, '', a:vdefs) -endfu - -" VariableDeclaratorsRest = VariableDeclaratorRest { "," VariableDeclarator } -" ConstantDeclaratorsRest = ConstantDeclaratorRest { "," ConstantDeclarator } -fu! s:variableDeclaratorsRest(pos, mods, type, name, reqInit, dc, vdefs) - call add(a:vdefs, s:variableDeclaratorRest(a:pos, a:mods, a:type, a:name, a:reqInit, a:dc)) - while b:token == 'COMMA' - call s:nextToken() - call add(a:vdefs, s:variableDeclarator(a:mods, a:type, a:reqInit, a:dc)) - endwhile - return a:vdefs -endfu - -" VariableDeclarator = Ident VariableDeclaratorRest -" ConstantDeclarator = Ident ConstantDeclaratorRest -fu! s:variableDeclarator(mods, type, reqInit, dc) - return s:variableDeclaratorRest(b:pos, a:mods, a:type, s:ident(), a:reqInit, a:dc) -endfu - -" VariableDeclaratorRest = BracketsOpt ["=" VariableInitializer] -" ConstantDeclaratorRest = BracketsOpt "=" VariableInitializer -fu! s:variableDeclaratorRest(pos, mods, type, name, reqInit, dc) - let vardef = s:VarDef(a:pos, a:mods, a:name, s:bracketsOpt(a:type)) - let vardef.n = vardef.name - let vardef.m = a:mods == {} ? '0' : s:Number2Bits(a:mods.flags) - let vardef.t = java_parser#type2Str(vardef.vartype) - - if b:token == 'EQ' - call s:nextToken() - call s:Info('field init ' . b:token) - let vardef.init = s:variableInitializer() - elseif a:reqInit - echo '[syntax error]:' . s:token2string('EQ') . " expected" - endif - - let vardef.endpos = b:pos - return vardef -endfu - -fu! s:variableDeclaratorId(mods, type) - let vardef = s:VarDef(b:pos, a:mods, s:ident(), a:type) - if len(a:mods.flags) <= 34 " (a:mods.flags & s:Flags.VARARGS) == 0 - let vardef.type = s:bracketsOpt(vardef.vartype) - endif - return vardef -endfu - -" {{{2 -" TypeParametersOpt = ["<" TypeParameter {"," TypeParameter} ">"] {{{2 -fu! s:typeParametersOpt() - if b:token == 'LT' - "call checkGenerics() - let typarams = [] - call s:nextToken() - call add(typarams, s:typeParameter()) - while b:token == 'COMMA' - call s:nextToken() - call add(typarams, s:typeParameter()) - endwhile - call s:accept('GT') - return typarams - else - return [] - endif -endfu - -" TypeParameter = TypeVariable [TypeParameterBound] {{{2 -" TypeParameterBound = EXTENDS Type {"&" Type} -" TypeVariable = Ident -fu! s:typeParameter() - let pos = b:pos - let name = s:ident() - let bounds = [] - if b:token == 'EXTENDS' - call s:nextToken() - call add(bounds, s:type()) - while b:token == 'AMP' - call s:nextToken() - call add(bounds, s:type()) - endwhile - endif - - return {'tag': 'TYPEPARAMETER', 'pos': pos, 'name': name, 'bounds': bounds} -endfu - -" FormalParameters = "(" [ FormalParameterList ] ")" {{{2 -" FormalParameterList = [ FormalParameterListNovarargs , ] LastFormalParameter -" FormalParameterListNovarargs = [ FormalParameterListNovarargs , ] FormalParameter -fu! s:formalParameters() - let params = [] - let lastParam = {} - call s:accept('LPAREN') - if b:token != 'RPAREN' - let lastParam = s:formalParameter() - call add(params, lastParam) - while b:token == 'COMMA' && len(lastParam.mods.flags) <= 34 " (lastParam.mods.flags & s:Flags.VARARGS) == 0 - call s:nextToken() - let lastParam = s:formalParameter() - call add(params, lastParam) - endwhile - endif - call s:accept('RPAREN') - return params -endfu - -" FormalParameter = { FINAL | '@' Annotation } Type VariableDeclaratorId {{{2 -" LastFormalParameter = { FINAL | '@' Annotation } Type '...' Ident | FormalParameter -fu! s:optFinal(flags) - let mods = s:modifiersOpt() - " checkNoMods(mods.flags & ~(Flags.FINAL | Flags.DEPRECATED)) - let mods.flags = s:BitOr(mods.flags, a:flags) - return mods -endfu - -" OAO: optional FINAL for parameter -fu! s:optFinalParameter() - let mods = {'tag': 'MODIFIERS', 'pos': b:pos, 'flags': s:Flags.PARAMETER, 'annotations': []} - if b:token == 'FINAL' - let mods.flags = '1000000000000000000000000000010000' - call s:nextToken() - endif - return mods -endfu - -fu! s:formalParameter() - let mods = s:optFinalParameter() - let type = s:type() - - if b:token == 'ELLIPSIS' - " checkVarargs() - let mods.flags = '1' . mods.flags " s:BitOr_binary(mods.flags, s:Flags.VARARGS) - let type = s:TypeArray(b:pos, type) - call s:nextToken() - endif - - return s:variableDeclaratorId(mods, type) -endfu - -" {{{2 -" auxiliary methods {{{2 -let s:MapToken2Tag = {'BARBAR': 'OR', 'AMPAMP': 'AND', 'BAR': 'BITOR', 'BAREQ': 'BITOR_ASG', 'CARET': 'BITXOR', 'CARETEQ': 'BITXOR_ASG', 'AMP': 'BITAND', 'AMPEQ': 'BITAND_ASG', 'EQEQ': 'EQ', 'BANGEQ': 'NE', 'LT': 'LT', 'GT': 'GT', 'LTEQ': 'LE', 'GTEQ': 'GE', 'LTLT': 'SL', 'LTLTEQ': 'SL_ASG', 'GTGT': 'SR', 'GTGTEQ': 'SR_ASG', 'GTGTGT': 'USR', 'GTGTGTEQ': 'USR_ASG', 'PLUS': 'PLUS', 'PLUSEQ': 'PLUS_ASG', 'SUB': 'MINUS', 'SUBEQ': 'MINUS_ASG', 'STAR': 'MUL', 'STAREQ': 'MUL_ASG', 'SLASH': 'DIV', 'SLASHEQ': 'DIV_ASG', 'PERCENT': 'MOD', 'PERCENTEQ': 'MOD_ASG', 'INSTANCEOF': 'TYPETEST'} -let s:opprecedences = {'notExpression': -1, 'noPrec': 0, 'assignPrec': 1, 'assignopPrec': 2, 'condPrec': 3, 'orPrec': 4, 'andPrec': 5, 'bitorPrec': 6, 'bitxorPrec': 7, 'bitandPrec': 8, 'eqPrec': 9, 'ordPrec': 10, 'shiftPrec': 11, 'addPrec': 12, 'mulPrec': 13, 'prefixPrec': 14, 'postfixPrec': 15, 'precCount': 16} - -fu! s:checkExprStat(t) - if a:t.tag =~# '^\(PREINC\|PREDEC\|POSTINC\|POSTDEC\|ASSIGN\|BITOR_ASG\|BITXOR_ASG\|BITAND_ASG\|SL_ASG\|SR_ASG\|USR_ASG\|PLUS_ASG\|MINUS_ASG\|MUL_ASG\|DIV_ASG\|MOD_ASG\|APPLY\|NEWCLASS\|ERRONEOUS\)$' - return a:t - else - call s:SyntaxError('not.stmt') - return {'tag': 'ERRONEOUS', 'pos': b:pos, 'errs': [a:t]} - endif -endfu - -fu! s:prec(token) - let oc = s:optag(a:token) - return oc == -1 ? -1 : s:opPrec(oc) -endfu - -fu! s:opPrec(tag) - if a:tag =~# '^\(POS\|NEG\|NOT\|COMPL\|PREINC\|PREDEC\)$' - return s:opprecedences.prefixPrec - elseif a:tag =~# '^\(POSTINC\|POSTDEC\|NULLCHK\)$' - return s:opprecedences.postfixPrec - elseif a:tag == 'ASSIGN' - return s:opprecedences.assignPrec - elseif a:tag =~# '^\(BITOR_ASG\|BITXOR_ASG\|BITAND_ASG\|SL_ASG\|SR_ASG\|USR_ASG\|PLUS_ASG\|MINUS_ASG\|MUL_ASG\|DIV_ASG\|MOD_ASG\)$' - return s:opprecedences.assignopPrec - elseif a:tag == 'OR' - return s:opprecedences.orPrec - elseif a:tag == 'AND' - return s:opprecedences.andPrec - elseif a:tag =~# '^\(EQ\|NE\)$' - return s:opprecedences.eqPrec - elseif a:tag =~# '^\(LT\|GT\|LE\|GE\)$' - return s:opprecedences.ordPrec - elseif a:tag == 'BITOR' - return s:opprecedences.bitorPrec - elseif a:tag == 'BITXOR' - return s:opprecedences.bitxorPrec - elseif a:tag == 'BITAND' - return s:opprecedences.bitandPrec - elseif a:tag =~# '^\(SL\|SR\|USR\)$' - return s:opprecedences.shiftPrec - elseif a:tag =~# '^\(PLUS\|MINUS\)$' - return s:opprecedences.addPrec - elseif a:tag =~# '^\(MUL\|DIV\|MOD\)$' - return s:opprecedences.mulPrec - elseif a:tag == 'TYPETEST' - return s:opprecedences.ordPrec - else - return -1 - endif -endfu - -fu! s:optag(token) - return get(s:MapToken2Tag, a:token, -1) -endfu - -fu! s:unoptag(token) - if a:token == 'PLUS' - return 'POS' - elseif a:token == 'SUB' - return 'NEG' - elseif a:token == 'BANG' - return 'NOT' - elseif a:token == 'TILDE' - return 'COMPL' - elseif a:token == 'PLUSPLUS' - return 'PREINC' - elseif a:token == 'SUBSUB' - return 'PREDEC' - else - return -1 - endif -endfu - -fu! s:typetag(token) - if a:token =~# '\(BYTE\|CHAR\|SHORT\|INT\|LONG\|FLOAT\|DOUBLE\|BOOLEAN\)' - return tolower(a:token) - else - return -1 - endif -endfu - -"}}}1 -" vim:set fdm=marker sw=2 nowrap: diff --git a/home/.vim/autoload/javacomplete.vim b/home/.vim/autoload/javacomplete.vim deleted file mode 100644 index ee55612..0000000 --- a/home/.vim/autoload/javacomplete.vim +++ /dev/null @@ -1,2932 +0,0 @@ -" Vim completion script - hit 80% complete tasks -" Version: 0.77.1.2 -" Language: Java -" Maintainer: cheng fang <fangread@yahoo.com.cn> -" Last Change: 2011-01-30 -" Copyright: Copyright (C) 2006-2007 cheng fang. All rights reserved. -" License: Vim License (see vim's :help license) - - -" constants {{{1 -" input context type -let s:CONTEXT_AFTER_DOT = 1 -let s:CONTEXT_METHOD_PARAM = 2 -let s:CONTEXT_IMPORT = 3 -let s:CONTEXT_IMPORT_STATIC = 4 -let s:CONTEXT_PACKAGE_DECL = 6 -let s:CONTEXT_NEED_TYPE = 7 -let s:CONTEXT_OTHER = 0 - - -let s:ARRAY_TYPE_MEMBERS = [ -\ {'kind': 'm', 'word': 'clone(', 'abbr': 'clone()', 'menu': 'Object clone()', }, -\ {'kind': 'm', 'word': 'equals(', 'abbr': 'equals()', 'menu': 'boolean equals(Object)', }, -\ {'kind': 'm', 'word': 'getClass(', 'abbr': 'getClass()', 'menu': 'Class Object.getClass()', }, -\ {'kind': 'm', 'word': 'hashCode(', 'abbr': 'hashCode()', 'menu': 'int hashCode()', }, -\ {'kind': 'f', 'word': 'length', 'menu': 'int'}, -\ {'kind': 'm', 'word': 'notify(', 'abbr': 'notify()', 'menu': 'void Object.notify()', }, -\ {'kind': 'm', 'word': 'notifyAll(', 'abbr': 'notifyAll()', 'menu': 'void Object.notifyAll()', }, -\ {'kind': 'm', 'word': 'toString(', 'abbr': 'toString()', 'menu': 'String toString()', }, -\ {'kind': 'm', 'word': 'wait(', 'abbr': 'wait()', 'menu': 'void Object.wait() throws InterruptedException', }, -\ {'kind': 'm', 'dup': 1, 'word': 'wait(', 'abbr': 'wait()', 'menu': 'void Object.wait(long timeout) throws InterruptedException', }, -\ {'kind': 'm', 'dup': 1, 'word': 'wait(', 'abbr': 'wait()', 'menu': 'void Object.wait(long timeout, int nanos) throws InterruptedException', }] - -let s:ARRAY_TYPE_INFO = {'tag': 'CLASSDEF', 'name': '[', 'ctors': [], -\ 'fields': [{'n': 'length', 'm': '1', 't': 'int'}], -\ 'methods':[ -\ {'n': 'clone', 'm': '1', 'r': 'Object', 'p': [], 'd': 'Object clone()'}, -\ {'n': 'equals', 'm': '1', 'r': 'boolean', 'p': ['Object'], 'd': 'boolean Object.equals(Object obj)'}, -\ {'n': 'getClass', 'm': '100010001', 'r': 'Class', 'p': [], 'd': 'Class Object.getClass()'}, -\ {'n': 'hashCode', 'm': '100000001', 'r': 'int', 'p': [], 'd': 'int Object.hashCode()'}, -\ {'n': 'notify', 'm': '100010001', 'r': 'void', 'p': [], 'd': 'void Object.notify()'}, -\ {'n': 'notifyAll','m': '100010001', 'r': 'void', 'p': [], 'd': 'void Object.notifyAll()'}, -\ {'n': 'toString', 'm': '1', 'r': 'String', 'p': [], 'd': 'String Object.toString()'}, -\ {'n': 'wait', 'm': '10001', 'r': 'void', 'p': [], 'd': 'void Object.wait() throws InterruptedException'}, -\ {'n': 'wait', 'm': '100010001', 'r': 'void', 'p': ['long'], 'd': 'void Object.wait(long timeout) throws InterruptedException'}, -\ {'n': 'wait', 'm': '10001', 'r': 'void', 'p': ['long','int'], 'd': 'void Object.wait(long timeout, int nanos) throws InterruptedException'}, -\ ]} - -let s:PRIMITIVE_TYPE_INFO = {'tag': 'CLASSDEF', 'name': '!', 'fields': [{'n': 'class','m': '1','t': 'Class'}]} - -let s:JSP_BUILTIN_OBJECTS = {'session': 'javax.servlet.http.HttpSession', -\ 'request': 'javax.servlet.http.HttpServletRequest', -\ 'response': 'javax.servlet.http.HttpServletResponse', -\ 'pageContext': 'javax.servlet.jsp.PageContext', -\ 'application': 'javax.servlet.ServletContext', -\ 'config': 'javax.servlet.ServletConfig', -\ 'out': 'javax.servlet.jsp.JspWriter', -\ 'page': 'javax.servlet.jsp.HttpJspPage', } - - -let s:PRIMITIVE_TYPES = ['boolean', 'byte', 'char', 'int', 'short', 'long', 'float', 'double'] -let s:KEYWORDS_MODS = ['public', 'private', 'protected', 'static', 'final', 'synchronized', 'volatile', 'transient', 'native', 'strictfp', 'abstract'] -let s:KEYWORDS_TYPE = ['class', 'interface', 'enum'] -let s:KEYWORDS = s:PRIMITIVE_TYPES + s:KEYWORDS_MODS + s:KEYWORDS_TYPE + ['super', 'this', 'void'] + ['assert', 'break', 'case', 'catch', 'const', 'continue', 'default', 'do', 'else', 'extends', 'finally', 'for', 'goto', 'if', 'implements', 'import', 'instanceof', 'interface', 'new', 'package', 'return', 'switch', 'throw', 'throws', 'try', 'while', 'true', 'false', 'null'] - -let s:PATH_SEP = ':' -let s:FILE_SEP = '/' -if has("win32") || has("win64") || has("win16") || has("dos32") || has("dos16") - let s:PATH_SEP = ';' - let s:FILE_SEP = '\' -endif - -let s:RE_BRACKETS = '\%(\s*\[\s*\]\)' -let s:RE_IDENTIFIER = '[a-zA-Z_$][a-zA-Z0-9_$]*' -let s:RE_QUALID = s:RE_IDENTIFIER. '\%(\s*\.\s*' .s:RE_IDENTIFIER. '\)*' - -let s:RE_REFERENCE_TYPE = s:RE_QUALID . s:RE_BRACKETS . '*' -let s:RE_TYPE = s:RE_REFERENCE_TYPE - -let s:RE_TYPE_ARGUMENT = '\%(?\s\+\%(extends\|super\)\s\+\)\=' . s:RE_TYPE -let s:RE_TYPE_ARGUMENTS = '<' . s:RE_TYPE_ARGUMENT . '\%(\s*,\s*' . s:RE_TYPE_ARGUMENT . '\)*>' -let s:RE_TYPE_WITH_ARGUMENTS_I = s:RE_IDENTIFIER . '\s*' . s:RE_TYPE_ARGUMENTS -let s:RE_TYPE_WITH_ARGUMENTS = s:RE_TYPE_WITH_ARGUMENTS_I . '\%(\s*' . s:RE_TYPE_WITH_ARGUMENTS_I . '\)*' - -let s:RE_TYPE_MODS = '\%(public\|protected\|private\|abstract\|static\|final\|strictfp\)' -let s:RE_TYPE_DECL_HEAD = '\(class\|interface\|enum\)[ \t\n\r]\+' -let s:RE_TYPE_DECL = '\<\C\(\%(' .s:RE_TYPE_MODS. '\s\+\)*\)' .s:RE_TYPE_DECL_HEAD. '\(' .s:RE_IDENTIFIER. '\)[< \t\n\r]' - -let s:RE_ARRAY_TYPE = '^\s*\(' .s:RE_QUALID . '\)\(' . s:RE_BRACKETS . '\+\)\s*$' -let s:RE_SELECT_OR_ACCESS = '^\s*\(' . s:RE_IDENTIFIER . '\)\s*\(\[.*\]\)\=\s*$' -let s:RE_ARRAY_ACCESS = '^\s*\(' . s:RE_IDENTIFIER . '\)\s*\(\[.*\]\)\+\s*$' -let s:RE_CASTING = '^\s*(\(' .s:RE_QUALID. '\))\s*\(' . s:RE_IDENTIFIER . '\)\>' - -let s:RE_KEYWORDS = '\<\%(' . join(s:KEYWORDS, '\|') . '\)\>' - - -" local variables {{{1 -let b:context_type = s:CONTEXT_OTHER -"let b:statement = '' " statement before cursor -let b:dotexpr = '' " expression ends with '.' -let b:incomplete = '' " incomplete word: 1. dotexpr.method(|) 2. new classname(|) 3. dotexpr.ab|, 4. ja|, 5. method(| -let b:errormsg = '' - -" script variables {{{1 -let s:cache = {} " FQN -> member list, e.g. {'java.lang.StringBuffer': classinfo, 'java.util': packageinfo, '/dir/TopLevelClass.java': compilationUnit} -let s:files = {} " srouce file path -> properties, e.g. {filekey: {'unit': compilationUnit, 'changedtick': tick, }} -let s:history = {} " - - -" This function is used for the 'omnifunc' option. {{{1 -function! javacomplete#Complete(findstart, base) - if a:findstart - let s:et_whole = reltime() - let start = col('.') - 1 - let s:log = [] - - " reset enviroment - let b:dotexpr = '' - let b:incomplete = '' - let b:context_type = s:CONTEXT_OTHER - - let statement = s:GetStatement() - call s:WatchVariant('statement: "' . statement . '"') - - if statement =~ '[.0-9A-Za-z_]\s*$' - let valid = 1 - if statement =~ '\.\s*$' - let valid = statement =~ '[")0-9A-Za-z_\]]\s*\.\s*$' && statement !~ '\<\H\w\+\.\s*$' && statement !~ '\<\(abstract\|assert\|break\|case\|catch\|const\|continue\|default\|do\|else\|enum\|extends\|final\|finally\|for\|goto\|if\|implements\|import\|instanceof\|interface\|native\|new\|package\|private\|protected\|public\|return\|static\|strictfp\|switch\|synchronized\|throw\|throws\|transient\|try\|volatile\|while\|true\|false\|null\)\.\s*$' - endif - if !valid - return -1 - endif - - let b:context_type = s:CONTEXT_AFTER_DOT - - " import or package declaration - if statement =~# '^\s*\(import\|package\)\s\+' - let statement = substitute(statement, '\s\+\.', '.', 'g') - let statement = substitute(statement, '\.\s\+', '.', 'g') - if statement =~ '^\s*import\s\+' - let b:context_type = statement =~# '\<static\s\+' ? s:CONTEXT_IMPORT_STATIC : s:CONTEXT_IMPORT - let b:dotexpr = substitute(statement, '^\s*import\s\+\(static\s\+\)\?', '', '') - else - let b:context_type = s:CONTEXT_PACKAGE_DECL - let b:dotexpr = substitute(statement, '\s*package\s\+', '', '') - endif - - " String literal - elseif statement =~ '"\s*\.\s*$' - let b:dotexpr = substitute(statement, '\s*\.\s*$', '\.', '') - return start - strlen(b:incomplete) - - else - " type declaration NOTE: not supported generic yet. - let idx_type = matchend(statement, '^\s*' . s:RE_TYPE_DECL) - if idx_type != -1 - let b:dotexpr = strpart(statement, idx_type) - " return if not after extends or implements - if b:dotexpr !~ '^\(extends\|implements\)\s\+' - return -1 - endif - let b:context_type = s:CONTEXT_NEED_TYPE - endif - - let b:dotexpr = s:ExtractCleanExpr(statement) - endif - - " all cases: " java.ut|" or " java.util.|" or "ja|" - let b:incomplete = strpart(b:dotexpr, strridx(b:dotexpr, '.')+1) - let b:dotexpr = strpart(b:dotexpr, 0, strridx(b:dotexpr, '.')+1) - return start - strlen(b:incomplete) - - - " method parameters, treat methodname or 'new' as an incomplete word - elseif statement =~ '(\s*$' - " TODO: Need to exclude method declaration? - let b:context_type = s:CONTEXT_METHOD_PARAM - let pos = strridx(statement, '(') - let s:padding = strpart(statement, pos+1) - let start = start - (len(statement) - pos) - - let statement = substitute(statement, '\s*(\s*$', '', '') - - " new ClassName? - let str = matchstr(statement, '\<new\s\+' . s:RE_QUALID . '$') - if str != '' - let str = substitute(str, '^new\s\+', '', '') - if !s:IsKeyword(str) - let b:incomplete = '+' - let b:dotexpr = str - return start - len(b:dotexpr) - endif - - " normal method invocations - else - let pos = match(statement, '\s*' . s:RE_IDENTIFIER . '$') - " case: "method(|)", "this(|)", "super(|)" - if pos == 0 - let statement = substitute(statement, '^\s*', '', '') - " treat "this" or "super" as a type name. - if statement == 'this' || statement == 'super' - let b:dotexpr = statement - let b:incomplete = '+' - return start - len(b:dotexpr) - - elseif !s:IsKeyword(statement) - let b:incomplete = statement - return start - strlen(b:incomplete) - endif - - " case: "expr.method(|)" - elseif statement[pos-1] == '.' && !s:IsKeyword(strpart(statement, pos)) - let b:dotexpr = s:ExtractCleanExpr(strpart(statement, 0, pos)) - let b:incomplete = strpart(statement, pos) - return start - strlen(b:incomplete) - endif - endif - endif - - return -1 - endif - - - " Return list of matches. - - call s:WatchVariant('b:context_type: "' . b:context_type . '" b:incomplete: "' . b:incomplete . '" b:dotexpr: "' . b:dotexpr . '"') - if b:dotexpr =~ '^\s*$' && b:incomplete =~ '^\s*$' - return [] - endif - - - let result = [] - if b:dotexpr !~ '^\s*$' - if b:context_type == s:CONTEXT_AFTER_DOT - let result = s:CompleteAfterDot(b:dotexpr) - elseif b:context_type == s:CONTEXT_IMPORT || b:context_type == s:CONTEXT_IMPORT_STATIC || b:context_type == s:CONTEXT_PACKAGE_DECL || b:context_type == s:CONTEXT_NEED_TYPE - let result = s:GetMembers(b:dotexpr[:-2]) - elseif b:context_type == s:CONTEXT_METHOD_PARAM - if b:incomplete == '+' - let result = s:GetConstructorList(b:dotexpr) - else - let result = s:CompleteAfterDot(b:dotexpr) - endif - endif - - " only incomplete word - elseif b:incomplete !~ '^\s*$' - " only need methods - if b:context_type == s:CONTEXT_METHOD_PARAM - let methods = s:SearchForName(b:incomplete, 0, 1)[1] - call extend(result, eval('[' . s:DoGetMethodList(methods) . ']')) - - else - let result = s:CompleteAfterWord(b:incomplete) - endif - - " then no filter needed - let b:incomplete = '' - endif - - - if len(result) > 0 - " filter according to b:incomplete - if len(b:incomplete) > 0 && b:incomplete != '+' - let result = filter(result, "type(v:val) == type('') ? v:val =~ '^" . b:incomplete . "' : v:val['word'] =~ '^" . b:incomplete . "'") - endif - - if exists('s:padding') && !empty(s:padding) - for item in result - if type(item) == type("") - let item .= s:padding - else - let item.word .= s:padding - endif - endfor - unlet s:padding - endif - - call s:Debug('finish completion' . reltimestr(reltime(s:et_whole)) . 's') - return result - endif - - if strlen(b:errormsg) > 0 - echoerr 'javacomplete error: ' . b:errormsg - let b:errormsg = '' - endif -endfunction - -" Precondition: incomplete must be a word without '.'. -" return all the matched, variables, fields, methods, types, packages -fu! s:CompleteAfterWord(incomplete) - " packages in jar files - if !exists('s:all_packages_in_jars_loaded') - call s:DoGetInfoByReflection('-', '-P') - let s:all_packages_in_jars_loaded = 1 - endif - - let pkgs = [] - let types = [] - for key in keys(s:cache) - if key =~# '^' . a:incomplete - if type(s:cache[key]) == type('') || get(s:cache[key], 'tag', '') == 'PACKAGE' - call add(pkgs, {'kind': 'P', 'word': key}) - - " filter out type info - elseif b:context_type != s:CONTEXT_PACKAGE_DECL && b:context_type != s:CONTEXT_IMPORT && b:context_type != s:CONTEXT_IMPORT_STATIC - call add(types, {'kind': 'C', 'word': key}) - endif - endif - endfor - - let pkgs += s:DoGetPackageInfoInDirs(a:incomplete, b:context_type == s:CONTEXT_PACKAGE_DECL, 1) - - - " add accessible types which name beginning with the incomplete in source files - " TODO: remove the inaccessible - if b:context_type != s:CONTEXT_PACKAGE_DECL - " single type import - for fqn in s:GetImports('imports_fqn') - let name = fqn[strridx(fqn, ".")+1:] - if name =~ '^' . a:incomplete - call add(types, {'kind': 'C', 'word': name}) - endif - endfor - - " current file - let lnum_old = line('.') - let col_old = col('.') - call cursor(1, 1) - while 1 - let lnum = search('\<\C\(class\|interface\|enum\)[ \t\n\r]\+' . a:incomplete . '[a-zA-Z0-9_$]*[< \t\n\r]', 'W') - if lnum == 0 - break - elseif s:InCommentOrLiteral(line('.'), col('.')) - continue - else - normal w - call add(types, {'kind': 'C', 'word': matchstr(getline(line('.'))[col('.')-1:], s:RE_IDENTIFIER)}) - endif - endwhile - call cursor(lnum_old, col_old) - - " other files - let filepatterns = '' - for dirpath in s:GetSourceDirs(expand('%:p')) - let filepatterns .= escape(dirpath, ' \') . '/*.java ' - endfor - exe 'vimgrep /\s*' . s:RE_TYPE_DECL . '/jg ' . filepatterns - for item in getqflist() - if item.text !~ '^\s*\*\s\+' - let text = matchstr(s:Prune(item.text, -1), '\s*' . s:RE_TYPE_DECL) - if text != '' - let subs = split(substitute(text, '\s*' . s:RE_TYPE_DECL, '\1;\2;\3', ''), ';', 1) - if subs[2] =~# '^' . a:incomplete && (subs[0] =~ '\C\<public\>' || fnamemodify(bufname(item.bufnr), ':p:h') == expand('%:p:h')) - call add(types, {'kind': 'C', 'word': subs[2]}) - endif - endif - endif - endfor - endif - - - let result = [] - - " add variables and members in source files - if b:context_type == s:CONTEXT_AFTER_DOT - let matches = s:SearchForName(a:incomplete, 0, 0) - let result += sort(eval('[' . s:DoGetFieldList(matches[2]) . ']')) - let result += sort(eval('[' . s:DoGetMethodList(matches[1]) . ']')) - endif - let result += sort(pkgs) - let result += sort(types) - - return result -endfu - - -" Precondition: expr must end with '.' -" return members of the value of expression -function! s:CompleteAfterDot(expr) - let items = s:ParseExpr(a:expr) " TODO: return a dict containing more than items - if empty(items) - return [] - endif - - - " 0. String literal - call s:Info('P0. "str".|') - if items[-1] =~ '"$' - return s:GetMemberList("java.lang.String") - endif - - - let ti = {} - let ii = 1 " item index - let itemkind = 0 - - " - " optimized process - " - " search the longest expr consisting of ident - let i = 1 - let k = i - while i < len(items) && items[i] =~ '^\s*' . s:RE_IDENTIFIER . '\s*$' - let ident = substitute(items[i], '\s', '', 'g') - if ident == 'class' || ident == 'this' || ident == 'super' - let k = i - " return when found other keywords - elseif s:IsKeyword(ident) - return [] - endif - let items[i] = substitute(items[i], '\s', '', 'g') - let i += 1 - endwhile - - if i > 1 - " cases: "this.|", "super.|", "ClassName.this.|", "ClassName.super.|", "TypeName.class.|" - if items[k] ==# 'class' || items[k] ==# 'this' || items[k] ==# 'super' - call s:Info('O1. ' . items[k] . ' ' . join(items[:k-1], '.')) - let ti = s:DoGetClassInfo(items[k] == 'class' ? 'java.lang.Class' : join(items[:k-1], '.')) - if !empty(ti) - let itemkind = items[k] ==# 'this' ? 1 : items[k] ==# 'super' ? 2 : 0 - let ii = k+1 - else - return [] - endif - - " case: "java.io.File.|" - else - let fqn = join(items[:i-1], '.') - let srcpath = join(s:GetSourceDirs(expand('%:p'), s:GetPackageName()), ',') - call s:Info('O2. ' . fqn) - call s:DoGetTypeInfoForFQN([fqn], srcpath) - if get(get(s:cache, fqn, {}), 'tag', '') == 'CLASSDEF' - let ti = s:cache[fqn] - let itemkind = 11 - let ii = i - endif - endif - endif - - - " - " first item - " - if empty(ti) - " cases: - " 1) "int.|", "void.|" - primitive type or pseudo-type, return `class` - " 2) "this.|", "super.|" - special reference - " 3) "var.|" - variable or field - " 4) "String.|" - type imported or defined locally - " 5) "java.|" - package - if items[0] =~ '^\s*' . s:RE_IDENTIFIER . '\s*$' - let ident = substitute(items[0], '\s', '', 'g') - - if s:IsKeyword(ident) - " 1) - call s:Info('F1. "' . ident . '.|"') - if ident ==# 'void' || s:IsBuiltinType(ident) - let ti = s:PRIMITIVE_TYPE_INFO - let itemkind = 11 - - " 2) - call s:Info('F2. "' . ident . '.|"') - elseif ident ==# 'this' || ident ==# 'super' - let itemkind = ident ==# 'this' ? 1 : ident ==# 'super' ? 2 : 0 - let ti = s:DoGetClassInfo(ident) - endif - - else - " 3) - let typename = s:GetDeclaredClassName(ident) - call s:Info('F3. "' . ident . '.|" typename: "' . typename . '"') - if (typename != '') - if typename[0] == '[' || typename[-1:] == ']' - let ti = s:ARRAY_TYPE_INFO - elseif typename != 'void' && !s:IsBuiltinType(typename) - let ti = s:DoGetClassInfo(typename) - endif - - else - " 4) - call s:Info('F4. "TypeName.|"') - let ti = s:DoGetClassInfo(ident) - let itemkind = 11 - - if get(ti, 'tag', '') != 'CLASSDEF' - let ti = {} - endif - - " 5) - if empty(ti) - call s:Info('F5. "package.|"') - unlet ti - let ti = s:GetMembers(ident) " s:DoGetPackegInfo(ident) - let itemkind = 20 - endif - endif - endif - - " method invocation: "method().|" - "this.method().|" - elseif items[0] =~ '^\s*' . s:RE_IDENTIFIER . '\s*(' - let ti = s:MethodInvocation(items[0], ti, itemkind) - - " array type, return `class`: "int[] [].|", "java.lang.String[].|", "NestedClass[].|" - elseif items[0] =~# s:RE_ARRAY_TYPE - call s:Info('array type. "' . items[0] . '"') - let qid = substitute(items[0], s:RE_ARRAY_TYPE, '\1', '') - if s:IsBuiltinType(qid) || (!s:HasKeyword(qid) && !empty(s:DoGetClassInfo(qid))) - let ti = s:PRIMITIVE_TYPE_INFO - let itemkind = 11 - endif - - " class instance creation expr: "new String().|", "new NonLoadableClass().|" - " array creation expr: "new int[i=1] [val()].|", "new java.lang.String[].|" - elseif items[0] =~ '^\s*new\s\+' - call s:Info('creation expr. "' . items[0] . '"') - let subs = split(substitute(items[0], '^\s*new\s\+\(' .s:RE_QUALID. '\)\s*\([([]\)', '\1;\2', ''), ';') - if subs[1][0] == '[' - let ti = s:ARRAY_TYPE_INFO - elseif subs[1][0] == '(' - let ti = s:DoGetClassInfo(subs[0]) - " exclude interfaces and abstract class. TODO: exclude the inaccessible - if get(ti, 'flags', '')[-10:-10] || get(ti, 'flags', '')[-11:-11] - echo 'cannot instantiate the type ' . subs[0] - let ti = {} - return [] - endif - endif - - " casting conversion: "(Object)o.|" - elseif items[0] =~ s:RE_CASTING - call s:Info('Casting conversion. "' . items[0] . '"') - let subs = split(substitute(items[0], s:RE_CASTING, '\1;\2', ''), ';') - let ti = s:DoGetClassInfo(subs[0]) - - " array access: "var[i][j].|" Note: "var[i][]" is incorrect - elseif items[0] =~# s:RE_ARRAY_ACCESS - let subs = split(substitute(items[0], s:RE_ARRAY_ACCESS, '\1;\2', ''), ';') - if get(subs, 1, '') !~ s:RE_BRACKETS - let typename = s:GetDeclaredClassName(subs[0]) - call s:Info('ArrayAccess. "' .items[0]. '.|" typename: "' . typename . '"') - if (typename != '') - let ti = s:ArrayAccess(typename, items[0]) - endif - endif - endif - endif - - - " - " next items - " - while !empty(ti) && ii < len(items) - " method invocation: "PrimaryExpr.method(parameters)[].|" - if items[ii] =~ '^\s*' . s:RE_IDENTIFIER . '\s*(' - let ti = s:MethodInvocation(items[ii], ti, itemkind) - let itemkind = 0 - let ii += 1 - continue - - - " expression of selection, field access, array access - elseif items[ii] =~ s:RE_SELECT_OR_ACCESS - let subs = split(substitute(items[ii], s:RE_SELECT_OR_ACCESS, '\1;\2', ''), ';') - let ident = subs[0] - let brackets = get(subs, 1, '') - - " package members - if itemkind/10 == 2 && empty(brackets) && !s:IsKeyword(ident) - let qn = join(items[:ii], '.') - if type(ti) == type([]) - let idx = s:Index(ti, ident, 'word') - if idx >= 0 - if ti[idx].kind == 'P' - unlet ti - let ti = s:GetMembers(qn) - let ii += 1 - continue - elseif ti[idx].kind == 'C' - unlet ti - let ti = s:DoGetClassInfo(qn) - let itemkind = 11 - let ii += 1 - continue - endif - endif - endif - - - " type members - elseif itemkind/10 == 1 && empty(brackets) - if ident ==# 'class' || ident ==# 'this' || ident ==# 'super' - let ti = s:DoGetClassInfo(ident == 'class' ? 'java.lang.Class' : join(items[:ii-1], '.')) - let itemkind = ident ==# 'this' ? 1 : ident ==# 'super' ? 2 : 0 - let ii += 1 - continue - - elseif !s:IsKeyword(ident) && type(ti) == type({}) && get(ti, 'tag', '') == 'CLASSDEF' - " accessible static field - "let idx = s:Index(get(ti, 'fields', []), ident, 'n') - "if idx >= 0 && s:IsStatic(ti.fields[idx].m) - " let ti = s:ArrayAccess(ti.fields[idx].t, items[ii]) - let members = s:SearchMember(ti, ident, 1, itemkind, 1, 0) - if !empty(members[2]) - let ti = s:ArrayAccess(members[2][0].t, items[ii]) - let itemkind = 0 - let ii += 1 - continue - endif - - " accessible nested type - "if !empty(filter(copy(get(ti, 'classes', [])), 'strpart(v:val, strridx(v:val, ".")) ==# "' . ident . '"')) - if !empty(members[0]) - let ti = s:DoGetClassInfo(join(items[:ii], '.')) - let ii += 1 - continue - endif - endif - - - " instance members - elseif itemkind/10 == 0 && !s:IsKeyword(ident) - if type(ti) == type({}) && get(ti, 'tag', '') == 'CLASSDEF' - "let idx = s:Index(get(ti, 'fields', []), ident, 'n') - "if idx >= 0 - " let ti = s:ArrayAccess(ti.fields[idx].t, items[ii]) - let members = s:SearchMember(ti, ident, 1, itemkind, 1, 0) - let itemkind = 0 - if !empty(members[2]) - let ti = s:ArrayAccess(members[2][0].t, items[ii]) - let ii += 1 - continue - endif - endif - endif - endif - - return [] - endwhile - - - " type info or package info --> members - if !empty(ti) - if type(ti) == type({}) - if get(ti, 'tag', '') == 'CLASSDEF' - if get(ti, 'name', '') == '!' - return [{'kind': 'f', 'word': 'class', 'menu': 'Class'}] - elseif get(ti, 'name', '') == '[' - return s:ARRAY_TYPE_MEMBERS - elseif itemkind < 20 - return s:DoGetMemberList(ti, itemkind) - endif - elseif get(ti, 'tag', '') == 'PACKAGE' - " TODO: ti -> members, in addition to packages in dirs - return s:GetMembers( substitute(join(items, '.'), '\s', '', 'g') ) - endif - elseif type(ti) == type([]) - return ti - endif - endif - - return [] -endfunction - - -fu! s:MethodInvocation(expr, ti, itemkind) - let subs = split(substitute(a:expr, '\s*\(' . s:RE_IDENTIFIER . '\)\s*\((.*\)', '\1;\2', ''), ';') - - " all methods matched - if empty(a:ti) - let methods = s:SearchForName(subs[0], 0, 1)[1] - elseif type(a:ti) == type({}) && get(a:ti, 'tag', '') == 'CLASSDEF' - let methods = s:SearchMember(a:ti, subs[0], 1, a:itemkind, 1, 0, a:itemkind == 2)[1] -" let methods = s:filter(get(a:ti, 'methods', []), 'item.n == "' . subs[0] . '"') -" if a:itemkind == 1 || a:itemkind == 2 -" let methods += s:filter(get(a:ti, 'declared_methods', []), 'item.n == "' . subs[0] . '"') -" endif - else - let methods = [] - endif - - let method = s:DetermineMethod(methods, subs[1]) - if !empty(method) - return s:ArrayAccess(method.r, a:expr) - endif - return {} -endfu - -fu! s:ArrayAccess(arraytype, expr) - if a:expr =~ s:RE_BRACKETS | return {} | endif - let typename = a:arraytype - - let dims = 0 - if typename[0] == '[' || typename[-1:] == ']' || a:expr[-1:] == ']' - let dims = s:CountDims(a:expr) - s:CountDims(typename) - if dims == 0 - let typename = matchstr(typename, s:RE_IDENTIFIER) - elseif dims < 0 - return s:ARRAY_TYPE_INFO - else - "echoerr 'dims exceeds' - endif - endif - if dims == 0 - if typename != 'void' && !s:IsBuiltinType(typename) - return s:DoGetClassInfo(typename) - endif - endif - return {} -endfu - - -" Quick information {{{1 -function! MyBalloonExpr() - if (searchdecl(v:beval_text, 1, 0) == 0) - return s:GetVariableDeclaration() - endif - return '' -" return 'Cursor is at line ' . v:beval_lnum . -" \', column ' . v:beval_col . -" \ ' of file ' . bufname(v:beval_bufnr) . -" \ ' on word "' . v:beval_text . '"' -endfunction -"set bexpr=MyBalloonExpr() -"set ballooneval - -" parameters information {{{1 -fu! javacomplete#CompleteParamsInfo(findstart, base) - if a:findstart - return col('.') - 1 - endif - - - let mi = s:GetMethodInvocationExpr(s:GetStatement()) - if empty(mi.method) - return [] - endif - - " TODO: how to determine overloaded functions - "let mi.params = s:EvalParams(mi.params) - if empty(mi.expr) - let methods = s:SearchForName(mi.method, 0, 1)[1] - let result = eval('[' . s:DoGetMethodList(methods) . ']') - elseif mi.method == '+' - let result = s:GetConstructorList(mi.expr) - else - let result = s:CompleteAfterDot(mi.expr) - endif - - if !empty(result) - if !empty(mi.method) && mi.method != '+' - let result = filter(result, "type(v:val) == type('') ? v:val ==# '" . mi.method . "' : v:val['word'] ==# '" . mi.method . "('") - endif - return result - endif -endfu - -" scanning and parsing {{{1 - -" Search back from the cursor position till meeting '{' or ';'. -" '{' means statement start, ';' means end of a previous statement. -" Return: statement before cursor -" Note: It's the base for parsing. And It's OK for most cases. -function! s:GetStatement() - if getline('.') =~ '^\s*\(import\|package\)\s\+' - return strpart(getline('.'), match(getline('.'), '\(import\|package\)'), col('.')-1) - endif - - let lnum_old = line('.') - let col_old = col('.') - - while 1 - if search('[{};]\|<%\|<%!', 'bW') == 0 - let lnum = 1 - let col = 1 - else - if s:InCommentOrLiteral(line('.'), col('.')) - continue - endif - - normal w - let lnum = line('.') - let col = col('.') - endif - break - endwhile - - silent call cursor(lnum_old, col_old) - return s:MergeLines(lnum, col, lnum_old, col_old) -endfunction - -fu! s:MergeLines(lnum, col, lnum_old, col_old) - let lnum = a:lnum - let col = a:col - - let str = '' - if lnum < a:lnum_old - let str = s:Prune(strpart(getline(lnum), a:col-1)) - let lnum += 1 - while lnum < a:lnum_old - let str .= s:Prune(getline(lnum)) - let lnum += 1 - endwhile - let col = 1 - endif - let lastline = strpart(getline(a:lnum_old), col-1, a:col_old-col) - let str .= s:Prune(lastline, col) - let str = s:RemoveBlockComments(str) - " generic in JAVA 5+ - while match(str, s:RE_TYPE_ARGUMENTS) != -1 - let str = substitute(str, '\(' . s:RE_TYPE_ARGUMENTS . '\)', '\=repeat(" ", len(submatch(1)))', 'g') - endwhile - let str = substitute(str, '\s\s\+', ' ', 'g') - let str = substitute(str, '\([.()]\)[ \t]\+', '\1', 'g') - let str = substitute(str, '[ \t]\+\([.()]\)', '\1', 'g') - return s:Trim(str) . matchstr(lastline, '\s*$') -endfu - -" Extract a clean expr, removing some non-necessary characters. -fu! s:ExtractCleanExpr(expr) - let cmd = substitute(a:expr, '[ \t\r\n]\+\([.()[\]]\)', '\1', 'g') - let cmd = substitute(cmd, '\([.()[\]]\)[ \t\r\n]\+', '\1', 'g') - - let pos = strlen(cmd)-1 - while pos >= 0 && cmd[pos] =~ '[a-zA-Z0-9_.)\]]' - if cmd[pos] == ')' - let pos = s:SearchPairBackward(cmd, pos, '(', ')') - elseif cmd[pos] == ']' - let pos = s:SearchPairBackward(cmd, pos, '[', ']') - endif - let pos -= 1 - endwhile - - " try looking back for "new" - let idx = match(strpart(cmd, 0, pos+1), '\<new[ \t\r\n]*$') - - return strpart(cmd, idx != -1 ? idx : pos+1) -endfu - -fu! s:ParseExpr(expr) - let items = [] - let s = 0 - " recognize ClassInstanceCreationExpr as a whole - let e = matchend(a:expr, '^\s*new\s\+' . s:RE_QUALID . '\s*[([]')-1 - if e < 0 - let e = match(a:expr, '[.([]') - endif - let isparen = 0 - while e >= 0 - if a:expr[e] == '.' - let subexpr = strpart(a:expr, s, e-s) - call extend(items, isparen ? s:ProcessParentheses(subexpr) : [subexpr]) - let isparen = 0 - let s = e + 1 - elseif a:expr[e] == '(' - let e = s:GetMatchedIndexEx(a:expr, e, '(', ')') - let isparen = 1 - if e < 0 - break - else - let e = matchend(a:expr, '^\s*[.[]', e+1)-1 - continue - endif - elseif a:expr[e] == '[' - let e = s:GetMatchedIndexEx(a:expr, e, '[', ']') - if e < 0 - break - else - let e = matchend(a:expr, '^\s*[.[]', e+1)-1 - continue - endif - endif - let e = match(a:expr, '[.([]', s) - endwhile - let tail = strpart(a:expr, s) - if tail !~ '^\s*$' - call extend(items, isparen ? s:ProcessParentheses(tail) : [tail]) - endif - - return items -endfu - -" Given optional argument, call s:ParseExpr() to parser the nonparentheses expr -fu! s:ProcessParentheses(expr, ...) - let s = matchend(a:expr, '^\s*(') - if s != -1 - let e = s:GetMatchedIndexEx(a:expr, s-1, '(', ')') - if e >= 0 - let tail = strpart(a:expr, e+1) - if tail =~ '^\s*[\=$' - return s:ProcessParentheses(strpart(a:expr, s, e-s), 1) - elseif tail =~ '^\s*\w' - return [strpart(a:expr, 0, e+1) . 'obj.'] - endif - endif - - " multi-dot-expr except for new expr - elseif a:0 > 0 && stridx(a:expr, '.') != match(a:expr, '\.\s*$') && a:expr !~ '^\s*new\s\+' - return s:ParseExpr(a:expr) - endif - return [a:expr] -endfu - -" return {'expr': , 'method': , 'params': } -fu! s:GetMethodInvocationExpr(expr) - let idx = strlen(a:expr)-1 - while idx >= 0 - if a:expr[idx] == '(' - break - elseif a:expr[idx] == ')' - let idx = s:SearchPairBackward(a:expr, idx, '(', ')') - elseif a:expr[idx] == ']' - let idx = s:SearchPairBackward(a:expr, idx, '[', ']') - endif - let idx -= 1 - endwhile - - let mi = {'expr': strpart(a:expr, 0, idx+1), 'method': '', 'params': strpart(a:expr, idx+1)} - let idx = match(mi.expr, '\<new\s\+' . s:RE_QUALID . '\s*(\s*$') - if idx >= 0 - let mi.method = '+' - let mi.expr = substitute(matchstr(strpart(mi.expr, idx+4), s:RE_QUALID), '\s', '', 'g') - else - let idx = match(mi.expr, '\<' . s:RE_IDENTIFIER . '\s*(\s*$') - if idx >= 0 - let subs = s:SplitAt(mi.expr, idx-1) - let mi.method = substitute(subs[1], '\s*(\s*$', '', '') - let mi.expr = s:ExtractCleanExpr(subs[0]) - endif - endif - return mi -endfu - -" imports {{{1 -function! s:GenerateImports() - let imports = [] - - let lnum_old = line('.') - let col_old = col('.') - call cursor(1, 1) - - if &ft == 'jsp' - while 1 - let lnum = search('\<import\s*=[''"]', 'W') - if (lnum == 0) - break - endif - - let str = getline(lnum) - if str =~ '<%\s*@\s*page\>' || str =~ '<jsp:\s*directive.page\>' - let str = substitute(str, '.*import=[''"]\([a-zA-Z0-9_$.*, \t]\+\)[''"].*', '\1', '') - for item in split(str, ',') - call add(imports, substitute(item, '\s', '', 'g')) - endfor - endif - endwhile - else - while 1 - let lnum = search('\<import\>', 'W') - if (lnum == 0) - break - elseif !s:InComment(line("."), col(".")-1) - normal w - " TODO: search semicolon or import keyword, excluding comment - let stat = matchstr(getline(lnum)[col('.')-1:], '\(static\s\+\)\?\(' .s:RE_QUALID. '\%(\s*\.\s*\*\)\?\)\s*;') - if !empty(stat) - call add(imports, stat[:-2]) - endif - endif - endwhile - endif - - call cursor(lnum_old, col_old) - return imports -endfunction - -fu! s:GetImports(kind, ...) - let filekey = a:0 > 0 && !empty(a:1) ? a:1 : s:GetCurrentFileKey() - let props = get(s:files, filekey, {}) - if !has_key(props, a:kind) - let props['imports'] = filekey == s:GetCurrentFileKey() ? s:GenerateImports() : props.unit.imports - let props['imports_static'] = [] - let props['imports_fqn'] = [] - let props['imports_star'] = ['java.lang.'] - if &ft == 'jsp' || filekey =~ '\.jsp$' - let props.imports_star += ['javax.servlet.', 'javax.servlet.http.', 'javax.servlet.jsp.'] - endif - - for import in props.imports - let subs = split(substitute(import, '^\s*\(static\s\+\)\?\(' .s:RE_QUALID. '\%(\s*\.\s*\*\)\?\)\s*$', '\1;\2', ''), ';', 1) - let qid = substitute(subs[1] , '\s', '', 'g') - if !empty(subs[0]) - call add(props.imports_static, qid) - elseif qid[-1:] == '*' - call add(props.imports_star, qid[:-2]) - else - call add(props.imports_fqn, qid) - endif - endfor - let s:files[filekey] = props - endif - return get(props, a:kind, []) -endfu - -" search for name in -" return the fqn matched -fu! s:SearchSingleTypeImport(name, fqns) - let matches = s:filter(a:fqns, 'item =~# ''\<' . a:name . '$''') - if len(matches) == 1 - return matches[0] - elseif !empty(matches) - echoerr 'Name "' . a:name . '" conflicts between ' . join(matches, ' and ') - return matches[0] - endif - return '' -endfu - -" search for name in static imports, return list of members with the same name -" return [types, methods, fields] -fu! s:SearchStaticImports(name, fullmatch) - let result = [[], [], []] - let candidates = [] " list of the canonical name - for item in s:GetImports('imports_static') - if item[-1:] == '*' " static import on demand - call add(candidates, item[:-3]) - elseif item[strridx(item, '.')+1:] ==# a:name - \ || (!a:fullmatch && item[strridx(item, '.')+1:] =~ '^' . a:name) - call add(candidates, item[:strridx(item, '.')]) - endif - endfor - if empty(candidates) - return result - endif - - - " read type info which are not in cache - let commalist = '' - for typename in candidates - if !has_key(s:cache, typename) - let commalist .= typename . ',' - endif - endfor - if commalist != '' - let res = s:RunReflection('-E', commalist, 's:SearchStaticImports in Batch') - if res =~ "^{'" - let dict = eval(res) - for key in keys(dict) - let s:cache[key] = s:Sort(dict[key]) - endfor - endif - endif - - " search in all candidates - for typename in candidates - let ti = get(s:cache, typename, 0) - if type(ti) == type({}) && get(ti, 'tag', '') == 'CLASSDEF' - let members = s:SearchMember(ti, a:name, a:fullmatch, 12, 1, 0) - let result[1] += members[1] - let result[2] += members[2] - "let pattern = 'item.n ' . (a:fullmatch ? '==# ''' : '=~# ''^') . a:name . ''' && s:IsStatic(item.m)' - "let result[1] += s:filter(get(ti, 'methods', []), pattern) - "let result[2] += s:filter(get(ti, 'fields', []), pattern) - else - " TODO: mark the wrong import declaration. - endif - endfor - return result -endfu - - -" search decl {{{1 -" Return: The declaration of identifier under the cursor -" Note: The type of a variable must be imported or a fqn. -function! s:GetVariableDeclaration() - let lnum_old = line('.') - let col_old = col('.') - - silent call search('[^a-zA-Z0-9$_.,?<>[\] \t\r\n]', 'bW') " call search('[{};(,]', 'b') - normal w - let lnum = line('.') - let col = col('.') - if (lnum == lnum_old && col == col_old) - return '' - endif - -" silent call search('[;){]') -" let lnum_end = line('.') -" let col_end = col('.') -" let declaration = '' -" while (lnum <= lnum_end) -" let declaration = declaration . getline(lnum) -" let lnum = lnum + 1 -" endwhile -" let declaration = strpart(declaration, col-1) -" let declaration = substitute(declaration, '\.[ \t]\+', '.', 'g') - - silent call cursor(lnum_old, col_old) - return s:MergeLines(lnum, col, lnum_old, col_old) -endfunction - -function! s:FoundClassDeclaration(type) - let lnum_old = line('.') - let col_old = col('.') - call cursor(1, 1) - while 1 - let lnum = search('\<\C\(class\|interface\|enum\)[ \t\n\r]\+' . a:type . '[< \t\n\r]', 'W') - if lnum == 0 || !s:InCommentOrLiteral(line('.'), col('.')) - break - endif - endwhile - - " search mainly for the cases: " class /* block comment */ Ident" - " " class // comment \n Ident " - if lnum == 0 - let found = 0 - while !found - let lnum = search('\<\C\(class\|interface\|enum\)[ \t\n\r]\+', 'W') - if lnum == 0 - break - elseif s:InCommentOrLiteral(line('.'), col('.')) - continue - else - normal w - " skip empty line - while getline(line('.'))[col('.')-1] == '' - normal w - endwhile - let lnum = line('.') - let col = col('.') - while 1 - if match(getline(lnum)[col-1:], '^[ \t\n\r]*' . a:type . '[< \t\n\r]') >= 0 - let found = 1 - " meets comment - elseif match(getline(lnum)[col-1:], '^[ \t\n\r]*\(//\|/\*\)') >= 0 - if getline(lnum)[col-1:col] == '//' - normal $eb - else - let lnum = search('\*\/', 'W') - if lnum == 0 - break - endif - normal web - endif - let lnum = line('.') - let col = col('.') - continue - endif - break - endwhile - endif - endwhile - endif - - silent call cursor(lnum_old, col_old) - return lnum -endfu - -fu! s:FoundClassLocally(type) - " current path - if globpath(expand('%:p:h'), a:type . '.java') != '' - return 1 - endif - - " - let srcpath = javacomplete#GetSourcePath(1) - let file = globpath(srcpath, substitute(fqn, '\.', '/', 'g') . '.java') - if file != '' - return 1 - endif - - return 0 -endfu - -" regexp samples: -" echo search('\(\(public\|protected|private\)[ \t\n\r]\+\)\?\(\(static\)[ \t\n\r]\+\)\?\(\<class\>\|\<interface\>\)[ \t\n\r]\+HelloWorld[^a-zA-Z0-9_$]', 'W') -" echo substitute(getline('.'), '.*\(\(public\|protected\|private\)[ \t\n\r]\+\)\?\(\(static\)[ \t\n\r]\+\)\?\(\<class\>\|\<interface\>\)\s\+\([a-zA-Z0-9_]\+\)\s\+\(\(implements\|extends\)\s\+\([^{]\+\)\)\?\s*{.*', '["\1", "\2", "\3", "\4", "\5", "\6", "\8", "\9"]', '') -" code sample: -function! s:GetClassDeclarationOf(type) - call cursor(1, 1) - let decl = [] - - let lnum = search('\(\<class\>\|\<interface\>\)[ \t\n\r]\+' . a:type . '[^a-zA-Z0-9_$]', 'W') - if (lnum != 0) - " TODO: search back for optional 'public | private' and 'static' - " join lines till to '{' - let lnum_end = search('{') - if (lnum_end != 0) - let str = '' - while (lnum <= lnum_end) - let str = str . getline(lnum) - let lnum = lnum + 1 - endwhile - - exe "let decl = " . substitute(str, '.*\(\<class\>\|\<interface\>\)\s\+\([a-zA-Z0-9_]\+\)\s\+\(\(implements\|extends\)\s\+\([^{]\+\)\)\?\s*{.*', '["\1", "\2", "\4", "\5"]', '') - endif - endif - - return decl -endfunction - -" return list -" 0 class | interface -" 1 name -" [2 implements | extends ] -" [3 parent list ] -function! s:GetThisClassDeclaration() - let lnum_old = line('.') - let col_old = col('.') - - while (1) - call search('\(\<class\C\>\|\<interface\C\>\|\<enum\C\>\)[ \t\r\n]\+', 'bW') - if !s:InComment(line("."), col(".")-1) - if getline('.')[col('.')-2] !~ '\S' - break - endif - end - endwhile - - " join lines till to '{' - let str = '' - let lnum = line('.') - call search('{') - let lnum_end = line('.') - while (lnum <= lnum_end) - let str = str . getline(lnum) - let lnum = lnum + 1 - endwhile - - - let declaration = substitute(str, '.*\(\<class\>\|\<interface\>\)\s\+\([a-zA-Z0-9_]\+\)\(\s\+\(implements\|extends\)\s\+\([^{]\+\)\)\?\s*{.*', '["\1", "\2", "\4", "\5"]', '') - call cursor(lnum_old, col_old) - if declaration !~ '^[' - echoerr 'Some error occurs when recognizing this class:' . declaration - return ['', ''] - endif - exe "let list = " . declaration - return list -endfunction - -" searches for name of a var or a field and determines the meaning {{{1 - -" The standard search order of a variable or field is as follows: -" 1. Local variables declared in the code block, for loop, or catch clause -" from current scope up to the most outer block, a method or an initialization block -" 2. Parameters if the code is in a method or ctor -" 3. Fields of the type -" 4. Accessible inherited fields. -" 5. If the type is a nested type, -" local variables of the enclosing block or fields of the enclosing class. -" Note that if the type is a static nested type, only static members of an enclosing block or class are searched -" Reapply this rule to the upper block and class enclosing the enclosing type recursively -" 6. Accessible static fields imported. -" It is allowed that several fields with the same name. - -" The standard search order of a method is as follows: -" 1. Methods of the type -" 2. Accessible inherited methods. -" 3. Methods of the enclosing class if the type is a nested type. -" 4. Accessible static methods imported. -" It is allowed that several methods with the same name and signature. - -" first return at once if found one. -" fullmatch 1 - equal, 0 - match beginning -" return [types, methods, fields, vars] -fu! s:SearchForName(name, first, fullmatch) - let result = [[], [], [], []] - if s:IsKeyword(a:name) - return result - endif - - " use java_parser.vim - if javacomplete#GetSearchdeclMethod() == 4 - " declared in current file - let unit = javacomplete#parse() - let targetPos = java_parser#MakePos(line('.')-1, col('.')-1) - let trees = s:SearchNameInAST(unit, a:name, targetPos, a:fullmatch) - for tree in trees - if tree.tag == 'VARDEF' - call add(result[2], tree) - elseif tree.tag == 'METHODDEF' - call add(result[1], tree) - elseif tree.tag == 'CLASSDEF' - call add(result[0], tree.name) - endif - endfor - - if a:first && result != [[], [], [], []] | return result | endif - - " Accessible inherited members - let type = get(s:SearchTypeAt(unit, targetPos), -1, {}) - if !empty(type) - let members = s:SearchMember(type, a:name, a:fullmatch, 2, 1, 0, 1) - let result[0] += members[0] - let result[1] += members[1] - let result[2] += members[2] -" "let ti = s:AddInheritedClassInfo({}, type) -" if !empty(ti) -" let comparator = a:fullmatch ? "=~# '^" : "==# '" -" let result[0] += s:filter(get(ti, 'classes', []), 'item ' . comparator . a:name . "'") -" let result[1] += s:filter(get(ti, 'methods', []), 'item.n ' . comparator . a:name . "'") -" let result[2] += s:filter(get(ti, 'fields', []), 'item.n ' . comparator . a:name . "'") -" if a:0 > 0 -" let result[1] += s:filter(get(ti, 'declared_methods', []), 'item.n ' . comparator . a:name . "'") -" let result[2] += s:filter(get(ti, 'declared_fields', []), 'item.n ' . comparator . a:name . "'") -" endif -" if a:first && result != [[], [], [], []] | return result | endif -" endif - endif - - " static import - let si = s:SearchStaticImports(a:name, a:fullmatch) - let result[1] += si[1] - let result[2] += si[2] - endif - return result -endfu - -" TODO: how to determine overloaded functions -fu! s:DetermineMethod(methods, parameters) - return get(a:methods, 0, {}) -endfu - -" Parser.GetType() in insenvim -function! s:GetDeclaredClassName(var) - let var = s:Trim(a:var) - call s:Trace('GetDeclaredClassName for "' . var . '"') - if var =~# '^\(this\|super\)$' - return var - endif - - - " Special handling for builtin objects in JSP - if &ft == 'jsp' - if get(s:JSP_BUILTIN_OBJECTS, a:var, '') != '' - return s:JSP_BUILTIN_OBJECTS[a:var] - endif - endif - - " use java_parser.vim - if javacomplete#GetSearchdeclMethod() == 4 - let variable = get(s:SearchForName(var, 1, 1)[2], -1, {}) - return get(variable, 'tag', '') == 'VARDEF' ? java_parser#type2Str(variable.vartype) : get(variable, 't', '') - endif - - - let ic = &ignorecase - setlocal noignorecase - - let searched = javacomplete#GetSearchdeclMethod() == 2 ? s:Searchdecl(var, 1, 0) : searchdecl(var, 1, 0) - if (searched == 0) - " code sample: - " String tmp; java. - " lang. String str, value; - " for (int i = 0, j = 0; i < 10; i++) { - " j = 0; - " } - let declaration = s:GetVariableDeclaration() - " Assume it a class member, and remove modifiers - let class = substitute(declaration, '^\(public\s\+\|protected\s\+\|private\s\+\|abstract\s\+\|static\s\+\|final\s\+\|native\s\+\)*', '', '') - let class = substitute(class, '\s*\([a-zA-Z0-9_.]\+\)\(\[\]\)\?\s\+.*', '\1\2', '') - let class = substitute(class, '\([a-zA-Z0-9_.]\)<.*', '\1', '') - call s:Info('class: "' . class . '" declaration: "' . declaration . '" for ' . a:var) - let &ignorecase = ic - if class != '' && class !=# a:var && class !=# 'import' && class !=# 'class' - return class - endif - endif - - let &ignorecase = ic - call s:Trace('GetDeclaredClassName: cannot find') - return '' -endfunction - -" using java_parser.vim {{{1 -" javacomplete#parse() {{{2 -fu! javacomplete#parse(...) - let filename = a:0 == 0 ? '%' : a:1 - - let changed = 0 - if filename == '%' - let filename = s:GetCurrentFileKey() - let props = get(s:files, filename, {}) - if get(props, 'changedtick', -1) != b:changedtick - let changed = 1 - let props.changedtick = b:changedtick - let lines = getline('^', '$') - endif - else - let props = get(s:files, filename, {}) - if get(props, 'modifiedtime', 0) != getftime(filename) - let changed = 1 - let props.modifiedtime = getftime(filename) - let lines = readfile(filename) - endif - endif - - if changed - call java_parser#InitParser(lines) - call java_parser#SetLogLevel(5) - let props.unit = java_parser#compilationUnit() - - let package = has_key(props.unit, 'package') ? props.unit.package . '.' : '' - call s:UpdateFQN(props.unit, package) - endif - let s:files[filename] = props - return props.unit -endfu - -" update fqn for toplevel types or nested types. -" not for local type or anonymous type -fu! s:UpdateFQN(tree, qn) - if a:tree.tag == 'TOPLEVEL' - for def in a:tree.types - call s:UpdateFQN(def, a:qn) - endfor - elseif a:tree.tag == 'CLASSDEF' - let a:tree.fqn = a:qn . a:tree.name - for def in a:tree.defs - if def.tag == 'CLASSDEF' - call s:UpdateFQN(def, a:tree.fqn . '.') - endif - endfor - endif -endfu - -" TreeVisitor {{{2 -fu! s:visitTree(tree, param) dict - if type(a:tree) == type({}) - exe get(self, get(a:tree, 'tag', ''), '') - elseif type(a:tree) == type([]) - for tree in a:tree - call self.visit(tree, a:param) - endfor - endif -endfu - -let s:TreeVisitor = {'visit': function('s:visitTree'), - \ 'TOPLEVEL' : 'call self.visit(a:tree.types, a:param)', - \ 'BLOCK' : 'let stats = a:tree.stats | if stats == [] | call java_parser#GotoPosition(a:tree.pos) | let stats = java_parser#block().stats | endif | call self.visit(stats, a:param)', - \ 'DOLOOP' : 'call self.visit(a:tree.body, a:param) | call self.visit(a:tree.cond, a:param)', - \ 'WHILELOOP' : 'call self.visit(a:tree.cond, a:param) | call self.visit(a:tree.body, a:param)', - \ 'FORLOOP' : 'call self.visit(a:tree.init, a:param) | call self.visit(a:tree.cond, a:param) | call self.visit(a:tree.step, a:param) | call self.visit(a:tree.body, a:param)', - \ 'FOREACHLOOP' : 'call self.visit(a:tree.var, a:param) | call self.visit(a:tree.expr, a:param) | call self.visit(a:tree.body, a:param)', - \ 'LABELLED' : 'call self.visit(a:tree.body, a:param)', - \ 'SWITCH' : 'call self.visit(a:tree.selector, a:param) | call self.visit(a:tree.cases, a:param)', - \ 'CASE' : 'call self.visit(a:tree.pat, a:param) | call self.visit(a:tree.stats, a:param)', - \ 'SYNCHRONIZED': 'call self.visit(a:tree.lock, a:param) | call self.visit(a:tree.body, a:param)', - \ 'TRY' : 'call self.visit(a:tree.body, a:param) | call self.visit(a:tree.catchers, a:param) | call self.visit(a:tree.finalizer, a:param) ', - \ 'CATCH' : 'call self.visit(a:tree.param,a:param) | call self.visit(a:tree.body, a:param)', - \ 'CONDEXPR' : 'call self.visit(a:tree.cond, a:param) | call self.visit(a:tree.truepart, a:param) | call self.visit(a:tree.falsepart, a:param)', - \ 'IF' : 'call self.visit(a:tree.cond, a:param) | call self.visit(a:tree.thenpart, a:param) | if has_key(a:tree, "elsepart") | call self.visit(a:tree.elsepart, a:param) | endif', - \ 'EXEC' : 'call self.visit(a:tree.expr, a:param)', - \ 'APPLY' : 'call self.visit(a:tree.meth, a:param) | call self.visit(a:tree.args, a:param)', - \ 'NEWCLASS' : 'call self.visit(a:tree.def, a:param)' - \} - -let s:TV_CMP_POS = 'a:tree.pos <= a:param.pos && a:param.pos <= get(a:tree, "endpos", -1)' -let s:TV_CMP_POS_BODY = 'has_key(a:tree, "body") && a:tree.body.pos <= a:param.pos && a:param.pos <= get(a:tree.body, "endpos", -1)' - -" Return a stack of enclosing types (including local or anonymous classes). -" Given the optional argument, return all (toplevel or static member) types besides enclosing types. -fu! s:SearchTypeAt(tree, targetPos, ...) - let s:TreeVisitor.CLASSDEF = 'if a:param.allNonLocal || ' . s:TV_CMP_POS . ' | call add(a:param.result, a:tree) | call self.visit(a:tree.defs, a:param) | endif' - let s:TreeVisitor.METHODDEF = 'if ' . s:TV_CMP_POS_BODY . ' | call self.visit(a:tree.body, a:param) | endif' - let s:TreeVisitor.VARDEF = 'if has_key(a:tree, "init") && !a:param.allNonLocal && ' . s:TV_CMP_POS . ' | call self.visit(a:tree.init, a:param) | endif' - - let result = [] - call s:TreeVisitor.visit(a:tree, {'result': result, 'pos': a:targetPos, 'allNonLocal': a:0 == 0 ? 0 : 1}) - return result -endfu - -" a:1 match beginning -" return a stack of matching name -fu! s:SearchNameInAST(tree, name, targetPos, fullmatch) - let comparator = a:fullmatch ? '==#' : '=~# "^" .' - let cmd = 'if a:tree.name ' .comparator. ' a:param.name | call add(a:param.result, a:tree) | endif' - let s:TreeVisitor.CLASSDEF = 'if ' . s:TV_CMP_POS . ' | ' . cmd . ' | call self.visit(a:tree.defs, a:param) | endif' - let s:TreeVisitor.METHODDEF = cmd . ' | if ' . s:TV_CMP_POS_BODY . ' | call self.visit(a:tree.params, a:param) | call self.visit(a:tree.body, a:param) | endif' - let s:TreeVisitor.VARDEF = cmd . ' | if has_key(a:tree, "init") && ' . s:TV_CMP_POS . ' | call self.visit(a:tree.init, a:param) | endif' - - let result = [] - call s:TreeVisitor.visit(a:tree, {'result': result, 'pos': a:targetPos, 'name': a:name}) - "call s:Info(a:name . ' ' . string(result) . ' line: ' . line('.') . ' col: ' . col('.')) . ' ' . a:targetPos - return result -endfu - - -" javacomplete#Searchdecl {{{2 -" TODO: -fu! javacomplete#Searchdecl() - let var = expand('<cword>') - - let line = line('.')-1 - let col = col('.')-1 - - - if var =~# '^\(this\|super\)$' - if &ft == 'jsp' - return '' - endif - - let matchs = s:SearchTypeAt(javacomplete#parse(), java_parser#MakePos(line, col)) - - let stat = s:GetStatement() - for t in matchs - if stat =~ t.name - let coor = java_parser#DecodePos(t.pos) - return var . '(' . (coor.line+1) . ',' . (coor.col) . ') ' . getline(coor.line+1) - endif - endfor - if len(matchs) > 0 - let coor = java_parser#DecodePos(matchs[len(matchs)-1].pos) - return var . '(' . (coor.line+1) . ',' . (coor.col) . ') ' . getline(coor.line+1) - endif - return '' - endif - - " Type.this. - " new Type() - " new Type(param1, param2) - " this.field - " super.field - - let s:log = [] - - - " It may be an imported class. - let imports = [] - for fqn in s:GetImports('imports_fqn') - if fqn =~# '\<' . var . '\>$' - call add(imports, fqn) - endif - endfor - if len(imports) > 1 - echoerr 'Imports conflicts between ' . join(imports, ' and ') - endif - - - " Search in this buffer - let matchs = s:SearchNameInAST(javacomplete#parse(), var, java_parser#MakePos(line, col), 1) - - - let hint = var . ' ' - if !empty(matchs) - let tree = matchs[len(matchs)-1] - let coor = java_parser#DecodePos(tree.pos) - let hint .= '(' . (coor.line+1) . ',' . (coor.col) . ') ' - let hint .= getline(coor.line+1) "string(tree) - else - for fqn in imports - let ci = s:DoGetClassInfo(fqn) - if !empty(ci) - let hint .= ' ' . fqn - endif - " TODO: get javadoc - endfor - - endif - return hint -endfu - - -" java {{{1 - -fu! s:IsBuiltinType(name) - return index(s:PRIMITIVE_TYPES, a:name) >= 0 -endfu - -fu! s:IsKeyword(name) - return index(s:KEYWORDS, a:name) >= 0 -endfu - -fu! s:HasKeyword(name) - return a:name =~# s:RE_KEYWORDS -endfu - -fu! s:TailOfQN(qn) - return a:qn[strridx(a:qn, '.')+1:] -endfu - -" options {{{1 -" Methods to search declaration {{{2 -" 1 - by builtin searchdecl() -" 2 - by special Searchdecl() -" 4 - by java_parser -fu! javacomplete#GetSearchdeclMethod() - if &ft == 'jsp' - return 1 - endif - return exists('s:searchdecl') ? s:searchdecl : 4 -endfu - -fu! javacomplete#SetSearchdeclMethod(method) - let s:searchdecl = a:method -endfu - -" JDK1.1 {{{2 -fu! javacomplete#UseJDK11() - let s:isjdk11 = 1 -endfu - -" java compiler {{{2 -fu! javacomplete#GetCompiler() - return exists('s:compiler') && s:compiler !~ '^\s*$' ? s:compiler : 'javac' -endfu - -fu! javacomplete#SetCompiler(compiler) - let s:compiler = a:compiler -endfu - -" jvm launcher {{{2 -fu! javacomplete#GetJVMLauncher() - return exists('s:interpreter') && s:interpreter !~ '^\s*$' ? s:interpreter : 'java' -endfu - -fu! javacomplete#SetJVMLauncher(interpreter) - if javacomplete#GetJVMLauncher() != a:interpreter - let s:cache = {} - endif - let s:interpreter = a:interpreter -endfu - -" sourcepath {{{2 -fu! javacomplete#AddSourcePath(s) - if !isdirectory(a:s) - echoerr 'invalid source path: ' . a:s - return - endif - let path = fnamemodify(a:s, ':p:h') - if !exists('s:sourcepath') - let s:sourcepath = [path] - elseif index(s:sourcepath, path) == -1 - call add(s:sourcepath, path) - endif -endfu - -fu! javacomplete#DelSourcePath(s) - if !exists('s:sourcepath') || !isdirectory(a:s)| return | endif - let idx = index(s:sourcepath, a:s) - if idx != -1 - call remove(s:sourcepath, idx) - endif -endfu - -fu! javacomplete#SetSourcePath(s) - let paths = type(a:s) == type([]) ? a:s : split(a:s, javacomplete#GetClassPathSep()) - let s:sourcepath = [] - for path in paths - if isdirectory(path) - call add(s:sourcepath, fnamemodify(path, ':p:h')) - endif - endfor -endfu - -" return the sourcepath. Given argument, add current path or default package root path -" NOTE: Avoid path duplicate, otherwise globpath() will return duplicate result. -fu! javacomplete#GetSourcePath(...) - return join(s:GetSourceDirs(a:0 > 0 && a:1 ? expand('%:p') : ''), s:PATH_SEP) -endfu - -fu! s:GetSourceDirs(filepath, ...) - let dirs = exists('s:sourcepath') ? s:sourcepath : [] - - if !empty(a:filepath) - let filepath = fnamemodify(a:filepath, ':p:h') - - " get source path according to file path and package name - let packageName = a:0 > 0 ? a:1 : s:GetPackageName() - if packageName != '' - let path = fnamemodify(substitute(filepath, packageName, '', 'g'), ':p:h') - if index(dirs, path) < 0 - call add(dirs, path) - endif - endif - - " Consider current path as a sourcepath - if index(dirs, filepath) < 0 - call add(dirs, filepath) - endif - endif - return dirs -endfu - -" classpath {{{2 -fu! javacomplete#AddClassPath(s) - if !isdirectory(a:s) - echoerr 'invalid classpath: ' . a:s - return - endif - - if !exists('s:classpath') - let s:classpath = [a:s] - elseif index(s:classpath, a:s) == -1 - call add(s:classpath, a:s) - endif - let s:cache = {} -endfu - -fu! javacomplete#DelClassPath(s) - if !exists('s:classpath') | return | endif - let idx = index(s:classpath, a:s) - if idx != -1 - call remove(s:classpath, idx) - endif -endfu - -fu! javacomplete#SetClassPath(s) - if type(a:s) == type("") - let s:classpath = split(a:s, javacomplete#GetClassPathSep()) - elseif type(a:s) == type([]) - let s:classpath = a:s - endif - let s:cache = {} -endfu - -fu! javacomplete#GetClassPathSep() - return s:PATH_SEP -endfu - -fu! javacomplete#GetClassPath() - return exists('s:classpath') ? join(s:classpath, javacomplete#GetClassPathSep()) : '' -endfu - -" s:GetClassPath() {{{2 -fu! s:GetClassPath() - let path = s:GetJavaCompleteClassPath() . javacomplete#GetClassPathSep() - - if &ft == 'jsp' - let path .= s:GetClassPathOfJsp() - endif - - if exists('b:classpath') && b:classpath !~ '^\s*$' - return path . b:classpath - endif - - if exists('s:classpath') - return path . javacomplete#GetClassPath() - endif - - if exists('g:java_classpath') && g:java_classpath !~ '^\s*$' - return path . g:java_classpath - endif - - return path . $CLASSPATH -endfu - -fu! s:GetJavaCompleteClassPath() - " remove *.class from wildignore if it exists, so that globpath doesn't ignore Reflection.class - " vim versions >= 702 can add the 1 flag to globpath which ignores '*.class" in wildingore - let has_class = 0 - if &wildignore =~# "*.class" - set wildignore-=*.class - let has_class = 1 - endif - - let classfile = globpath(&rtp, 'autoload/Reflection.class') - if classfile == '' - let classfile = globpath($HOME, 'Reflection.class') - endif - if classfile == '' - " try to find source file and compile to $HOME - let srcfile = globpath(&rtp, 'autoload/Reflection.java') - if srcfile != '' - exe '!' . javacomplete#GetCompiler() . ' -d "' . $HOME . '" "' . srcfile . '"' - let classfile = globpath($HOME, 'Reflection.class') - if classfile == '' - echo srcfile . ' can not be compiled. Please check it' - endif - else - echo 'No Reflection.class found in $HOME or any autoload directory of the &rtp. And no Reflection.java found in any autoload directory of the &rtp to compile.' - endif - endif - - " add *.class to wildignore if it existed before - if has_class == 1 - set wildignore+=*.class - endif - - return fnamemodify(classfile, ':p:h') -endfu - -fu! s:GetClassPathOfJsp() - if exists('b:classpath_jsp') - return b:classpath_jsp - endif - - let b:classpath_jsp = '' - let path = expand('%:p:h') - while 1 - if isdirectory(path . '/WEB-INF' ) - if isdirectory(path . '/WEB-INF/classes') - let b:classpath_jsp .= s:PATH_SEP . path . '/WEB-INF/classes' - endif - if isdirectory(path . '/WEB-INF/lib') - let libs = globpath(path . '/WEB-INF/lib', '*.jar') - if libs != '' - let b:classpath_jsp .= s:PATH_SEP . substitute(libs, "\n", s:PATH_SEP, 'g') - endif - endif - return b:classpath_jsp - endif - - let prev = path - let path = fnamemodify(path, ":p:h:h") - if path == prev - break - endif - endwhile - return '' -endfu - -" return only classpath which are directories -fu! s:GetClassDirs() - let dirs = [] - for path in split(s:GetClassPath(), s:PATH_SEP) - if isdirectory(path) - call add(dirs, fnamemodify(path, ':p:h')) - endif - endfor - return dirs -endfu - -" s:GetPackageName() {{{2 -fu! s:GetPackageName() - let lnum_old = line('.') - let col_old = col('.') - - call cursor(1, 1) - let lnum = search('^\s*package[ \t\r\n]\+\([a-zA-Z][a-zA-Z0-9.]*\);', 'w') - let packageName = substitute(getline(lnum), '^\s*package\s\+\([a-zA-Z][a-zA-Z0-9.]*\);', '\1', '') - - call cursor(lnum_old, col_old) - return packageName -endfu - -fu! s:IsStatic(modifier) - return a:modifier[strlen(a:modifier)-4] -endfu - -" utilities {{{1 -" Convert a file name into the unique form. -" Similar with fnamemodify(). NOTE that ':gs' should not be used. -fu! s:fnamecanonize(fname, mods) - return fnamemodify(a:fname, a:mods . ':gs?[\\/]\+?/?') -endfu - -" Similar with filter(), but returns a new list instead of operating in-place. -" `item` has the value of the current item. -fu! s:filter(expr, string) - if type(a:expr) == type([]) - let result = [] - for item in a:expr - if eval(a:string) - call add(result, item) - endif - endfor - return result - else - let result = {} - for item in items(a:expr) - if eval(a:string) - let result[item[0]] = item[1] - endif - endfor - return result - endif -endfu - -fu! s:Index(list, expr, key) - let i = 0 - while i < len(a:list) - if get(a:list[i], a:key, '') == a:expr - return i - endif - let i += 1 - endwhile - return -1 -endfu - -fu! s:Match(list, expr, key) - let i = 0 - while i < len(a:list) - if get(a:list[i], a:key, '') =~ a:expr - return i - endif - let i += 1 - endwhile - return -1 -endfu - -fu! s:KeepCursor(cmd) - let lnum_old = line('.') - let col_old = col('.') - exe a:cmd - call cursor(lnum_old, col_old) -endfu - -fu! s:InCommentOrLiteral(line, col) - if has("syntax") && &ft != 'jsp' - return synIDattr(synID(a:line, a:col, 1), "name") =~? '\(Comment\|String\|Character\)' - endif -endfu - -function! s:InComment(line, col) - if has("syntax") && &ft != 'jsp' - return synIDattr(synID(a:line, a:col, 1), "name") =~? 'comment' - endif -" if getline(a:line) =~ '\s*\*' -" return 1 -" endif -" let idx = strridx(getline(a:line), '//') -" if idx >= 0 && idx < a:col -" return 1 -" endif -" return 0 -endfunction - -" set string literal empty, remove comments, trim begining or ending spaces -" test case: ' sb. /* block comment*/ append( "stringliteral" ) // comment ' -function! s:Prune(str, ...) - if a:str =~ '^\s*$' | return '' | endif - - let str = substitute(a:str, '"\(\\\(["\\''ntbrf]\)\|[^"]\)*"', '""', 'g') - let str = substitute(str, '\/\/.*', '', 'g') - let str = s:RemoveBlockComments(str) - return a:0 > 0 ? str : str . ' ' -endfunction - -" Given argument, replace block comments with spaces of same number -fu! s:RemoveBlockComments(str, ...) - let result = a:str - let ib = match(result, '\/\*') - let ie = match(result, '\*\/') - while ib != -1 && ie != -1 && ib < ie - let result = strpart(result, 0, ib) . (a:0 == 0 ? ' ' : repeat(' ', ie-ib+2)) . result[ie+2: ] - let ib = match(result, '\/\*') - let ie = match(result, '\*\/') - endwhile - return result -endfu - -fu! s:Trim(str) - let str = substitute(a:str, '^\s*', '', '') - return substitute(str, '\s*$', '', '') -endfu - -fu! s:SplitAt(str, index) - return [strpart(a:str, 0, a:index+1), strpart(a:str, a:index+1)] -endfu - -" TODO: search pair used in string, like -" 'create(ao.fox("("), new String).foo().' -function! s:GetMatchedIndexEx(str, idx, one, another) - let pos = a:idx - while 0 <= pos && pos < len(a:str) - let pos = match(a:str, '['. a:one . escape(a:another, ']') .']', pos+1) - if pos != -1 - if a:str[pos] == a:one - let pos = s:GetMatchedIndexEx(a:str, pos, a:one, a:another) - elseif a:str[pos] == a:another - break - endif - endif - endwhile - return 0 <= pos && pos < len(a:str) ? pos : -3 -endfunction - -function! s:SearchPairBackward(str, idx, one, another) - let idx = a:idx - let n = 0 - while idx >= 0 - let idx -= 1 - if a:str[idx] == a:one - if n == 0 - break - endif - let n -= 1 - elseif a:str[idx] == a:another " nested - let n += 1 - endif - endwhile - return idx -endfunction - -fu! s:CountDims(str) - if match(a:str, '[[\]]') == -1 - return 0 - endif - - " int[] -> [I, String[] -> - let dims = len(matchstr(a:str, '^[\+')) - if dims == 0 - let idx = len(a:str)-1 - while idx >= 0 && a:str[idx] == ']' - let dims += 1 - let idx = s:SearchPairBackward(a:str, idx, '[', ']')-1 - endwhile - endif - return dims -endfu - -fu! s:GotoUpperBracket() - let searched = 0 - while (!searched) - call search('[{}]', 'bW') - if getline('.')[col('.')-1] == '}' - normal % - else - let searched = 1 - endif - endwhile -endfu - -" Improve recognition of variable declaration using my version of searchdecl() for accuracy reason. -" TODO: -fu! s:Searchdecl(name, ...) - let global = a:0 > 0 ? a:1 : 0 - let thisblock = a:0 > 1 ? a:2 : 1 - - call search('\<' . a:name . '\>', 'bW') - let lnum_old = line('.') - let col_old = col('.') - - call s:GotoUpperBracket() - let lnum_bracket = line('.') - let col_bracket = col('.') - call search('\<' . a:name . '\>', 'W', lnum_old) - if line('.') != lnum_old || col('.') != col_old - return 0 - endif - - " search globally - if global - call cursor(lnum_bracket, col_bracket) - " search backward - while (1) - if search('\([{}]\|\<' . a:name . '\>\)', 'bW') == 0 - break - endif - if s:InComment(line('.'), col('.')) "|| s:InStringLiteral() - continue - endif - let cword = expand('<cword>') - if cword == a:name - return 0 - endif - if getline('.')[col('.')-1] == '}' - normal % - endif - endwhile - - call cursor(lnum_old, col_old) - " search forward - call search('[{};]', 'W') - while (1) - if search('\([{}]\|\<' . a:name . '\>\)', 'W') == 0 - break - endif - if s:InComment(line('.'), col('.')) "|| s:InStringLiteral() - continue - endif - let cword = expand('<cword>') - if cword == a:name - return 0 - endif - if getline('.')[col('.')-1] == '{' - normal % - endif - endwhile - endif - return 1 -endfu -"nmap <F8> :call <SID>Searchdecl(expand('<cword>'))<CR> - -fu! javacomplete#Exe(cmd) - exe a:cmd -endfu - -" cache utilities {{{1 - -" key of s:files for current buffer. It may be the full path of current file or the bufnr of unnamed buffer, and is updated when BufEnter, BufLeave. -fu! s:GetCurrentFileKey() - return has("autocmd") ? s:curfilekey : empty(expand('%')) ? bufnr('%') : expand('%:p') -endfu - -fu! s:SetCurrentFileKey() - let s:curfilekey = empty(expand('%')) ? bufnr('%') : expand('%:p') -endfu - -call s:SetCurrentFileKey() -if has("autocmd") - autocmd BufEnter *.java call s:SetCurrentFileKey() - autocmd FileType java call s:SetCurrentFileKey() -endif - - -" Log utilities {{{1 -fu! s:WatchVariant(variant) - "echoerr a:variant -endfu - -" level -" 5 off/fatal -" 4 error -" 3 warn -" 2 info -" 1 debug -" 0 trace -fu! javacomplete#SetLogLevel(level) - let s:loglevel = a:level -endfu - -fu! javacomplete#GetLogLevel() - return exists('s:loglevel') ? s:loglevel : 3 -endfu - -fu! javacomplete#GetLogContent() - return s:log -endfu - -fu! s:Trace(msg) - call s:Log(0, a:msg) -endfu - -fu! s:Debug(msg) - call s:Log(1, a:msg) -endfu - -fu! s:Info(msg) - call s:Log(2, a:msg) -endfu - -fu! s:Log(level, key, ...) - if a:level >= javacomplete#GetLogLevel() - echo a:key - call add(s:log, a:key) - endif -endfu - -fu! s:System(cmd, caller) - call s:WatchVariant(a:cmd) - let t = reltime() - let res = system(a:cmd) - call s:Debug(reltimestr(reltime(t)) . 's to exec "' . a:cmd . '" by ' . a:caller) - return res -endfu - -" functions to get information {{{1 -" utilities {{{2 -fu! s:MemberCompare(m1, m2) - return a:m1['n'] == a:m2['n'] ? 0 : a:m1['n'] > a:m2['n'] ? 1 : -1 -endfu - -fu! s:Sort(ci) - let ci = a:ci - if has_key(ci, 'fields') - call sort(ci['fields'], 's:MemberCompare') - endif - if has_key(ci, 'methods') - call sort(ci['methods'], 's:MemberCompare') - endif - return ci -endfu - -" Function to run Reflection {{{2 -fu! s:RunReflection(option, args, log) - let classpath = '' - if !exists('s:isjdk11') - let classpath = ' -classpath "' . s:GetClassPath() . '" ' - endif - - let cmd = javacomplete#GetJVMLauncher() . classpath . ' Reflection ' . a:option . ' "' . a:args . '"' - return s:System(cmd, a:log) -endfu -" class information {{{2 - - -" The standard search order of a FQN is as follows: -" 1. a file-name toplevel type or static member type accessed by the file-name type declared in source files -" 2. other types declared in source files -" 3. an accessible loadable type. -" parameters: -" fqns - list of fqn -" srcpaths - a comma-separated list of directory names. -" a:1 - search all. -" return a dict of fqn -> type info -" precondition: -" NOTE: call expand() to convert path to standard form -fu! s:DoGetTypeInfoForFQN(fqns, srcpath, ...) - if empty(a:fqns) || empty(a:srcpath) - return - endif - - " 1 - let files = {} " fqn -> java file path - for fqn in a:fqns - " toplevel type - let filepath = globpath(a:srcpath, substitute(fqn, '\.', '/', 'g') . '.java') - if filepath != '' - let files[fqn] = expand(filepath) - - " nested type - elseif stridx(fqn, '.') >= 0 - let idents = split(fqn, '\.') - let i = len(idents)-2 - while i >= 0 - let filepath = globpath(a:srcpath, join(idents[:i], '/') . '.java') - if filepath != '' - let files[fqn] = expand(filepath) - break - endif - let i -= 1 - endwhile - endif - endfor - - - " 2 - let dirs = {} " dir.idents -> names of nested type - " dir.qfitems -> items of quick fix - " dir.fqn -> fqn - for fqn in a:fqns - if !has_key(files, fqn) - for path in split(a:srcpath, ',') - let idents = split(fqn, '\.') - let i = len(idents)-2 - while i >= 0 - let dirpath = path . '/' . join(idents[:i], '/') - " it is a package - if isdirectory(dirpath) - let dirs[fnamemodify(dirpath, ':p:h:gs?[\\/]\+?/?')] = {'fqn': fqn, 'idents': idents[i+1:]} - break - endif - let i -= 1 - endwhile - endfor - endif - endfor - - if !empty(dirs) - let items = {} " dir -> items of quick fix - - let filepatterns = '' - for dirpath in keys(dirs) - let filepatterns .= escape(dirpath, ' \') . '/*.java ' - endfor - - let cwd = fnamemodify(expand('%:p:h'), ':p:h:gs?[\\/]\+?/?') - exe 'vimgrep /\s*' . s:RE_TYPE_DECL . '/jg ' . filepatterns - for item in getqflist() - if item.text !~ '^\s*\*\s\+' - let text = matchstr(s:Prune(item.text, -1), '\s*' . s:RE_TYPE_DECL) - if text != '' - let subs = split(substitute(text, '\s*' . s:RE_TYPE_DECL, '\1;\2;\3', ''), ';', 1) - let dirpath = fnamemodify(bufname(item.bufnr), ':p:h:gs?[\\/]\+?/?') - let idents = dirs[dirpath].idents - if index(idents, subs[2]) >= 0 && (subs[0] =~ '\C\<public\>' || dirpath == cwd) " FIXME? - let item.subs = subs - let dirs[dirpath].qfitems = get(dirs[dirpath], 'qfitems', []) + [item] - endif - endif - endif - endfor - - for dirpath in keys(dirs) - " a. names of nested type must be existed in the same file - " PackageName.NonFileNameTypeName.NestedType.NestedNestedType - let qfitems = get(dirs[dirpath], 'qfitems', []) - let nr = 0 - for ident in dirs[dirpath].idents - for item in qfitems - if item.subs[2] == ident - let nr += 1 - endif - endfor - endfor - if nr == len(dirs[dirpath].idents) - " b. TODO: Check whether one enclosed another is correct - let files[fqn] = expand(bufname(qfitems[0].bufnr)) - endif - endfor - endif - - - call s:Info('FQN1&2: ' . string(keys(files))) - for fqn in keys(files) - if !has_key(s:cache, fqn) || get(get(s:files, files[fqn], {}), 'modifiedtime', 0) != getftime(files[fqn]) - let ti = s:GetClassInfoFromSource(fqn[strridx(fqn, '.')+1:], files[fqn]) - if !empty(ti) - let s:cache[fqn] = s:Sort(ti) - endif - endif - if (a:0 == 0 || !a:1) - return - endif - endfor - - - " 3 - let commalist = '' - for fqn in a:fqns - if has_key(s:cache, fqn) && (a:0 == 0 || !a:1) - return - else "if stridx(fqn, '.') >= 0 - let commalist .= fqn . ',' - endif - endfor - if !empty(commalist) - let res = s:RunReflection('-E', commalist, 'DoGetTypeInfoForFQN in Batch') - if res =~ "^{'" - let dict = eval(res) - for key in keys(dict) - if !has_key(s:cache, key) - if type(dict[key]) == type({}) - let s:cache[key] = s:Sort(dict[key]) - elseif type(dict[key]) == type([]) - let s:cache[key] = sort(dict[key]) - endif - endif - endfor - endif - endif -endfu - -" a:1 filepath -" a:2 package name -fu! s:DoGetClassInfo(class, ...) - if has_key(s:cache, a:class) - return s:cache[a:class] - endif - - " array type: TypeName[] or '[I' or '[[Ljava.lang.String;' - if a:class[-1:] == ']' || a:class[0] == '[' - return s:ARRAY_TYPE_INFO - endif - - " either this or super is not qualified - if a:class == 'this' || a:class == 'super' - if &ft == 'jsp' - let ci = s:DoGetReflectionClassInfo('javax.servlet.jsp.HttpJspPage') - if a:class == 'this' - " TODO: search methods defined in <%! [declarations] %> - " search methods defined in other jsp files included - " avoid including self directly or indirectly - endif - return ci - endif - - call s:Info('A0. ' . a:class) - " this can be a local class or anonymous class as well as static type - let t = get(s:SearchTypeAt(javacomplete#parse(), java_parser#MakePos(line('.')-1, col('.')-1)), -1, {}) - if !empty(t) - " What will be returned for super? - " - the protected or public inherited fields and methods. No ctors. - " - the (public static) fields of interfaces. - " - the methods of the Object class. - " What will be returned for this? - " - besides the above, all fields and methods of current class. No ctors. - return s:Sort(s:Tree2ClassInfo(t)) - "return s:Sort(s:AddInheritedClassInfo(a:class == 'this' ? s:Tree2ClassInfo(t) : {}, t, 1)) - endif - - return {} - endif - - - if a:class !~ '^\s*' . s:RE_QUALID . '\s*$' || s:HasKeyword(a:class) - return {} - endif - - - let typename = substitute(a:class, '\s', '', 'g') - let filekey = a:0 > 0 ? a:1 : s:GetCurrentFileKey() - let packagename = a:0 > 1 ? a:2 : s:GetPackageName() - let srcpath = join(s:GetSourceDirs(a:0 > 0 && a:1 != bufnr('%') ? a:1 : expand('%:p'), packagename), ',') - - let names = split(typename, '\.') - " remove the package name if in the same packge - if len(names) > 1 - if packagename == join(names[:-2], '.') - let names = names[-1:] - endif - endif - - " a FQN - if len(names) > 1 - call s:DoGetTypeInfoForFQN([typename], srcpath) - let ci = get(s:cache, typename, {}) - if get(ci, 'tag', '') == 'CLASSDEF' - return s:cache[typename] - elseif get(ci, 'tag', '') == 'PACKAGE' - return {} - endif - endif - - - " The standard search order of a simple type name is as follows: - " 1. The current type including inherited types. - " 2. A nested type of the current type. - " 3. Explicitly named imported types (single type import). - " 4. Other types declared in the same package. Not only current directory. - " 5. Implicitly named imported types (import on demand). - - " 1 & 2. - " NOTE: inherited types are treated as normal - if filekey == s:GetCurrentFileKey() - let simplename = typename[strridx(typename, '.')+1:] - if s:FoundClassDeclaration(simplename) != 0 - call s:Info('A1&2') - let ci = s:GetClassInfoFromSource(simplename, '%') - " do not cache it - if !empty(ci) - return ci - endif - endif - else - let ci = s:GetClassInfoFromSource(typename, filekey) - if !empty(ci) - return ci - endif - endif - - " 3. - " NOTE: PackageName.Ident, TypeName.Ident - let fqn = s:SearchSingleTypeImport(typename, s:GetImports('imports_fqn', filekey)) - if !empty(fqn) - call s:Info('A3') - call s:DoGetTypeInfoForFQN([fqn], srcpath) - let ti = get(s:cache, fqn, {}) - if get(ti, 'tag', '') != 'CLASSDEF' - " TODO: mark the wrong import declaration. - endif - return ti - endif - - " 4 & 5 - " NOTE: Keeps the fqn of the same package first!! - call s:Info('A4&5') - let fqns = [empty(packagename) ? typename : packagename . '.' . typename] - for p in s:GetImports('imports_star', filekey) - call add(fqns, p . typename) - endfor - call s:DoGetTypeInfoForFQN(fqns, srcpath) - for fqn in fqns - if has_key(s:cache, fqn) - return get(s:cache[fqn], 'tag', '') == 'CLASSDEF' ? s:cache[fqn] : {} - endif - endfor - - return {} -endfu - -" Rules of overriding and hiding: -" 1. Fields cannot be overridden; they can only be hidden. -" In the subclass, the hidden field of superclass can no longer be accessed -" directly by its simple name. `super` or another reference must be used. -" 2. A method can be overriden only if it is accessible. -" When overriding methods, both the signature and return type must be the -" same as in the superclass. -" 3. Static members cannot be overridden; they can only be hidden -" -- whether a field or a method. But hiding static members has little effect, -" because static should be accessed via the name of its declaring class. -" Given optional argument, add protected, default (package) access, private members. -"fu! s:MergeClassInfo(ci, another, ...) -" if empty(a:another) | return a:ci | endif -" -" if empty(a:ci) -" let ci = copy(a:another) -"" if a:0 > 0 && a:1 -"" call extend(ci.fields, get(a:another, 'declared_fields', [])) -"" call extend(ci.methods, get(a:another, 'declared_methods', [])) -"" endif -" return ci -" endif -" -" call extend(a:ci.methods, a:another.methods) -" -" for f in a:another.fields -" if s:Index(a:ci.fields, f.n, 'n') < 0 -" call add(a:ci.fields, f) -" endif -" endfor -" return a:ci -"endfu - - -" Parameters: -" class the qualified class name -" Return: TClassInfo or {} when not found -" See ClassInfoFactory.getClassInfo() in insenvim. -function! s:DoGetReflectionClassInfo(fqn) - if !has_key(s:cache, a:fqn) - let res = s:RunReflection('-C', a:fqn, 's:DoGetReflectionClassInfo') - if res =~ '^{' - let s:cache[a:fqn] = s:Sort(eval(res)) - elseif res =~ '^[' - for type in eval(res) - if get(type, 'name', '') != '' - let s:cache[type.name] = s:Sort(type) - endif - endfor - else - let b:errormsg = res - endif - endif - return get(s:cache, a:fqn, {}) -endfunction - -fu! s:GetClassInfoFromSource(class, filename) - let ci = {} - if len(tagfiles()) > 0 - let ci = s:DoGetClassInfoFromTags(a:class) - endif - - if empty(ci) - call s:Info('Use java_parser.vim to generate class information') - let unit = javacomplete#parse(a:filename) - let targetPos = a:filename == '%' ? java_parser#MakePos(line('.')-1, col('.')-1) : -1 - for t in s:SearchTypeAt(unit, targetPos, 1) - if t.name == a:class - let t.filepath = a:filename == '%' ? s:GetCurrentFileKey() : expand(a:filename) - return s:Tree2ClassInfo(t) - "return s:AddInheritedClassInfo(s:Tree2ClassInfo(t), t) - endif - endfor - endif - return ci -endfu - -fu! s:Tree2ClassInfo(t) - let t = a:t - - " fill fields and methods - let t.fields = [] - let t.methods = [] - let t.ctors = [] - let t.classes = [] - for def in t.defs - if def.tag == 'METHODDEF' - call add(def.n == t.name ? t.ctors : t.methods, def) - elseif def.tag == 'VARDEF' - call add(t.fields, def) - elseif def.tag == 'CLASSDEF' - call add(t.classes, t.fqn . '.' . def.name) - endif - endfor - - " convert type name in extends to fqn for class defined in source files - if !has_key(a:t, 'classpath') && has_key(a:t, 'extends') - if has_key(a:t, 'filepath') && a:t.filepath != s:GetCurrentFileKey() - let filepath = a:t.filepath - let packagename = get(s:files[filepath].unit, 'package', '') - else - let filepath = expand('%:p') - let packagename = s:GetPackageName() - endif - - let extends = a:t.extends - let i = 0 - while i < len(extends) - let ci = s:DoGetClassInfo(java_parser#type2Str(extends[i]), filepath, packagename) - if has_key(ci, 'fqn') - let extends[i] = ci.fqn - endif - let i += 1 - endwhile - endif - - return t -endfu - -"fu! s:AddInheritedClassInfo(ci, t, ...) -" let ci = a:ci -" " add inherited fields and methods -" let list = [] -" for i in get(a:t, 'extends', []) -" call add(list, java_parser#type2Str(i)) -" endfor -" -" if has_key(a:t, 'filepath') && a:t.filepath != expand('%:p') -" let filepath = a:t.filepath -" let props = get(s:files, a:t.filepath, {}) -" let packagename = get(props.unit, 'package', '') -" else -" let filepath = expand('%:p') -" let packagename = s:GetPackageName() -" endif -" -" for id in list -" let ci = s:MergeClassInfo(ci, s:DoGetClassInfo(id, filepath, packagename), a:0 > 0 && a:1) -" endfor -" return ci -"endfu - -" To obtain information of the class in current file or current folder, or -" even in current project. -function! s:DoGetClassInfoFromTags(class) - " find tag of a:class declaration - let tags = taglist('^' . a:class) - let filename = '' - let cmd = '' - for tag in tags - if has_key(tag, 'kind') - if tag['kind'] == 'c' - let filename = tag['filename'] - let cmd = tag['cmd'] - break - endif - endif - endfor - - let tags = taglist('^' . (empty(b:incomplete) ? '.*' : b:incomplete) ) - if filename != '' - call filter(tags, "v:val['filename'] == '" . filename . "' && has_key(v:val, 'class') ? v:val['class'] == '" . a:class . "' : 1") - endif - - let ci = {'name': a:class} - " extends and implements - let ci['ctors'] = [] - let ci['fields'] = [] - let ci['methods'] = [] - - " members - for tag in tags - let member = {'n': tag['name']} - - " determine kind - let kind = 'm' - if has_key(tag, 'kind') - let kind = tag['kind'] - endif - - let cmd = tag['cmd'] - if cmd =~ '\<static\>' - let member['m'] = '1000' - else - let member['m'] = '' - endif - - let desc = substitute(cmd, '/^\s*', '', '') - let desc = substitute(desc, '\s*{\?\s*$/$', '', '') - - if kind == 'm' - " description - if cmd =~ '\<static\>' - let desc = substitute(desc, '\s\+static\s\+', ' ', '') - endif - let member['d'] = desc - - let member['p'] = '' - let member['r'] = '' - if tag['name'] == a:class - call add(ci['ctors'], member) - else - call add(ci['methods'], member) - endif - elseif kind == 'f' - let member['t'] = substitute(desc, '\([a-zA-Z0-9_[\]]\)\s\+\<' . tag['name'] . '\>.*$', '\1', '') - call add(ci['fields'], member) - endif - endfor - return ci -endfu - -" package information {{{2 - -fu! s:DoGetInfoByReflection(class, option) - if has_key(s:cache, a:class) - return s:cache[a:class] - endif - - let res = s:RunReflection(a:option, a:class, 's:DoGetInfoByReflection') - if res =~ '^[{\[]' - let v = eval(res) - if type(v) == type([]) - let s:cache[a:class] = sort(v) - elseif type(v) == type({}) - if get(v, 'tag', '') =~# '^\(PACKAGE\|CLASSDEF\)$' - let s:cache[a:class] = v - else - call extend(s:cache, v, 'force') - endif - endif - unlet v - else - let b:errormsg = res - endif - - return get(s:cache, a:class, {}) -endfu - -" search in members {{{2 -" TODO: what about default access? -" public for all -" protected for this or super -" private for this -fu! s:CanAccess(mods, kind) - return (a:mods[-4:-4] || a:kind/10 == 0) - \ && (a:kind == 1 || a:mods[-1:] - \ || (a:mods[-3:-3] && (a:kind == 1 || a:kind == 2)) - \ || (a:mods[-2:-2] && a:kind == 1)) -endfu - -fu! s:SearchMember(ci, name, fullmatch, kind, returnAll, memberkind, ...) - let result = [[], [], []] - - if a:kind != 13 - for m in (a:0 > 0 && a:1 ? [] : get(a:ci, 'fields', [])) + ((a:kind == 1 || a:kind == 2) ? get(a:ci, 'declared_fields', []) : []) - if empty(a:name) || (a:fullmatch ? m.n ==# a:name : m.n =~# '^' . a:name) - if s:CanAccess(m.m, a:kind) - call add(result[2], m) - endif - endif - endfor - - for m in (a:0 > 0 && a:1 ? [] : get(a:ci, 'methods', [])) + ((a:kind == 1 || a:kind == 2) ? get(a:ci, 'declared_methods', []) : []) - if empty(a:name) || (a:fullmatch ? m.n ==# a:name : m.n =~# '^' . a:name) - if s:CanAccess(m.m, a:kind) - call add(result[1], m) - endif - endif - endfor - endif - - if a:kind/10 != 0 - let types = get(a:ci, 'classes', []) - for t in types - if empty(a:name) || (a:fullmatch ? t[strridx(t, '.')+1:] ==# a:name : t[strridx(t, '.')+1:] =~# '^' . a:name) - if !has_key(s:cache, t) || !has_key(s:cache[t], 'flags') || a:kind == 1 || s:cache[t].flags[-1:] - call add(result[0], t) - endif - endif - endfor - endif - - " key `classpath` indicates it is a loaded class from classpath - " All public members of a loaded class are stored in current ci - if !has_key(a:ci, 'classpath') || (a:kind == 1 || a:kind == 2) - for i in get(a:ci, 'extends', []) - let ci = s:DoGetClassInfo(java_parser#type2Str(i)) - let members = s:SearchMember(ci, a:name, a:fullmatch, a:kind == 1 ? 2 : a:kind, a:returnAll, a:memberkind) - let result[0] += members[0] - let result[1] += members[1] - let result[2] += members[2] - endfor - endif - return result -endfu - - -" generate member list {{{2 - -fu! s:DoGetFieldList(fields) - let s = '' - for field in a:fields - let s .= "{'kind':'" . (s:IsStatic(field.m) ? "F" : "f") . "','word':'" . field.n . "','menu':'" . field.t . "','dup':1}," - endfor - return s -endfu - -fu! s:DoGetMethodList(methods, ...) - let paren = a:0 == 0 || !a:1 ? '(' : '' - let s = '' - for method in a:methods - let s .= "{'kind':'" . (s:IsStatic(method.m) ? "M" : "m") . "','word':'" . method.n . paren . "','abbr':'" . method.n . "()','menu':'" . method.d . "','dup':'1'}," - endfor - return s -endfu - -" kind: -" 0 - for instance, 1 - this, 2 - super, 3 - class, 4 - array, 5 - method result, 6 - primitive type -" 11 - for type, with `class` and static member and nested types. -" 12 - for import static, no lparen for static methods -" 13 - for import or extends or implements, only nested types -" 20 - for package -fu! s:DoGetMemberList(ci, kind) - if type(a:ci) != type({}) || a:ci == {} - return [] - endif - - let s = a:kind == 11 ? "{'kind': 'C', 'word': 'class', 'menu': 'Class'}," : '' - - let members = s:SearchMember(a:ci, '', 1, a:kind, 1, 0, a:kind == 2) - - " add accessible member types - if a:kind / 10 != 0 - " Use dup here for member type can share name with field. - for class in members[0] - "for class in get(a:ci, 'classes', []) - let v = get(s:cache, class, {}) - if v == {} || v.flags[-1:] - let s .= "{'kind': 'C', 'word': '" . substitute(class, a:ci.name . '\.', '\1', '') . "','dup':1}," - endif - endfor - endif - - if a:kind != 13 - let fieldlist = [] - let sfieldlist = [] - for field in members[2] - "for field in get(a:ci, 'fields', []) - if s:IsStatic(field['m']) - call add(sfieldlist, field) - elseif a:kind / 10 == 0 - call add(fieldlist, field) - endif - endfor - - let methodlist = [] - let smethodlist = [] - for method in members[1] - if s:IsStatic(method['m']) - call add(smethodlist, method) - elseif a:kind / 10 == 0 - call add(methodlist, method) - endif - endfor - - if a:kind / 10 == 0 - let s .= s:DoGetFieldList(fieldlist) - let s .= s:DoGetMethodList(methodlist) - endif - let s .= s:DoGetFieldList(sfieldlist) - let s .= s:DoGetMethodList(smethodlist, a:kind == 12) - - let s = substitute(s, '\<' . a:ci.name . '\.', '', 'g') - let s = substitute(s, '\<java\.lang\.', '', 'g') - let s = substitute(s, '\<\(public\|static\|synchronized\|transient\|volatile\|final\|strictfp\|serializable\|native\)\s\+', '', 'g') - endif - return eval('[' . s . ']') -endfu - -" interface {{{2 - -function! s:GetMemberList(class) - if s:IsBuiltinType(a:class) - return [] - endif - - return s:DoGetMemberList(s:DoGetClassInfo(a:class), 0) -endfunction - -fu! s:GetStaticMemberList(class) - return s:DoGetMemberList(s:DoGetClassInfo(a:class), 11) -endfu - -function! s:GetConstructorList(class) - let ci = s:DoGetClassInfo(a:class) - if empty(ci) - return [] - endif - - let s = '' - for ctor in get(ci, 'ctors', []) - let s .= "{'kind': '+', 'word':'". a:class . "(','abbr':'" . ctor.d . "','dup':1}," - endfor - - let s = substitute(s, '\<java\.lang\.', '', 'g') - let s = substitute(s, '\<public\s\+', '', 'g') - return eval('[' . s . ']') -endfunction - -" Name can be a (simple or qualified) package name, or a (simple or qualified) -" type name. -fu! s:GetMembers(fqn, ...) - let list = [] - let isClass = 0 - - let v = s:DoGetInfoByReflection(a:fqn, '-E') - if type(v) == type([]) - let list = v - elseif type(v) == type({}) && v != {} - if get(v, 'tag', '') == 'PACKAGE' - if b:context_type == s:CONTEXT_IMPORT_STATIC || b:context_type == s:CONTEXT_IMPORT - call add(list, {'kind': 'P', 'word': '*;'}) - endif - if b:context_type != s:CONTEXT_PACKAGE_DECL - for c in sort(get(v, 'classes', [])) - call add(list, {'kind': 'C', 'word': c}) - endfor - endif - for p in sort(get(v, 'subpackages', [])) - call add(list, {'kind': 'P', 'word': p}) - endfor - else " elseif get(v, 'tag', '') == 'CLASSDEF' - let isClass = 1 - let list += s:DoGetMemberList(v, b:context_type == s:CONTEXT_IMPORT || b:context_type == s:CONTEXT_NEED_TYPE ? 13 : b:context_type == s:CONTEXT_IMPORT_STATIC ? 12 : 11) - endif - endif - - if !isClass - let list += s:DoGetPackageInfoInDirs(a:fqn, b:context_type == s:CONTEXT_PACKAGE_DECL) - endif - - return list -endfu - -" a:1 incomplete mode -" return packages in classes directories or source pathes -fu! s:DoGetPackageInfoInDirs(package, onlyPackages, ...) - let list = [] - - let pathes = s:GetSourceDirs(expand('%:p')) - for path in s:GetClassDirs() - if index(pathes, path) <= 0 - call add(pathes, path) - endif - endfor - - let globpattern = a:0 > 0 ? a:package . '*' : substitute(a:package, '\.', '/', 'g') . '/*' - let matchpattern = a:0 > 0 ? a:package : a:package . '[\\/]' - for f in split(globpath(join(pathes, ','), globpattern), "\n") - for path in pathes - let idx = matchend(f, escape(path, ' \') . '[\\/]\?\C' . matchpattern) - if idx != -1 - let name = (a:0 > 0 ? a:package : '') . strpart(f, idx) - if f[-5:] == '.java' - if !a:onlyPackages - call add(list, {'kind': 'C', 'word': name[:-6]}) - endif - elseif name =~ '^' . s:RE_IDENTIFIER . '$' && isdirectory(f) && f !~# 'CVS$' - call add(list, {'kind': 'P', 'word': name}) - endif - endif - endfor - endfor - return list -endfu -" }}} -"}}} -" vim:set fdm=marker sw=2 nowrap: diff --git a/home/.vim/autoload/pythoncomplete.vim b/home/.vim/autoload/pythoncomplete.vim deleted file mode 100644 index 57add71..0000000 --- a/home/.vim/autoload/pythoncomplete.vim +++ /dev/null @@ -1,625 +0,0 @@ -"pythoncomplete.vim - Omni Completion for python -" Maintainer: Aaron Griffin <aaronmgriffin@gmail.com> -" Version: 0.9 -" Last Updated: 18 Jun 2009 -" -" Changes -" TODO: -" 'info' item output can use some formatting work -" Add an "unsafe eval" mode, to allow for return type evaluation -" Complete basic syntax along with import statements -" i.e. "import url<c-x,c-o>" -" Continue parsing on invalid line?? -" -" v 0.9 -" * Fixed docstring parsing for classes and functions -" * Fixed parsing of *args and **kwargs type arguments -" * Better function param parsing to handle things like tuples and -" lambda defaults args -" -" v 0.8 -" * Fixed an issue where the FIRST assignment was always used instead of -" using a subsequent assignment for a variable -" * Fixed a scoping issue when working inside a parameterless function -" -" -" v 0.7 -" * Fixed function list sorting (_ and __ at the bottom) -" * Removed newline removal from docs. It appears vim handles these better in -" recent patches -" -" v 0.6: -" * Fixed argument completion -" * Removed the 'kind' completions, as they are better indicated -" with real syntax -" * Added tuple assignment parsing (whoops, that was forgotten) -" * Fixed import handling when flattening scope -" -" v 0.5: -" Yeah, I skipped a version number - 0.4 was never public. -" It was a bugfix version on top of 0.3. This is a complete -" rewrite. -" - -if !has('python') - echo "Error: Required vim compiled with +python" - finish -endif - -function! pythoncomplete#Complete(findstart, base) - "findstart = 1 when we need to get the text length - if a:findstart == 1 - let line = getline('.') - let idx = col('.') - while idx > 0 - let idx -= 1 - let c = line[idx] - if c =~ '\w' - continue - elseif ! c =~ '\.' - let idx = -1 - break - else - break - endif - endwhile - - return idx - "findstart = 0 when we need to return the list of completions - else - "vim no longer moves the cursor upon completion... fix that - let line = getline('.') - let idx = col('.') - let cword = '' - while idx > 0 - let idx -= 1 - let c = line[idx] - if c =~ '\w' || c =~ '\.' - let cword = c . cword - continue - elseif strlen(cword) > 0 || idx == 0 - break - endif - endwhile - execute "python vimcomplete('" . cword . "', '" . a:base . "')" - return g:pythoncomplete_completions - endif -endfunction - -function! s:DefPython() -python << PYTHONEOF -import sys, tokenize, cStringIO, types -from token import NAME, DEDENT, NEWLINE, STRING - -debugstmts=[] -def dbg(s): debugstmts.append(s) -def showdbg(): - for d in debugstmts: print "DBG: %s " % d - -def vimcomplete(context,match): - global debugstmts - debugstmts = [] - try: - import vim - def complsort(x,y): - try: - xa = x['abbr'] - ya = y['abbr'] - if xa[0] == '_': - if xa[1] == '_' and ya[0:2] == '__': - return xa > ya - elif ya[0:2] == '__': - return -1 - elif y[0] == '_': - return xa > ya - else: - return 1 - elif ya[0] == '_': - return -1 - else: - return xa > ya - except: - return 0 - cmpl = Completer() - cmpl.evalsource('\n'.join(vim.current.buffer),vim.eval("line('.')")) - all = cmpl.get_completions(context,match) - all.sort(complsort) - dictstr = '[' - # have to do this for double quoting - for cmpl in all: - dictstr += '{' - for x in cmpl: dictstr += '"%s":"%s",' % (x,cmpl[x]) - dictstr += '"icase":0},' - if dictstr[-1] == ',': dictstr = dictstr[:-1] - dictstr += ']' - #dbg("dict: %s" % dictstr) - vim.command("silent let g:pythoncomplete_completions = %s" % dictstr) - #dbg("Completion dict:\n%s" % all) - except vim.error: - dbg("VIM Error: %s" % vim.error) - -class Completer(object): - def __init__(self): - self.compldict = {} - self.parser = PyParser() - - def evalsource(self,text,line=0): - sc = self.parser.parse(text,line) - src = sc.get_code() - dbg("source: %s" % src) - try: exec(src) in self.compldict - except: dbg("parser: %s, %s" % (sys.exc_info()[0],sys.exc_info()[1])) - for l in sc.locals: - try: exec(l) in self.compldict - except: dbg("locals: %s, %s [%s]" % (sys.exc_info()[0],sys.exc_info()[1],l)) - - def _cleanstr(self,doc): - return doc.replace('"',' ').replace("'",' ') - - def get_arguments(self,func_obj): - def _ctor(obj): - try: return class_ob.__init__.im_func - except AttributeError: - for base in class_ob.__bases__: - rc = _find_constructor(base) - if rc is not None: return rc - return None - - arg_offset = 1 - if type(func_obj) == types.ClassType: func_obj = _ctor(func_obj) - elif type(func_obj) == types.MethodType: func_obj = func_obj.im_func - else: arg_offset = 0 - - arg_text='' - if type(func_obj) in [types.FunctionType, types.LambdaType]: - try: - cd = func_obj.func_code - real_args = cd.co_varnames[arg_offset:cd.co_argcount] - defaults = func_obj.func_defaults or '' - defaults = map(lambda name: "=%s" % name, defaults) - defaults = [""] * (len(real_args)-len(defaults)) + defaults - items = map(lambda a,d: a+d, real_args, defaults) - if func_obj.func_code.co_flags & 0x4: - items.append("...") - if func_obj.func_code.co_flags & 0x8: - items.append("***") - arg_text = (','.join(items)) + ')' - - except: - dbg("arg completion: %s: %s" % (sys.exc_info()[0],sys.exc_info()[1])) - pass - if len(arg_text) == 0: - # The doc string sometimes contains the function signature - # this works for alot of C modules that are part of the - # standard library - doc = func_obj.__doc__ - if doc: - doc = doc.lstrip() - pos = doc.find('\n') - if pos > 0: - sigline = doc[:pos] - lidx = sigline.find('(') - ridx = sigline.find(')') - if lidx > 0 and ridx > 0: - arg_text = sigline[lidx+1:ridx] + ')' - if len(arg_text) == 0: arg_text = ')' - return arg_text - - def get_completions(self,context,match): - dbg("get_completions('%s','%s')" % (context,match)) - stmt = '' - if context: stmt += str(context) - if match: stmt += str(match) - try: - result = None - all = {} - ridx = stmt.rfind('.') - if len(stmt) > 0 and stmt[-1] == '(': - result = eval(_sanitize(stmt[:-1]), self.compldict) - doc = result.__doc__ - if doc is None: doc = '' - args = self.get_arguments(result) - return [{'word':self._cleanstr(args),'info':self._cleanstr(doc)}] - elif ridx == -1: - match = stmt - all = self.compldict - else: - match = stmt[ridx+1:] - stmt = _sanitize(stmt[:ridx]) - result = eval(stmt, self.compldict) - all = dir(result) - - dbg("completing: stmt:%s" % stmt) - completions = [] - - try: maindoc = result.__doc__ - except: maindoc = ' ' - if maindoc is None: maindoc = ' ' - for m in all: - if m == "_PyCmplNoType": continue #this is internal - try: - dbg('possible completion: %s' % m) - if m.find(match) == 0: - if result is None: inst = all[m] - else: inst = getattr(result,m) - try: doc = inst.__doc__ - except: doc = maindoc - typestr = str(inst) - if doc is None or doc == '': doc = maindoc - - wrd = m[len(match):] - c = {'word':wrd, 'abbr':m, 'info':self._cleanstr(doc)} - if "function" in typestr: - c['word'] += '(' - c['abbr'] += '(' + self._cleanstr(self.get_arguments(inst)) - elif "method" in typestr: - c['word'] += '(' - c['abbr'] += '(' + self._cleanstr(self.get_arguments(inst)) - elif "module" in typestr: - c['word'] += '.' - elif "class" in typestr: - c['word'] += '(' - c['abbr'] += '(' - completions.append(c) - except: - i = sys.exc_info() - dbg("inner completion: %s,%s [stmt='%s']" % (i[0],i[1],stmt)) - return completions - except: - i = sys.exc_info() - dbg("completion: %s,%s [stmt='%s']" % (i[0],i[1],stmt)) - return [] - -class Scope(object): - def __init__(self,name,indent,docstr=''): - self.subscopes = [] - self.docstr = docstr - self.locals = [] - self.parent = None - self.name = name - self.indent = indent - - def add(self,sub): - #print 'push scope: [%s@%s]' % (sub.name,sub.indent) - sub.parent = self - self.subscopes.append(sub) - return sub - - def doc(self,str): - """ Clean up a docstring """ - d = str.replace('\n',' ') - d = d.replace('\t',' ') - while d.find(' ') > -1: d = d.replace(' ',' ') - while d[0] in '"\'\t ': d = d[1:] - while d[-1] in '"\'\t ': d = d[:-1] - dbg("Scope(%s)::docstr = %s" % (self,d)) - self.docstr = d - - def local(self,loc): - self._checkexisting(loc) - self.locals.append(loc) - - def copy_decl(self,indent=0): - """ Copy a scope's declaration only, at the specified indent level - not local variables """ - return Scope(self.name,indent,self.docstr) - - def _checkexisting(self,test): - "Convienance function... keep out duplicates" - if test.find('=') > -1: - var = test.split('=')[0].strip() - for l in self.locals: - if l.find('=') > -1 and var == l.split('=')[0].strip(): - self.locals.remove(l) - - def get_code(self): - str = "" - if len(self.docstr) > 0: str += '"""'+self.docstr+'"""\n' - for l in self.locals: - if l.startswith('import'): str += l+'\n' - str += 'class _PyCmplNoType:\n def __getattr__(self,name):\n return None\n' - for sub in self.subscopes: - str += sub.get_code() - for l in self.locals: - if not l.startswith('import'): str += l+'\n' - - return str - - def pop(self,indent): - #print 'pop scope: [%s] to [%s]' % (self.indent,indent) - outer = self - while outer.parent != None and outer.indent >= indent: - outer = outer.parent - return outer - - def currentindent(self): - #print 'parse current indent: %s' % self.indent - return ' '*self.indent - - def childindent(self): - #print 'parse child indent: [%s]' % (self.indent+1) - return ' '*(self.indent+1) - -class Class(Scope): - def __init__(self, name, supers, indent, docstr=''): - Scope.__init__(self,name,indent, docstr) - self.supers = supers - def copy_decl(self,indent=0): - c = Class(self.name,self.supers,indent, self.docstr) - for s in self.subscopes: - c.add(s.copy_decl(indent+1)) - return c - def get_code(self): - str = '%sclass %s' % (self.currentindent(),self.name) - if len(self.supers) > 0: str += '(%s)' % ','.join(self.supers) - str += ':\n' - if len(self.docstr) > 0: str += self.childindent()+'"""'+self.docstr+'"""\n' - if len(self.subscopes) > 0: - for s in self.subscopes: str += s.get_code() - else: - str += '%spass\n' % self.childindent() - return str - - -class Function(Scope): - def __init__(self, name, params, indent, docstr=''): - Scope.__init__(self,name,indent, docstr) - self.params = params - def copy_decl(self,indent=0): - return Function(self.name,self.params,indent, self.docstr) - def get_code(self): - str = "%sdef %s(%s):\n" % \ - (self.currentindent(),self.name,','.join(self.params)) - if len(self.docstr) > 0: str += self.childindent()+'"""'+self.docstr+'"""\n' - str += "%spass\n" % self.childindent() - return str - -class PyParser: - def __init__(self): - self.top = Scope('global',0) - self.scope = self.top - - def _parsedotname(self,pre=None): - #returns (dottedname, nexttoken) - name = [] - if pre is None: - tokentype, token, indent = self.next() - if tokentype != NAME and token != '*': - return ('', token) - else: token = pre - name.append(token) - while True: - tokentype, token, indent = self.next() - if token != '.': break - tokentype, token, indent = self.next() - if tokentype != NAME: break - name.append(token) - return (".".join(name), token) - - def _parseimportlist(self): - imports = [] - while True: - name, token = self._parsedotname() - if not name: break - name2 = '' - if token == 'as': name2, token = self._parsedotname() - imports.append((name, name2)) - while token != "," and "\n" not in token: - tokentype, token, indent = self.next() - if token != ",": break - return imports - - def _parenparse(self): - name = '' - names = [] - level = 1 - while True: - tokentype, token, indent = self.next() - if token in (')', ',') and level == 1: - if '=' not in name: name = name.replace(' ', '') - names.append(name.strip()) - name = '' - if token == '(': - level += 1 - name += "(" - elif token == ')': - level -= 1 - if level == 0: break - else: name += ")" - elif token == ',' and level == 1: - pass - else: - name += "%s " % str(token) - return names - - def _parsefunction(self,indent): - self.scope=self.scope.pop(indent) - tokentype, fname, ind = self.next() - if tokentype != NAME: return None - - tokentype, open, ind = self.next() - if open != '(': return None - params=self._parenparse() - - tokentype, colon, ind = self.next() - if colon != ':': return None - - return Function(fname,params,indent) - - def _parseclass(self,indent): - self.scope=self.scope.pop(indent) - tokentype, cname, ind = self.next() - if tokentype != NAME: return None - - super = [] - tokentype, next, ind = self.next() - if next == '(': - super=self._parenparse() - elif next != ':': return None - - return Class(cname,super,indent) - - def _parseassignment(self): - assign='' - tokentype, token, indent = self.next() - if tokentype == tokenize.STRING or token == 'str': - return '""' - elif token == '(' or token == 'tuple': - return '()' - elif token == '[' or token == 'list': - return '[]' - elif token == '{' or token == 'dict': - return '{}' - elif tokentype == tokenize.NUMBER: - return '0' - elif token == 'open' or token == 'file': - return 'file' - elif token == 'None': - return '_PyCmplNoType()' - elif token == 'type': - return 'type(_PyCmplNoType)' #only for method resolution - else: - assign += token - level = 0 - while True: - tokentype, token, indent = self.next() - if token in ('(','{','['): - level += 1 - elif token in (']','}',')'): - level -= 1 - if level == 0: break - elif level == 0: - if token in (';','\n'): break - assign += token - return "%s" % assign - - def next(self): - type, token, (lineno, indent), end, self.parserline = self.gen.next() - if lineno == self.curline: - #print 'line found [%s] scope=%s' % (line.replace('\n',''),self.scope.name) - self.currentscope = self.scope - return (type, token, indent) - - def _adjustvisibility(self): - newscope = Scope('result',0) - scp = self.currentscope - while scp != None: - if type(scp) == Function: - slice = 0 - #Handle 'self' params - if scp.parent != None and type(scp.parent) == Class: - slice = 1 - newscope.local('%s = %s' % (scp.params[0],scp.parent.name)) - for p in scp.params[slice:]: - i = p.find('=') - if len(p) == 0: continue - pvar = '' - ptype = '' - if i == -1: - pvar = p - ptype = '_PyCmplNoType()' - else: - pvar = p[:i] - ptype = _sanitize(p[i+1:]) - if pvar.startswith('**'): - pvar = pvar[2:] - ptype = '{}' - elif pvar.startswith('*'): - pvar = pvar[1:] - ptype = '[]' - - newscope.local('%s = %s' % (pvar,ptype)) - - for s in scp.subscopes: - ns = s.copy_decl(0) - newscope.add(ns) - for l in scp.locals: newscope.local(l) - scp = scp.parent - - self.currentscope = newscope - return self.currentscope - - #p.parse(vim.current.buffer[:],vim.eval("line('.')")) - def parse(self,text,curline=0): - self.curline = int(curline) - buf = cStringIO.StringIO(''.join(text) + '\n') - self.gen = tokenize.generate_tokens(buf.readline) - self.currentscope = self.scope - - try: - freshscope=True - while True: - tokentype, token, indent = self.next() - #dbg( 'main: token=[%s] indent=[%s]' % (token,indent)) - - if tokentype == DEDENT or token == "pass": - self.scope = self.scope.pop(indent) - elif token == 'def': - func = self._parsefunction(indent) - if func is None: - print "function: syntax error..." - continue - dbg("new scope: function") - freshscope = True - self.scope = self.scope.add(func) - elif token == 'class': - cls = self._parseclass(indent) - if cls is None: - print "class: syntax error..." - continue - freshscope = True - dbg("new scope: class") - self.scope = self.scope.add(cls) - - elif token == 'import': - imports = self._parseimportlist() - for mod, alias in imports: - loc = "import %s" % mod - if len(alias) > 0: loc += " as %s" % alias - self.scope.local(loc) - freshscope = False - elif token == 'from': - mod, token = self._parsedotname() - if not mod or token != "import": - print "from: syntax error..." - continue - names = self._parseimportlist() - for name, alias in names: - loc = "from %s import %s" % (mod,name) - if len(alias) > 0: loc += " as %s" % alias - self.scope.local(loc) - freshscope = False - elif tokentype == STRING: - if freshscope: self.scope.doc(token) - elif tokentype == NAME: - name,token = self._parsedotname(token) - if token == '=': - stmt = self._parseassignment() - dbg("parseassignment: %s = %s" % (name, stmt)) - if stmt != None: - self.scope.local("%s = %s" % (name,stmt)) - freshscope = False - except StopIteration: #thrown on EOF - pass - except: - dbg("parse error: %s, %s @ %s" % - (sys.exc_info()[0], sys.exc_info()[1], self.parserline)) - return self._adjustvisibility() - -def _sanitize(str): - val = '' - level = 0 - for c in str: - if c in ('(','{','['): - level += 1 - elif c in (']','}',')'): - level -= 1 - elif level == 0: - val += c - return val - -sys.path.extend(['.','..']) -PYTHONEOF -endfunction - -call s:DefPython() -" vim: set et ts=4: diff --git a/home/.vim/autoload/xml/jsf_c.vim b/home/.vim/autoload/xml/jsf_c.vim deleted file mode 100644 index 5b3b7fd..0000000 --- a/home/.vim/autoload/xml/jsf_c.vim +++ /dev/null @@ -1,126 +0,0 @@ -let g:xmldata_jsf_c= { -\ 'param': [ -\ [], -\ { 'name' : [],'value' : [],'id' : [],'binding' : []} -\ ], -\ 'selectItem': [ -\ [], -\ { 'itemDescription' : [],'itemDisabled' : [],'itemLabel' : [],'itemValue' : [],'value' : [],'id' : [],'binding' : []} -\ ], -\ 'selectItems': [ -\ [], -\ { 'value' : [],'id' : [],'binding' : []} -\ ], -\ 'view': [ -\ [], -\ { 'locale' : []} -\ ], -\ 'convertDateTime': [ -\ [], -\ { 'dateStyle' : [],'locale' : [],'pattern' : [],'timeStyle' : [],'timeZone' : [],'type' : []} -\ ], -\ 'convertNumber': [ -\ [], -\ { 'currencyCode' : [],'currencySymbol' : [],'groupingUsed' : [],'integerOnly' : [],'locale' : [],'maxFractionDigits' : [],'maxIntegerDigits' : [],'minFractionDigits' : [],'minIntegerDigits' : [],'pattern' : [],'type' : []} -\ ], -\ 'validateDoubleRange': [ -\ [], -\ { 'maximum' : [],'minimum' : []} -\ ], -\ 'validateLength': [ -\ [], -\ { 'maximum' : [],'minimum' : []} -\ ], -\ 'validateLongRange': [ -\ [], -\ { 'maximum' : [],'minimum' : []} -\ ], -\ 'attribute': [ -\ [], -\ { 'name' : [],'value' : []} -\ ], -\ 'converter': [ -\ [], -\ { 'converterId' : []} -\ ], -\ 'facet': [ -\ [], -\ { 'name' : []} -\ ], -\ 'validator': [ -\ [], -\ { 'validatorId' : []} -\ ], -\ 'actionListener': [ -\ [], -\ { 'type' : []} -\ ], -\ 'loadBundle': [ -\ [], -\ { 'basename' : [],'var' : []} -\ ], -\ 'subview': [ -\ [], -\ { 'id' : [],'binding' : [],'rendered' : []} -\ ], -\ 'valueChangeListener': [ -\ [], -\ { 'type' : []} -\ ], -\ 'verbatim': [ -\ [], -\ { 'escape' : []} -\ ], -\ 'vimxmltaginfo': { -\ 'param' : [ ' ', 'This tag associates a parameter name-value pair with the nearest parent UIComponent. <p> A UIComponent is created to represent this name-value pair, and stored as a child of the parent component; what effect this has depends upon the renderer of that parent component. <p> Unless otherwise specified, all attributes accept static values or EL expressions. <p> See Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'selectItem' : [ ' ', 'A component representing a single option that the user can choose. <p> The option attributes can either be defined directly on this component (via the itemValue, itemLabel, itemDescription properties) or the value property can reference a SelectItem object (directly or via an EL expression). <p> The value expression (if defined) is read-only; the parent select component will have a value attribute specifying where the value for the chosen selection will be stored. <p> See Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'selectItems' : [ ' ', 'This tag associates a set of selection list items with the nearest parent UIComponent. The set of SelectItem objects is retrieved via a value-binding. <p> Unless otherwise specified, all attributes accept static values or EL expressions. <p> See Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'view' : [ ' ', 'Creates a JSF View, which is a container that holds all of the components that are part of the view. <p> Unless otherwise specified, all attributes accept static values or EL expressions. <p> See Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'convertDateTime' : [ ' ', 'This tag associates a date time converter with the nearest parent UIComponent. Unless otherwise specified, all attributes accept static values or EL expressions. see Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'convertNumber' : [ ' ', 'This tag creates a number formatting converter and associates it with the nearest parent UIComponent. Unless otherwise specified, all attributes accept static values or EL expressions. see Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'validateDoubleRange' : [ ' ', 'Creates a validator and associateds it with the nearest parent UIComponent. When invoked, the validator ensures that values are valid doubles that lie within the minimum and maximum values specified. Commonly associated with a h:inputText entity. Unless otherwise specified, all attributes accept static values or EL expressions. see Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'validateLength' : [ ' ', 'Creates a validator and associateds it with the nearest parent UIComponent. When invoked, the validator ensures that values are valid strings with a length that lies within the minimum and maximum values specified. Commonly associated with a h:inputText entity. Unless otherwise specified, all attributes accept static values or EL expressions. see Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'validateLongRange' : [ ' ', 'Creates a validator and associateds it with the nearest parent UIComponent. When invoked, the validator ensures that values are valid longs that lie within the minimum and maximum values specified. Commonly associated with a h:inputText entity. Unless otherwise specified, all attributes accept static values or EL expressions. see Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'attribute' : [ ' ', 'This tag associates an attribute with the nearest parent UIComponent. <p> When the value is not an EL expression, this tag has the same effect as calling component.getAttributes.put(name, value). When the attribute name specified matches a standard property of the component, that property is set. However it is also valid to assign attributes to components using any arbitrary name; the component itself won"t make any use of these but other objects such as custom renderers, validators or action listeners can later retrieve the attribute from the component by name. <p> When the value is an EL expression, this tag has the same effect as calling component.setValueBinding. A call to method component.getAttributes().get(name) will then cause that expression to be evaluated and the result of the expression is returned, not the original EL expression string. <p> See the javadoc for UIComponent.getAttributes for more details. <p> Unless otherwise specified, all attributes accept static values or EL expressions. see Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'converter' : [ ' ', 'This tag creates an instance of the specified Converter, and associates it with the nearest parent UIComponent. see Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'facet' : [ ' ', 'This tag adds its child as a facet of the nearest parent UIComponent. A child consisting of multiple elements should be nested within a container component (i.e., within an h:panelGroup for HTML library components). Unless otherwise specified, all attributes accept static values or EL expressions. see Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'validator' : [ ' ', 'Creates a validator and associates it with the nearest parent UIComponent. During the validation phase (or the apply-request-values phase for immediate components), if the associated component has any submitted value and the conversion of that value to the required type has succeeded then the specified validator type is invoked to test the validity of the converted value. <p> Commonly associated with an h:inputText entity, but may be applied to any input component. <p> Some validators may allow the component to use attributes to define component-specific validation constraints; see the f:attribute tag. See also the "validator" attribute of all input components, which allows a component to specify an arbitrary validation <i>method</i> (rather than a registered validation type, as this tag does). <p> Unless otherwise specified, all attributes accept static values or EL expressions. see Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'actionListener' : [ ' ', 'This tag creates an instance of the specified ActionListener, and associates it with the nearest parent UIComponent. Unless otherwise specified, all attributes accept static values or EL expressions.'], -\ 'loadBundle' : [ ' ', 'Loads a resource bundle and saves it as a variable in the request scope. Unless otherwise specified, all attributes accept static values or EL expressions.'], -\ 'subview' : [ ' ', 'This tag associates a set of UIComponents with the nearest parent UIComponent. It acts as a naming container to make the IDs of its component elements unique. Unless otherwise specified, all attributes accept static values or EL expressions.'], -\ 'valueChangeListener' : [ ' ', 'Adds the specified ValueChangeListener to the nearest parent UIComponent (which is expected to be a UIInput component). Whenever the form containing the parent UIComponent is submitted, an instance of the specified type is created. If the submitted value from the component is different from the component"s current value then a ValueChangeEvent is queued. When the ValueChangeEvent is processed (at end of the validate phase for non-immediate components, or at end of the apply-request-values phase for immediate components) the object"s processValueChange method is invoked. <p> Unless otherwise specified, all attributes accept static values or EL expressions.'], -\ 'verbatim' : [ ' ', 'Outputs its body as verbatim text. No JSP tags within the verbatim tag (including JSF tags) are evaluated; the content is treated simply as literal text to be copied to the response. <p> Unless otherwise specified, all attributes accept static values or EL expressions.'] -\ }, -\ 'vimxmlattrinfo': { -\ 'name' : [ ' ', 'A String containing the name of the parameter.'], -\ 'value' : [ ' ', 'The value of this parameter.'], -\ 'id' : [ ' ', 'An identifier for this particular component instance within a component view. <p> The id must be unique within the scope of the tag"s enclosing NamingContainer (eg h:form or f:subview). The id is not necessarily unique across all components in the current view </p> <p> This value must be a static value, ie not change over the lifetime of a component. It cannot be defined via an EL expression; only a string is permitted. </p>'], -\ 'binding' : [ ' ', 'Identifies a backing bean property (of type UIComponent or appropriate subclass) to bind to this component instance. This value must be an EL expression.'], -\ 'itemDescription' : [ ' ', 'An optional description for this item. For use in development tools.'], -\ 'itemDisabled' : [ ' ', 'Determine whether this item can be chosen by the user.'], -\ 'itemLabel' : [ ' ', 'Get the string which will be presented to the user for this option.'], -\ 'itemValue' : [ ' ', 'The value of this item, of the same type as the parent component"s value.'], -\ 'locale' : [ ' ', 'The locale of this view. Default: the default locale from the configuration file.'], -\ 'dateStyle' : [ ' ', 'The style of the date. Values include: default, short, medium, long, and full.'], -\ 'pattern' : [ ' ', 'A custom Date formatting pattern, in the format used by java.text.SimpleDateFormat.'], -\ 'timeStyle' : [ ' ', 'The style of the time. Values include: default, short, medium, long, and full.'], -\ 'timeZone' : [ ' ', 'The time zone to use instead of GMT (the default timezone). When this value is a value-binding to a TimeZone instance, that timezone is used. Otherwise this value is treated as a String containing a timezone id, ie as the ID parameter of method java.util.TimeZone.getTimeZone(String).'], -\ 'type' : [ ' ', 'Specifies whether the date, time, or both should be parsed/formatted. Values include: date, time, and both. Default based on setting of timeStyle and dateStyle.'], -\ 'currencyCode' : [ ' ', 'ISO 4217 currency code'], -\ 'currencySymbol' : [ ' ', 'The currency symbol used to format a currency value. Defaults to the currency symbol for locale.'], -\ 'groupingUsed' : [ ' ', 'Specifies whether output will contain grouping separators. Default: true.'], -\ 'integerOnly' : [ ' ', 'Specifies whether only the integer part of the input will be parsed. Default: false.'], -\ 'maxFractionDigits' : [ ' ', 'The maximum number of digits in the fractional portion of the number.'], -\ 'maxIntegerDigits' : [ ' ', 'The maximum number of digits in the integer portion of the number.'], -\ 'minFractionDigits' : [ ' ', 'The minimum number of digits in the fractional portion of the number.'], -\ 'minIntegerDigits' : [ ' ', 'The minimum number of digits in the integer portion of the number.'], -\ 'maximum' : [ ' ', 'The largest value that should be considered valid.'], -\ 'minimum' : [ ' ', 'The smallest value that should be considered valid.'], -\ 'converterId' : [ ' ', 'The converter"s registered ID.'], -\ 'validatorId' : [ ' ', 'The registered ID of the desired Validator.'], -\ 'basename' : [ ' ', 'The base name of the resource bundle.'], -\ 'var' : [ ' ', 'The name of the variable in request scope that the resources are saved to. This must be a static value.'], -\ 'rendered' : [ ' ', 'A boolean value that indicates whether this component should be rendered.'], -\ 'escape' : [ ' ', 'If true, generated markup is escaped. Default: false.'] -\ }, -\} diff --git a/home/.vim/autoload/xml/jsf_h.vim b/home/.vim/autoload/xml/jsf_h.vim deleted file mode 100644 index 62a950a..0000000 --- a/home/.vim/autoload/xml/jsf_h.vim +++ /dev/null @@ -1,222 +0,0 @@ -let g:xmldata_jsf_h= { -\ 'column': [ -\ [], -\ { 'id' : [],'rendered' : [],'binding' : []} -\ ], -\ 'inputHidden': [ -\ [], -\ { 'validator' : [],'valueChangeListener' : [],'immediate' : [],'required' : [],'converter' : [],'value' : [],'id' : [],'rendered' : [],'binding' : []} -\ ], -\ 'commandButton': [ -\ [], -\ { 'image' : [],'type' : [],'style' : [],'styleClass' : [],'alt' : [],'tabindex' : [],'onblur' : [],'onfocus' : [],'accesskey' : [],'onchange' : [],'onselect' : [],'onclick' : [],'ondblclick' : [],'onkeydown' : [],'onkeypress' : [],'onkeyup' : [],'onmousedown' : [],'onmousemove' : [],'onmouseout' : [],'onmouseover' : [],'onmouseup' : [],'dir' : [],'lang' : [],'title' : [],'disabled' : [],'readonly' : [],'action' : [],'actionListener' : [],'immediate' : [],'value' : [],'id' : [],'rendered' : [],'binding' : []} -\ ], -\ 'commandLink': [ -\ [], -\ { 'style' : [],'styleClass' : [],'tabindex' : [],'onblur' : [],'onfocus' : [],'accesskey' : [],'onclick' : [],'ondblclick' : [],'onkeydown' : [],'onkeypress' : [],'onkeyup' : [],'onmousedown' : [],'onmousemove' : [],'onmouseout' : [],'onmouseover' : [],'onmouseup' : [],'dir' : [],'lang' : [],'title' : [],'charset' : [],'coords' : [],'hreflang' : [],'rel' : [],'rev' : [],'shape' : [],'target' : [],'type' : [],'action' : [],'actionListener' : [],'immediate' : [],'value' : [],'id' : [],'rendered' : [],'binding' : []} -\ ], -\ 'dataTable': [ -\ [], -\ { 'bgcolor' : [],'border' : [],'cellpadding' : [],'cellspacing' : [],'columnClasses' : [],'footerClass' : [],'frame' : [],'headerClass' : [],'rowClasses' : [],'rules' : [],'summary' : [],'width' : [],'style' : [],'styleClass' : [],'onclick' : [],'ondblclick' : [],'onkeydown' : [],'onkeypress' : [],'onkeyup' : [],'onmousedown' : [],'onmousemove' : [],'onmouseout' : [],'onmouseover' : [],'onmouseup' : [],'dir' : [],'lang' : [],'title' : [],'var' : [],'first' : [],'rows' : [],'value' : [],'id' : [],'rendered' : [],'binding' : []} -\ ], -\ 'form': [ -\ [], -\ { 'accept' : [],'acceptcharset' : [],'enctype' : [],'onreset' : [],'onsubmit' : [],'target' : [],'style' : [],'styleClass' : [],'onclick' : [],'ondblclick' : [],'onkeydown' : [],'onkeypress' : [],'onkeyup' : [],'onmousedown' : [],'onmousemove' : [],'onmouseout' : [],'onmouseover' : [],'onmouseup' : [],'dir' : [],'lang' : [],'title' : [],'id' : [],'rendered' : [],'binding' : []} -\ ], -\ 'graphicImage': [ -\ [], -\ { 'height' : [],'ismap' : [],'longdesc' : [],'usemap' : [],'width' : [],'style' : [],'styleClass' : [],'alt' : [],'onclick' : [],'ondblclick' : [],'onkeydown' : [],'onkeypress' : [],'onkeyup' : [],'onmousedown' : [],'onmousemove' : [],'onmouseout' : [],'onmouseover' : [],'onmouseup' : [],'dir' : [],'lang' : [],'title' : [],'url' : [],'value' : [],'id' : [],'rendered' : [],'binding' : []} -\ ], -\ 'inputSecret': [ -\ [], -\ { 'maxlength' : [],'redisplay' : [],'size' : [],'style' : [],'styleClass' : [],'alt' : [],'tabindex' : [],'onblur' : [],'onfocus' : [],'accesskey' : [],'onchange' : [],'onselect' : [],'onclick' : [],'ondblclick' : [],'onkeydown' : [],'onkeypress' : [],'onkeyup' : [],'onmousedown' : [],'onmousemove' : [],'onmouseout' : [],'onmouseover' : [],'onmouseup' : [],'dir' : [],'lang' : [],'title' : [],'disabled' : [],'readonly' : [],'validator' : [],'valueChangeListener' : [],'immediate' : [],'required' : [],'converter' : [],'value' : [],'id' : [],'rendered' : [],'binding' : []} -\ ], -\ 'inputText': [ -\ [], -\ { 'maxlength' : [],'size' : [],'style' : [],'styleClass' : [],'alt' : [],'tabindex' : [],'onblur' : [],'onfocus' : [],'accesskey' : [],'onclick' : [],'ondblclick' : [],'onkeydown' : [],'onkeypress' : [],'onkeyup' : [],'onmousedown' : [],'onmousemove' : [],'onmouseout' : [],'onmouseover' : [],'onmouseup' : [],'onchange' : [],'onselect' : [],'dir' : [],'lang' : [],'title' : [],'disabled' : [],'readonly' : [],'validator' : [],'valueChangeListener' : [],'immediate' : [],'required' : [],'converter' : [],'value' : [],'id' : [],'rendered' : [],'binding' : []} -\ ], -\ 'inputTextarea': [ -\ [], -\ { 'cols' : [],'rows' : [],'style' : [],'styleClass' : [],'tabindex' : [],'onblur' : [],'onfocus' : [],'accesskey' : [],'onclick' : [],'ondblclick' : [],'onkeydown' : [],'onkeypress' : [],'onkeyup' : [],'onmousedown' : [],'onmousemove' : [],'onmouseout' : [],'onmouseover' : [],'onmouseup' : [],'onchange' : [],'onselect' : [],'dir' : [],'lang' : [],'title' : [],'disabled' : [],'readonly' : [],'validator' : [],'valueChangeListener' : [],'immediate' : [],'required' : [],'converter' : [],'value' : [],'id' : [],'rendered' : [],'binding' : []} -\ ], -\ 'message': [ -\ [], -\ { 'style' : [],'styleClass' : [],'errorClass' : [],'errorStyle' : [],'fatalClass' : [],'fatalStyle' : [],'infoClass' : [],'infoStyle' : [],'title' : [],'tooltip' : [],'warnClass' : [],'warnStyle' : [],'for' : [],'showDetail' : [],'showSummary' : [],'id' : [],'rendered' : [],'binding' : []} -\ ], -\ 'messages': [ -\ [], -\ { 'layout' : [],'style' : [],'styleClass' : [],'errorClass' : [],'errorStyle' : [],'fatalClass' : [],'fatalStyle' : [],'infoClass' : [],'infoStyle' : [],'title' : [],'tooltip' : [],'warnClass' : [],'warnStyle' : [],'globalOnly' : [],'showDetail' : [],'showSummary' : [],'id' : [],'rendered' : [],'binding' : []} -\ ], -\ 'outputFormat': [ -\ [], -\ { 'style' : [],'styleClass' : [],'title' : [],'escape' : [],'converter' : [],'value' : [],'id' : [],'rendered' : [],'binding' : []} -\ ], -\ 'outputLabel': [ -\ [], -\ { 'for' : [],'style' : [],'styleClass' : [],'tabindex' : [],'onblur' : [],'onfocus' : [],'accesskey' : [],'onclick' : [],'ondblclick' : [],'onkeydown' : [],'onkeypress' : [],'onkeyup' : [],'onmousedown' : [],'onmousemove' : [],'onmouseout' : [],'onmouseover' : [],'onmouseup' : [],'dir' : [],'lang' : [],'title' : [],'converter' : [],'value' : [],'id' : [],'rendered' : [],'binding' : []} -\ ], -\ 'outputLink': [ -\ [], -\ { 'style' : [],'styleClass' : [],'tabindex' : [],'onblur' : [],'onfocus' : [],'accesskey' : [],'onclick' : [],'ondblclick' : [],'onkeydown' : [],'onkeypress' : [],'onkeyup' : [],'onmousedown' : [],'onmousemove' : [],'onmouseout' : [],'onmouseover' : [],'onmouseup' : [],'dir' : [],'lang' : [],'title' : [],'charset' : [],'coords' : [],'hreflang' : [],'rel' : [],'rev' : [],'shape' : [],'target' : [],'type' : [],'converter' : [],'value' : [],'id' : [],'rendered' : [],'binding' : []} -\ ], -\ 'outputText': [ -\ [], -\ { 'style' : [],'styleClass' : [],'title' : [],'escape' : [],'converter' : [],'value' : [],'id' : [],'rendered' : [],'binding' : []} -\ ], -\ 'panelGrid': [ -\ [], -\ { 'bgcolor' : [],'border' : [],'cellpadding' : [],'cellspacing' : [],'columnClasses' : [],'columns' : [],'footerClass' : [],'frame' : [],'headerClass' : [],'rowClasses' : [],'rules' : [],'summary' : [],'width' : [],'style' : [],'styleClass' : [],'onclick' : [],'ondblclick' : [],'onkeydown' : [],'onkeypress' : [],'onkeyup' : [],'onmousedown' : [],'onmousemove' : [],'onmouseout' : [],'onmouseover' : [],'onmouseup' : [],'dir' : [],'lang' : [],'title' : [],'id' : [],'rendered' : [],'binding' : []} -\ ], -\ 'panelGroup': [ -\ [], -\ { 'style' : [],'styleClass' : [],'id' : [],'rendered' : [],'binding' : []} -\ ], -\ 'selectBooleanCheckbox': [ -\ [], -\ { 'style' : [],'styleClass' : [],'tabindex' : [],'onblur' : [],'onfocus' : [],'accesskey' : [],'onclick' : [],'ondblclick' : [],'onkeydown' : [],'onkeypress' : [],'onkeyup' : [],'onmousedown' : [],'onmousemove' : [],'onmouseout' : [],'onmouseover' : [],'onmouseup' : [],'onchange' : [],'onselect' : [],'dir' : [],'lang' : [],'title' : [],'disabled' : [],'readonly' : [],'value' : [],'validator' : [],'valueChangeListener' : [],'immediate' : [],'required' : [],'converter' : [],'id' : [],'rendered' : [],'binding' : []} -\ ], -\ 'selectManyCheckbox': [ -\ [], -\ { 'border' : [],'layout' : [],'style' : [],'styleClass' : [],'tabindex' : [],'onblur' : [],'onfocus' : [],'disabledClass' : [],'enabledClass' : [],'accesskey' : [],'onclick' : [],'ondblclick' : [],'onkeydown' : [],'onkeypress' : [],'onkeyup' : [],'onmousedown' : [],'onmousemove' : [],'onmouseout' : [],'onmouseover' : [],'onmouseup' : [],'onchange' : [],'onselect' : [],'dir' : [],'lang' : [],'title' : [],'disabled' : [],'readonly' : [],'validator' : [],'valueChangeListener' : [],'immediate' : [],'required' : [],'converter' : [],'value' : [],'id' : [],'rendered' : [],'binding' : []} -\ ], -\ 'selectManyListbox': [ -\ [], -\ { 'size' : [],'style' : [],'styleClass' : [],'tabindex' : [],'onblur' : [],'onfocus' : [],'disabledClass' : [],'enabledClass' : [],'accesskey' : [],'onclick' : [],'ondblclick' : [],'onkeydown' : [],'onkeypress' : [],'onkeyup' : [],'onmousedown' : [],'onmousemove' : [],'onmouseout' : [],'onmouseover' : [],'onmouseup' : [],'onchange' : [],'onselect' : [],'dir' : [],'lang' : [],'title' : [],'disabled' : [],'readonly' : [],'validator' : [],'valueChangeListener' : [],'immediate' : [],'required' : [],'converter' : [],'value' : [],'id' : [],'rendered' : [],'binding' : []} -\ ], -\ 'selectManyMenu': [ -\ [], -\ { 'style' : [],'styleClass' : [],'tabindex' : [],'onblur' : [],'onfocus' : [],'disabledClass' : [],'enabledClass' : [],'accesskey' : [],'onclick' : [],'ondblclick' : [],'onkeydown' : [],'onkeypress' : [],'onkeyup' : [],'onmousedown' : [],'onmousemove' : [],'onmouseout' : [],'onmouseover' : [],'onmouseup' : [],'onchange' : [],'onselect' : [],'dir' : [],'lang' : [],'title' : [],'disabled' : [],'readonly' : [],'validator' : [],'valueChangeListener' : [],'immediate' : [],'required' : [],'converter' : [],'value' : [],'id' : [],'rendered' : [],'binding' : []} -\ ], -\ 'selectOneListbox': [ -\ [], -\ { 'size' : [],'style' : [],'styleClass' : [],'tabindex' : [],'onblur' : [],'onfocus' : [],'disabledClass' : [],'enabledClass' : [],'accesskey' : [],'onclick' : [],'ondblclick' : [],'onkeydown' : [],'onkeypress' : [],'onkeyup' : [],'onmousedown' : [],'onmousemove' : [],'onmouseout' : [],'onmouseover' : [],'onmouseup' : [],'onchange' : [],'onselect' : [],'dir' : [],'lang' : [],'title' : [],'disabled' : [],'readonly' : [],'validator' : [],'valueChangeListener' : [],'immediate' : [],'required' : [],'converter' : [],'value' : [],'id' : [],'rendered' : [],'binding' : []} -\ ], -\ 'selectOneMenu': [ -\ [], -\ { 'style' : [],'styleClass' : [],'tabindex' : [],'onblur' : [],'onfocus' : [],'disabledClass' : [],'enabledClass' : [],'accesskey' : [],'onclick' : [],'ondblclick' : [],'onkeydown' : [],'onkeypress' : [],'onkeyup' : [],'onmousedown' : [],'onmousemove' : [],'onmouseout' : [],'onmouseover' : [],'onmouseup' : [],'onchange' : [],'onselect' : [],'dir' : [],'lang' : [],'title' : [],'disabled' : [],'readonly' : [],'validator' : [],'valueChangeListener' : [],'immediate' : [],'required' : [],'converter' : [],'value' : [],'id' : [],'rendered' : [],'binding' : []} -\ ], -\ 'selectOneRadio': [ -\ [], -\ { 'border' : [],'layout' : [],'style' : [],'styleClass' : [],'tabindex' : [],'onblur' : [],'onfocus' : [],'disabledClass' : [],'enabledClass' : [],'accesskey' : [],'onclick' : [],'ondblclick' : [],'onkeydown' : [],'onkeypress' : [],'onkeyup' : [],'onmousedown' : [],'onmousemove' : [],'onmouseout' : [],'onmouseover' : [],'onmouseup' : [],'onchange' : [],'onselect' : [],'dir' : [],'lang' : [],'title' : [],'disabled' : [],'readonly' : [],'validator' : [],'valueChangeListener' : [],'immediate' : [],'required' : [],'converter' : [],'value' : [],'id' : [],'rendered' : [],'binding' : []} -\ ], -\ 'vimxmltaginfo': { -\ 'column' : [ ' ', 'This tag is commonly used as a child of the dataTable tag, to represent a column of data. <p> It can be decorated with "header" and "footer" facets to drive the output of header and footer rows. Row values are specified via its children. <p> Unless otherwise specified, all attributes accept static values or EL expressions. <p> See Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'inputHidden' : [ ' ', 'Renders as an HTML input tag with its type set to "hidden". <p> Unless otherwise specified, all attributes accept static values or EL expressions. <p> See Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'commandButton' : [ ' ', 'This tag renders as an HTML input element. <p> Unless otherwise specified, all attributes accept static values or EL expressions. <p> See Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'commandLink' : [ ' ', 'This tag renders as an HTML a element. <p> Unless otherwise specified, all attributes accept static values or EL expressions. <p> See Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'dataTable' : [ ' ', 'This component renders as an HTML table element. It has as its children h:column entities, which describe the columns of the table. It can be decorated with facets named "header" and "footer" to specify header and footer rows. <p> Unless otherwise specified, all attributes accept static values or EL expressions. <p> Extend standard UIData component to add support for html-specific features such as CSS style attributes and event handler scripts. <p> see Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a> </p>'], -\ 'form' : [ ' ', 'Renders an HTML form element. <p> See Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'graphicImage' : [ ' ', 'Renders an HTML img element. <p> Unless otherwise specified, all attributes accept static values or EL expressions. <p> see Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'inputSecret' : [ ' ', 'Renders as an HTML input tag with its type set to "password". <p> Unless otherwise specified, all attributes accept static values or EL expressions. <p> See Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'inputText' : [ ' ', 'Renders a HTML input element. <p> See Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'inputTextarea' : [ ' ', 'Renders a HTML textarea element. <p> Unless otherwise specified, all attributes accept static values or EL expressions. <p> See Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'message' : [ ' ', 'Renders the first FacesMessage that is assigned to the component referenced by the "for" attribute. <p> Unless otherwise specified, all attributes accept static values or EL expressions. <p> See Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'messages' : [ ' ', 'Renders all or some FacesMessages depending on the "for" and "globalOnly" attributes. <p> The behaviour of this component is: <ul> <li>If globalOnly = true, only global messages, that have no associated clientId, will be displayed. <li>else if there is a "for" attribute, only messages that are assigned to the component referenced by the "for" attribute are displayed. <li>else all messages are displayed. </ul> Unless otherwise specified, all attributes accept static values or EL expressions. <p> See Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'outputFormat' : [ ' ', 'Renders as text, applying the child f:param values to the value attribute as a MessageFormat string. If this element has an ID or CSS style properties, the text is wrapped in a span element. <p> Unless otherwise specified, all attributes accept static values or EL expressions. <p> See Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'outputLabel' : [ ' ', 'Renders a HTML label element. <p> In addition to the JSF specification, MyFaces allows it to directly give an output text via the "value" attribute. <p> Unless otherwise specified, all attributes accept static values or EL expressions. <p> See Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'outputLink' : [ ' ', 'Renders a HTML a element. Child f:param elements are added to the href attribute as query parameters. Other children are rendered as the link text or image. <p> Unless otherwise specified, all attributes accept static values or EL expressions. <p> See Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'outputText' : [ ' ', 'Renders the value of the associated UIOutput component. If this element has an ID or CSS style properties, the text is wrapped in a span element. <p> Unless otherwise specified, all attributes accept static values or EL expressions. <p> See Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'panelGrid' : [ ' ', 'This element renders as an HTML table with specified number of columns. Children of this element are rendered as cells in the table, filling rows from left to right. Facets named "header" and "footer" are optional and specify the content of the thead and tfoot rows, respectively. <p> Unless otherwise specified, all attributes accept static values or EL expressions. <p> See Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'panelGroup' : [ ' ', 'This element is used to group other components where the specification requires one child element. If any of the HTML or CSS attributes are set, its content is rendered within a span element. <p> Unless otherwise specified, all attributes accept static values or EL expressions. <p> See Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'selectBooleanCheckbox' : [ ' ', 'Allow the user to choose a "true" or "false" value, presented as a checkbox. <p> Renders as an HTML input tag with its type set to "checkbox", and its name attribute set to the id. The "checked" attribute is rendered if the value of this component is true. <p> Unless otherwise specified, all attributes accept static values or EL expressions. <p> See Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'selectManyCheckbox' : [ ' ', 'Allow the user to select zero or more items from a set of available options. <p> This is presented as a table with one cell per available option; each cell contains a checkbox and the option"s label. The "layout" attribute determines whether the checkboxes are laid out horizontally or vertically. <p> The set of available options is defined by adding child f:selectItem or f:selectItems components to this component. <p> The value attribute must be a value-binding expression to a property of type List, Object array or primitive array. That "collection" is expected to contain objects of the same type as SelectItem.getValue() returns for the child SelectItem objects. On rendering, any child whose value is in the list will be selected initially. During the update phase, the property setter is called to replace the original collection with a completely new collection object of the appropriate type. The new collection object contains the value of each child SelectItem object that is currently selected. <p> Unless otherwise specified, all attributes accept static values or EL expressions. <p> See Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'selectManyListbox' : [ ' ', 'Allow the user to select zero or more items from a set of available options. This is presented as a listbox which allows multiple rows in the list to be selected simultaneously. <p> The set of available options is defined by adding child f:selectItem or f:selectItems components to this component. <p> The list is rendered as an HTML select element. The "multiple" attribute is set on the element and the size attribute is set to the provided value, defaulting to the number of items in the list if no value is provided. If the size is set to 1, then a "drop-down" list (aka "combo-box") is presented, though if this is the intention then a selectManyMenu should be used instead. <p> The value attribute must be a value-binding expression to a property of type List, Object array or primitive array. That "collection" is expected to contain objects of the same type as SelectItem.getValue() returns for the child SelectItem objects. On rendering, any child whose value is in the list will be selected initially. During the update phase, the property is set to contain a "collection" of values for those child SelectItem objects that are currently selected. <p> Unless otherwise specified, all attributes accept static values or EL expressions. <p> See Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'selectManyMenu' : [ ' ', 'Allow the user to select zero or more items from a set of available options. This is presented as a drop-down "combo-box" which allows multiple rows in the list to be selected simultaneously. <p> The set of available options is defined by adding child f:selectItem or f:selectItems components to this component. <p> Renders as an HTML select element, with the choices made up of child f:selectItem or f:selectItems elements. The multiple attribute is set and the size attribute is set to 1. <p> The value attribute must be a value-binding expression to a property of type List, Object array or primitive array. That "collection" is expected to contain objects of the same type as SelectItem.getValue() returns for the child SelectItem objects. On rendering, any child whose value is in the list will be selected initially. During the update phase, the property is set to contain a "collection" of values for those child SelectItem objects that are currently selected. <p> Unless otherwise specified, all attributes accept static values or EL expressions. <p> See Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'selectOneListbox' : [ ' ', 'Allow the user to choose one option from a set of options. <p> Rendered as a listbox with the MULTIPLE attribute set to false. <p> The available choices are defined via child f:selectItem or f:selectItems elements. The size of the listbox defaults to the number of available choices; if size is explicitly set to a smaller value, then scrollbars will be rendered. If size is set to 1 then a "drop-down menu" (aka "combo-box") is rendered, though if this is the intent then selectOneMenu should be used instead. <p> The value attribute of this component is read to determine which of the available options is initially selected; its value should match the "value" property of one of the child SelectItem objects. <p> On submit of the enclosing form, the value attribute"s bound property is updated to contain the "value" property from the chosen SelectItem. <p> Unless otherwise specified, all attributes accept static values or EL expressions. <p> See Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'selectOneMenu' : [ ' ', 'Allow the user to choose one option from a set of options. <p> Renders a drop-down menu (aka "combo-box") containing a set of choices, of which only one can be chosen at a time. The available choices are defined via child f:selectItem or f:selectItems elements. <p> The value attribute of this component is read to determine which of the available options is initially selected; its value should match the "value" property of one of the child SelectItem objects. <p> On submit of the enclosing form, the value attribute"s bound property is updated to contain the "value" property from the chosen SelectItem. <p> Unless otherwise specified, all attributes accept static values or EL expressions. <p> See Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'], -\ 'selectOneRadio' : [ ' ', 'Allow the user to choose one option from a set of options. <p> Renders as an HTML table element, containing an input element for each child f:selectItem or f:selectItems elements. The input elements are rendered as type radio. <p> The value attribute of this component is read to determine which of the available options is initially selected; its value should match the "value" property of one of the child SelectItem objects. <p> On submit of the enclosing form, the value attribute"s bound property is updated to contain the "value" property from the chosen SelectItem. <p> Unless otherwise specified, all attributes accept static values or EL expressions. <p> See Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>'] -\ }, -\ 'vimxmlattrinfo': { -\ 'id' : [ ' ', 'An identifier for this particular component instance within a component view. <p> The id must be unique within the scope of the tag"s enclosing NamingContainer (eg h:form or f:subview). The id is not necessarily unique across all components in the current view </p> <p> This value must be a static value, ie not change over the lifetime of a component. It cannot be defined via an EL expression; only a string is permitted. </p>'], -\ 'rendered' : [ ' ', 'A boolean value that indicates whether this component should be rendered. Default value: true.'], -\ 'binding' : [ ' ', 'Identifies a backing bean property (of type UIComponent or appropriate subclass) to bind to this component instance. This value must be an EL expression.'], -\ 'validator' : [ ' ', 'A method binding EL expression, accepting FacesContext, UIComponent, and Object parameters, and returning void, that validates the component"s local value.'], -\ 'valueChangeListener' : [ ' ', 'A method binding EL expression, accepting a ValueChangeEvent parameter and returning void. The specified method is invoked if this component is modified. The phase that this handler is fired in can be controlled via the immediate attribute.'], -\ 'immediate' : [ ' ', 'A boolean value that identifies the phase during which value change events should fire. During normal event processing, value change events are fired during the "process validations" phase of request processing. If this attribute is set to "true", these methods are fired instead at the end of the "apply request values" phase.'], -\ 'required' : [ ' ', 'A boolean value that indicates whether an input value is required. If this value is true, and no input value is provided, the error message javax.faces.component.UIInput.REQUIRED is posted.'], -\ 'converter' : [ ' ', 'The value can either be a static value (ID) or an EL expression. When a static id is specified, an instance of the converter type registered with that id is used. When this is an EL expression, the result of evaluating the expression must be an object that implements the Converter interface.'], -\ 'value' : [ ' ', 'The initial value of this component. This value is generally set as a value-binding in the form #{myBean.myProperty}, where myProperty can be any data-type of Java (also user-defined data-types), if a converter for this data-type exists. Special cases: 1) f:selectItems - value needs to bind to a list (or an array) of javax.faces.model.SelectItem-instances 2) components implementing UISelectMany (e.g. h:selectManyCheckbox) - value needs to bind to a list (or an array) of values, where the values need to be of the same data-type as the choices of the associated f:selectItems-component 3) components implementing UIData (e.g. h:dataTable) - value needs to bind to a list (or an array) of values, which will be iterated over when the data-table is processed'], -\ 'image' : [ ' ', 'HTML: The URL of an image that renders in place of the button.'], -\ 'type' : [ ' ', 'HTML: A hint to the user agent about the content type of the linked resource.'], -\ 'style' : [ ' ', 'HTML: CSS styling instructions.'], -\ 'styleClass' : [ ' ', 'The CSS class for this element. Corresponds to the HTML "class" attribute.'], -\ 'alt' : [ ' ', 'HTML: Specifies alternative text that can be used by a browser that can"t show this element.'], -\ 'tabindex' : [ ' ', 'HTML: Specifies the position of this element within the tab order of the document.'], -\ 'onblur' : [ ' ', 'HTML: Specifies a script to be invoked when the element loses focus.'], -\ 'onfocus' : [ ' ', 'HTML: Specifies a script to be invoked when the element receives focus.'], -\ 'accesskey' : [ ' ', 'HTML: Sets the access key for this element.'], -\ 'onchange' : [ ' ', 'HTML: Specifies a script to be invoked when the element is modified.'], -\ 'onselect' : [ ' ', 'HTML: Specifies a script to be invoked when the element is selected.'], -\ 'onclick' : [ ' ', 'HTML: Script to be invoked when the element is clicked.'], -\ 'ondblclick' : [ ' ', 'HTML: Script to be invoked when the element is double-clicked.'], -\ 'onkeydown' : [ ' ', 'HTML: Script to be invoked when a key is pressed down over this element.'], -\ 'onkeypress' : [ ' ', 'HTML: Script to be invoked when a key is pressed over this element.'], -\ 'onkeyup' : [ ' ', 'HTML: Script to be invoked when a key is released over this element.'], -\ 'onmousedown' : [ ' ', 'HTML: Script to be invoked when the pointing device is pressed over this element.'], -\ 'onmousemove' : [ ' ', 'HTML: Script to be invoked when the pointing device is moved while it is in this element.'], -\ 'onmouseout' : [ ' ', 'HTML: Script to be invoked when the pointing device is moves out of this element.'], -\ 'onmouseover' : [ ' ', 'HTML: Script to be invoked when the pointing device is moved into this element.'], -\ 'onmouseup' : [ ' ', 'HTML: Script to be invoked when the pointing device is released over this element.'], -\ 'dir' : [ ' ', 'HTML: The direction of text display, either "ltr" (left-to-right) or "rtl" (right-to-left).'], -\ 'lang' : [ ' ', 'HTML: The base language of this document.'], -\ 'title' : [ ' ', 'HTML: An advisory title for this element. Often used by the user agent as a tooltip.'], -\ 'disabled' : [ ' ', 'HTML: When true, this element cannot receive focus.'], -\ 'readonly' : [ ' ', 'HTML: When true, indicates that this component cannot be modified by the user. The element may receive focus unless it has also been disabled.'], -\ 'action' : [ ' ', 'Specifies the action to take when this command is invoked. If the value is an expression, it is expected to be a method binding EL expression that identifies an action method. An action method accepts no parameters and has a String return value, called the action outcome, that identifies the next view displayed. The phase that this event is fired in can be controlled via the immediate attribute. If the value is a string literal, it is treated as a navigation outcome for the current view. This is functionally equivalent to a reference to an action method that returns the string literal.'], -\ 'actionListener' : [ ' ', 'A method binding EL expression that identifies an action listener method to be invoked if this component is activated by the user. An action listener method accepts a parameter of type javax.faces.event.ActionEvent and returns void. The phase that this event is fired in can be controlled via the immediate attribute.'], -\ 'charset' : [ ' ', 'HTML: Specifies the character encoding of the linked resource.'], -\ 'coords' : [ ' ', 'HTML: The coordinates of regions within a client side image map.'], -\ 'hreflang' : [ ' ', 'HTML: The language of the linked resource.'], -\ 'rel' : [ ' ', 'HTML: The relationship between the current document and the linked resource.'], -\ 'rev' : [ ' ', 'HTML: The type(s) describing the reverse link for the linked resource.'], -\ 'shape' : [ ' ', 'HTML: The shape of a region in a client side image map.'], -\ 'target' : [ ' ', 'HTML: Names the frame that should display content generated by invoking this action.'], -\ 'bgcolor' : [ ' ', 'HTML: The background color of this element.'], -\ 'border' : [ ' ', 'HTML: Specifies the width of the border of this element, in pixels. Deprecated in HTML 4.01.'], -\ 'cellpadding' : [ ' ', 'HTML: Specifies the amount of empty space between the cell border and its contents. It can be either a pixel length or a percentage.'], -\ 'cellspacing' : [ ' ', 'HTML: Specifies the amount of space between the cells of the table. It can be either a pixel length or a percentage of available space.'], -\ 'columnClasses' : [ ' ', 'A comma separated list of CSS class names to apply to td elements in each column.'], -\ 'footerClass' : [ ' ', 'The CSS class to be applied to footer cells.'], -\ 'frame' : [ ' ', 'HTML: Controls what part of the frame that surrounds a table is visible. Values include: void, above, below, hsides, lhs, rhs, vsides, box, and border.'], -\ 'headerClass' : [ ' ', 'The CSS class to be applied to header cells.'], -\ 'rowClasses' : [ ' ', 'A comma separated list of CSS class names to apply to td elements in each row.'], -\ 'rules' : [ ' ', 'HTML: Controls how rules are rendered between cells. Values include: none, groups, rows, cols, and all.'], -\ 'summary' : [ ' ', 'HTML: Provides a summary of the contents of the table, for accessibility purposes.'], -\ 'width' : [ ' ', 'HTML: Specifies the desired width of the table, as a pixel length or a percentage of available space.'], -\ 'var' : [ ' ', 'Defines the name of the request-scope variable that will hold the current row during iteration. This value must be a static value.'], -\ 'first' : [ ' ', 'The index of the first row to be displayed, where 0 is the first row.'], -\ 'rows' : [ ' ', 'The number of rows to be displayed. Specify zero for all remaining rows in the table.'], -\ 'accept' : [ ' ', 'HTML: Provides a comma-separated list of content types that the server processing this form can handle.'], -\ 'acceptcharset' : [ ' ', 'HTML: The list of character encodings accepted by the server for this form.'], -\ 'enctype' : [ ' ', 'HTML: The content type used to submit this form to the server.'], -\ 'onreset' : [ ' ', 'HTML: Script to be invoked when this form is reset.'], -\ 'onsubmit' : [ ' ', 'HTML: Script to be invoked when this form is submitted.'], -\ 'height' : [ ' ', 'HTML: Overrides the natural height of this image, by specifying height in pixels.'], -\ 'ismap' : [ ' ', 'HTML: Specifies server-side image map handling for this image.'], -\ 'longdesc' : [ ' ', 'HTML: A link to a long description of the image.'], -\ 'usemap' : [ ' ', 'HTML: Specifies an image map to use with this image.'], -\ 'url' : [ ' ', 'An alias for the "value" attribute.'], -\ 'maxlength' : [ ' ', 'HTML: The maximum number of characters allowed to be entered.'], -\ 'redisplay' : [ ' ', 'If true, the value will be re-sent (in plaintext) when the form is rerendered (see JSF.7.4.4). Default is false.'], -\ 'size' : [ ' ', 'HTML: The initial width of this control, in characters.'], -\ 'cols' : [ ' ', 'HTML: The width of this element, in characters.'], -\ 'errorClass' : [ ' ', 'CSS class to be used for messages with severity "ERROR".'], -\ 'errorStyle' : [ ' ', 'CSS style to be used for messages with severity "ERROR".'], -\ 'fatalClass' : [ ' ', 'CSS class to be used for messages with severity "FATAL".'], -\ 'fatalStyle' : [ ' ', 'CSS style to be used for messages with severity "FATAL".'], -\ 'infoClass' : [ ' ', 'CSS class to be used for messages with severity "INFO".'], -\ 'infoStyle' : [ ' ', 'CSS style to be used for messages with severity "INFO".'], -\ 'tooltip' : [ ' ', 'If true, the message summary will be rendered as a tooltip (i.e. HTML title attribute).'], -\ 'warnClass' : [ ' ', 'CSS class to be used for messages with severity "WARN".'], -\ 'warnStyle' : [ ' ', 'CSS style to be used for messages with severity "WARN".'], -\ 'for' : [ ' ', 'An EL expression, returning a String, with the unique ID of the component for which messages should be displayed. This string has the same format as that accepted by the UIComponent.findComponent() method.'], -\ 'showDetail' : [ ' ', 'An EL expression, returning a boolean, that controls whether the detail text of the associated messages is displayed. Default: false.'], -\ 'showSummary' : [ ' ', 'An EL expression, returning a boolean, that controls whether the summary text of the associated messages is displayed. Default: true.'], -\ 'layout' : [ ' ', 'The layout: "table" or "list". Default: list'], -\ 'globalOnly' : [ ' ', 'A boolean value that controls whether global messages (those without IDs) should be displayed. Default: false.'], -\ 'escape' : [ ' ', 'Indicates whether rendered markup should be escaped. Default: true'], -\ 'columns' : [ ' ', 'Specifies the number of columns in the grid.'], -\ 'disabledClass' : [ ' ', 'The CSS class assigned to the label element for enabled choices.'], -\ 'enabledClass' : [ ' ', 'The CSS class assigned to the label element for enabled choices.'] -\ }, -\} diff --git a/home/.vim/autoload/xml/stl_c.vim b/home/.vim/autoload/xml/stl_c.vim deleted file mode 100644 index d94e655..0000000 --- a/home/.vim/autoload/xml/stl_c.vim +++ /dev/null @@ -1,95 +0,0 @@ -let g:xmldata_stl_c= { -\ 'catch': [ -\ [], -\ { 'var' : []} -\ ], -\ 'choose': [ -\ [], -\ { } -\ ], -\ 'if': [ -\ [], -\ { 'test' : [],'var' : [],'scope' : []} -\ ], -\ 'import': [ -\ [], -\ { 'url' : [],'var' : [],'scope' : [],'varReader' : [],'context' : [],'charEncoding' : []} -\ ], -\ 'forEach': [ -\ [], -\ { 'items' : [],'begin' : [],'end' : [],'step' : [],'var' : [],'varStatus' : []} -\ ], -\ 'forTokens': [ -\ [], -\ { 'items' : [],'delims' : [],'begin' : [],'end' : [],'step' : [],'var' : [],'varStatus' : []} -\ ], -\ 'out': [ -\ [], -\ { 'value' : [],'default' : [],'escapeXml' : []} -\ ], -\ 'otherwise': [ -\ [], -\ { } -\ ], -\ 'param': [ -\ [], -\ { 'name' : [],'value' : []} -\ ], -\ 'redirect': [ -\ [], -\ { 'url' : [],'context' : []} -\ ], -\ 'remove': [ -\ [], -\ { 'var' : [],'scope' : []} -\ ], -\ 'set': [ -\ [], -\ { 'var' : [],'value' : [],'target' : [],'property' : [],'scope' : []} -\ ], -\ 'url': [ -\ [], -\ { 'var' : [],'scope' : [],'value' : [],'context' : []} -\ ], -\ 'when': [ -\ [], -\ { 'test' : []} -\ ], -\ 'vimxmltaginfo': { -\ 'catch' : [ ' ', ' Catches any Throwable that occurs in its body and optionally exposes it. '], -\ 'choose' : [ ' ', ' Simple conditional tag that establishes a context for mutually exclusive conditional operations, marked by <when> and <otherwise> '], -\ 'if' : [ ' ', ' Simple conditional tag, which evalutes its body if the supplied condition is true and optionally exposes a Boolean scripting variable representing the evaluation of this condition '], -\ 'import' : [ ' ', ' Retrieves an absolute or relative URL and exposes its contents to either the page, a String in "var", or a Reader in "varReader". '], -\ 'forEach' : [ ' ', ' The basic iteration tag, accepting many different collection types and supporting subsetting and other functionality '], -\ 'forTokens' : [ ' ', ' Iterates over tokens, separated by the supplied delimeters '], -\ 'out' : [ ' ', ' Like <%= ... >, but for expressions. '], -\ 'otherwise' : [ ' ', ' Subtag of <choose> that follows <when> tags and runs only if all of the prior conditions evaluated to "false" '], -\ 'param' : [ ' ', ' Adds a parameter to a containing "import" tag"s URL. '], -\ 'redirect' : [ ' ', ' Redirects to a new URL. '], -\ 'remove' : [ ' ', ' Removes a scoped variable (from a particular scope, if specified). '], -\ 'set' : [ ' ', ' Sets the result of an expression evaluation in a "scope" '], -\ 'url' : [ ' ', ' Creates a URL with optional query parameters. '], -\ 'when' : [ ' ', ' Subtag of <choose> that includes its body if its condition evalutes to "true" '] -\ }, -\ 'vimxmlattrinfo': { -\ 'var' : [ ' ', ' Name of the exported scoped variable for the exception thrown from a nested action. The type of the scoped variable is the type of the exception thrown. '], -\ 'test' : [ ' ', ' The test condition that determines whether or not the body content should be processed. '], -\ 'scope' : [ ' ', ' Scope for var. '], -\ 'url' : [ ' ', ' The URL of the resource to import. '], -\ 'varReader' : [ ' ', ' Name of the exported scoped variable for the resource"s content. The type of the scoped variable is Reader. '], -\ 'context' : [ ' ', ' Name of the context when accessing a relative URL resource that belongs to a foreign context. '], -\ 'charEncoding' : [ ' ', ' Character encoding of the content at the input resource. '], -\ 'items' : [ ' ', ' Collection of items to iterate over. '], -\ 'begin' : [ ' ', ' If items specified: Iteration begins at the item located at the specified index. First item of the collection has index 0. If items not specified: Iteration begins with index set at the value specified. '], -\ 'end' : [ ' ', ' If items specified: Iteration ends at the item located at the specified index (inclusive). If items not specified: Iteration ends when index reaches the value specified. '], -\ 'step' : [ ' ', ' Iteration will only process every step items of the collection, starting with the first one. '], -\ 'varStatus' : [ ' ', ' Name of the exported scoped variable for the status of the iteration. Object exported is of type javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested visibility. '], -\ 'delims' : [ ' ', ' The set of delimiters (the characters that separate the tokens in the string). '], -\ 'value' : [ ' ', ' Expression to be evaluated. '], -\ 'default' : [ ' ', ' Default value if the resulting value is null. '], -\ 'escapeXml' : [ ' ', ' Determines whether characters <,>,&,"," in the resulting string should be converted to their corresponding character entity codes. Default value is true. '], -\ 'name' : [ ' ', ' Name of the query string parameter. '], -\ 'target' : [ ' ', ' Target object whose property will be set. Must evaluate to a JavaBeans object with setter property property, or to a java.util.Map object. '], -\ 'property' : [ ' ', ' Name of the property to be set in the target object. '] -\ }, -\} diff --git a/home/.vim/autoload/xml/stl_fmt.vim b/home/.vim/autoload/xml/stl_fmt.vim deleted file mode 100644 index eb26340..0000000 --- a/home/.vim/autoload/xml/stl_fmt.vim +++ /dev/null @@ -1,88 +0,0 @@ -let g:xmldata_stl_fmt= { -\ 'requestEncoding': [ -\ [], -\ { 'value' : []} -\ ], -\ 'setLocale': [ -\ [], -\ { 'value' : [],'variant' : [],'scope' : []} -\ ], -\ 'timeZone': [ -\ [], -\ { 'value' : []} -\ ], -\ 'setTimeZone': [ -\ [], -\ { 'value' : [],'var' : [],'scope' : []} -\ ], -\ 'bundle': [ -\ [], -\ { 'basename' : [],'prefix' : []} -\ ], -\ 'setBundle': [ -\ [], -\ { 'basename' : [],'var' : [],'scope' : []} -\ ], -\ 'message': [ -\ [], -\ { 'key' : [],'bundle' : [],'var' : [],'scope' : []} -\ ], -\ 'param': [ -\ [], -\ { 'value' : []} -\ ], -\ 'formatNumber': [ -\ [], -\ { 'value' : [],'type' : [],'pattern' : [],'currencyCode' : [],'currencySymbol' : [],'groupingUsed' : [],'maxIntegerDigits' : [],'minIntegerDigits' : [],'maxFractionDigits' : [],'minFractionDigits' : [],'var' : [],'scope' : []} -\ ], -\ 'parseNumber': [ -\ [], -\ { 'value' : [],'type' : [],'pattern' : [],'parseLocale' : [],'integerOnly' : [],'var' : [],'scope' : []} -\ ], -\ 'formatDate': [ -\ [], -\ { 'value' : [],'type' : [],'dateStyle' : [],'timeStyle' : [],'pattern' : [],'timeZone' : [],'var' : [],'scope' : []} -\ ], -\ 'parseDate': [ -\ [], -\ { 'value' : [],'type' : [],'dateStyle' : [],'timeStyle' : [],'pattern' : [],'timeZone' : [],'parseLocale' : [],'var' : [],'scope' : []} -\ ], -\ 'vimxmltaginfo': { -\ 'requestEncoding' : [ ' ', ' Sets the request character encoding '], -\ 'setLocale' : [ ' ', ' Stores the given locale in the locale configuration variable '], -\ 'timeZone' : [ ' ', ' Specifies the time zone for any time formatting or parsing actions nested in its body '], -\ 'setTimeZone' : [ ' ', ' Stores the given time zone in the time zone configuration variable '], -\ 'bundle' : [ ' ', ' Loads a resource bundle to be used by its tag body '], -\ 'setBundle' : [ ' ', ' Loads a resource bundle and stores it in the named scoped variable or the bundle configuration variable '], -\ 'message' : [ ' ', ' Maps key to localized message and performs parametric replacement '], -\ 'param' : [ ' ', ' Supplies an argument for parametric replacement to a containing <message> tag '], -\ 'formatNumber' : [ ' ', ' Formats a numeric value as a number, currency, or percentage '], -\ 'parseNumber' : [ ' ', ' Parses the string representation of a number, currency, or percentage '], -\ 'formatDate' : [ ' ', ' Formats a date and/or time using the supplied styles and pattern '], -\ 'parseDate' : [ ' ', ' Parses the string representation of a date and/or time '] -\ }, -\ 'vimxmlattrinfo': { -\ 'value' : [ ' ', ' Name of character encoding to be applied when decoding request parameters. '], -\ 'variant' : [ ' ', ' Vendor- or browser-specific variant. See the java.util.Locale javadocs for more information on variants. '], -\ 'scope' : [ ' ', ' Scope of the locale configuration variable. '], -\ 'var' : [ ' ', ' Name of the exported scoped variable which stores the time zone of type java.util.TimeZone. '], -\ 'basename' : [ ' ', ' Resource bundle base name. This is the bundle"s fully-qualified resource name, which has the same form as a fully-qualified class name, that is, it uses "." as the package component separator and does not have any file type (such as ".class" or ".properties") suffix. '], -\ 'prefix' : [ ' ', ' Prefix to be prepended to the value of the message key of any nested <fmt:message> action. '], -\ 'key' : [ ' ', ' Message key to be looked up. '], -\ 'bundle' : [ ' ', ' Localization context in whose resource bundle the message key is looked up. '], -\ 'type' : [ ' ', ' Specifies whether the value is to be formatted as number, currency, or percentage. '], -\ 'pattern' : [ ' ', ' Custom formatting pattern. '], -\ 'currencyCode' : [ ' ', ' ISO 4217 currency code. Applied only when formatting currencies (i.e. if type is equal to "currency"); ignored otherwise. '], -\ 'currencySymbol' : [ ' ', ' Currency symbol. Applied only when formatting currencies (i.e. if type is equal to "currency"); ignored otherwise. '], -\ 'groupingUsed' : [ ' ', ' Specifies whether the formatted output will contain any grouping separators. '], -\ 'maxIntegerDigits' : [ ' ', ' Maximum number of digits in the integer portion of the formatted output. '], -\ 'minIntegerDigits' : [ ' ', ' Minimum number of digits in the integer portion of the formatted output. '], -\ 'maxFractionDigits' : [ ' ', ' Maximum number of digits in the fractional portion of the formatted output. '], -\ 'minFractionDigits' : [ ' ', ' Minimum number of digits in the fractional portion of the formatted output. '], -\ 'parseLocale' : [ ' ', ' Locale whose default formatting pattern (for numbers, currencies, or percentages, respectively) is to be used during the parse operation, or to which the pattern specified via the pattern attribute (if present) is applied. '], -\ 'integerOnly' : [ ' ', ' Specifies whether just the integer portion of the given value should be parsed. '], -\ 'dateStyle' : [ ' ', ' Predefined formatting style for dates. Follows the semantics defined in class java.text.DateFormat. Applied only when formatting a date or both a date and time (i.e. if type is missing or is equal to "date" or "both"); ignored otherwise. '], -\ 'timeStyle' : [ ' ', ' Predefined formatting style for times. Follows the semantics defined in class java.text.DateFormat. Applied only when formatting a time or both a date and time (i.e. if type is equal to "time" or "both"); ignored otherwise. '], -\ 'timeZone' : [ ' ', ' Time zone in which to represent the formatted time. '] -\ }, -\} diff --git a/home/.vim/autoload/xml/stl_sql.vim b/home/.vim/autoload/xml/stl_sql.vim deleted file mode 100644 index 9cf2dd3..0000000 --- a/home/.vim/autoload/xml/stl_sql.vim +++ /dev/null @@ -1,49 +0,0 @@ -let g:xmldata_stl_sql= { -\ 'transaction': [ -\ [], -\ { 'dataSource' : [],'isolation' : []} -\ ], -\ 'query': [ -\ [], -\ { 'var' : [],'scope' : [],'sql' : [],'dataSource' : [],'startRow' : [],'maxRows' : []} -\ ], -\ 'update': [ -\ [], -\ { 'var' : [],'scope' : [],'sql' : [],'dataSource' : []} -\ ], -\ 'param': [ -\ [], -\ { 'value' : []} -\ ], -\ 'dateParam': [ -\ [], -\ { 'value' : [],'type' : []} -\ ], -\ 'setDataSource': [ -\ [], -\ { 'var' : [],'scope' : [],'dataSource' : [],'driver' : [],'url' : [],'user' : [],'password' : []} -\ ], -\ 'vimxmltaginfo': { -\ 'transaction' : [ ' ', ' Provides nested database action elements with a shared Connection, set up to execute all statements as one transaction. '], -\ 'query' : [ ' ', ' Executes the SQL query defined in its body or through the sql attribute. '], -\ 'update' : [ ' ', ' Executes the SQL update defined in its body or through the sql attribute. '], -\ 'param' : [ ' ', ' Sets a parameter in an SQL statement to the specified value. '], -\ 'dateParam' : [ ' ', ' Sets a parameter in an SQL statement to the specified java.util.Date value. '], -\ 'setDataSource' : [ ' ', ' Creates a simple DataSource suitable only for prototyping. '] -\ }, -\ 'vimxmlattrinfo': { -\ 'dataSource' : [ ' ', ' DataSource associated with the database to access. A String value represents a relative path to a JNDI resource or the parameters for the JDBC DriverManager facility. '], -\ 'isolation' : [ ' ', ' Transaction isolation level. If not specified, it is the isolation level the DataSource has been configured with. '], -\ 'var' : [ ' ', ' Name of the exported scoped variable for the query result. The type of the scoped variable is javax.servlet.jsp.jstl.sql. Result (see Chapter 16 "Java APIs"). '], -\ 'scope' : [ ' ', ' Scope of var. '], -\ 'sql' : [ ' ', ' SQL query statement. '], -\ 'startRow' : [ ' ', ' The returned Result object includes the rows starting at the specified index. The first row of the original query result set is at index 0. If not specified, rows are included starting from the first row at index 0. '], -\ 'maxRows' : [ ' ', ' The maximum number of rows to be included in the query result. If not specified, or set to -1, no limit on the maximum number of rows is enforced. '], -\ 'value' : [ ' ', ' Parameter value. '], -\ 'type' : [ ' ', ' One of "date", "time" or "timestamp". '], -\ 'driver' : [ ' ', ' JDBC parameter: driver class name. '], -\ 'url' : [ ' ', ' JDBC parameter: URL associated with the database. '], -\ 'user' : [ ' ', ' JDBC parameter: database user on whose behalf the connection to the database is being made. '], -\ 'password' : [ ' ', ' JDBC parameter: user password '] -\ }, -\} diff --git a/home/.vim/autoload/xml/stl_x.vim b/home/.vim/autoload/xml/stl_x.vim deleted file mode 100644 index 9362875..0000000 --- a/home/.vim/autoload/xml/stl_x.vim +++ /dev/null @@ -1,77 +0,0 @@ -let g:xmldata_stl_x= { -\ 'choose': [ -\ [], -\ { } -\ ], -\ 'out': [ -\ [], -\ { 'select' : [],'escapeXml' : []} -\ ], -\ 'if': [ -\ [], -\ { 'select' : [],'var' : [],'scope' : []} -\ ], -\ 'forEach': [ -\ [], -\ { 'var' : [],'select' : [],'begin' : [],'end' : [],'step' : [],'varStatus' : []} -\ ], -\ 'otherwise': [ -\ [], -\ { } -\ ], -\ 'param': [ -\ [], -\ { 'name' : [],'value' : []} -\ ], -\ 'parse': [ -\ [], -\ { 'var' : [],'varDom' : [],'scope' : [],'scopeDom' : [],'xml' : [],'doc' : [],'systemId' : [],'filter' : []} -\ ], -\ 'set': [ -\ [], -\ { 'var' : [],'select' : [],'scope' : []} -\ ], -\ 'transform': [ -\ [], -\ { 'var' : [],'scope' : [],'result' : [],'xml' : [],'doc' : [],'xmlSystemId' : [],'docSystemId' : [],'xslt' : [],'xsltSystemId' : []} -\ ], -\ 'when': [ -\ [], -\ { 'select' : []} -\ ], -\ 'vimxmltaginfo': { -\ 'choose' : [ ' ', ' Simple conditional tag that establishes a context for mutually exclusive conditional operations, marked by <when> and <otherwise> '], -\ 'out' : [ ' ', ' Like <%= ... >, but for XPath expressions. '], -\ 'if' : [ ' ', ' XML conditional tag, which evalutes its body if the supplied XPath expression evalutes to "true" as a boolean '], -\ 'forEach' : [ ' ', ' XML iteration tag. '], -\ 'otherwise' : [ ' ', ' Subtag of <choose> that follows <when> tags and runs only if all of the prior conditions evaluated to "false" '], -\ 'param' : [ ' ', ' Adds a parameter to a containing "transform" tag"s Transformer '], -\ 'parse' : [ ' ', ' Parses XML content from "source" attribute or "body" '], -\ 'set' : [ ' ', ' Saves the result of an XPath expression evaluation in a "scope" '], -\ 'transform' : [ ' ', ' Conducts a transformation given a source XML document and an XSLT stylesheet '], -\ 'when' : [ ' ', ' Subtag of <choose> that includes its body if its expression evalutes to "true" '] -\ }, -\ 'vimxmlattrinfo': { -\ 'select' : [ ' ', ' XPath expression to be evaluated. '], -\ 'escapeXml' : [ ' ', ' Determines whether characters <,>,&,"," in the resulting string should be converted to their corresponding character entity codes. Default value is true. '], -\ 'var' : [ ' ', ' Name of the exported scoped variable for the resulting value of the test condition. The type of the scoped variable is Boolean. '], -\ 'scope' : [ ' ', ' Scope for var. '], -\ 'begin' : [ ' ', ' Iteration begins at the item located at the specified index. First item of the collection has index 0. '], -\ 'end' : [ ' ', ' Iteration ends at the item located at the specified index (inclusive). '], -\ 'step' : [ ' ', ' Iteration will only process every step items of the collection, starting with the first one. '], -\ 'varStatus' : [ ' ', ' Name of the exported scoped variable for the status of the iteration. Object exported is of type javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested visibility. '], -\ 'name' : [ ' ', ' Name of the transformation parameter. '], -\ 'value' : [ ' ', ' Value of the parameter. '], -\ 'varDom' : [ ' ', ' Name of the exported scoped variable for the parsed XML document. The type of the scoped variable is org.w3c.dom.Document. '], -\ 'scopeDom' : [ ' ', ' Scope for varDom. '], -\ 'xml' : [ ' ', ' Deprecated. Use attribute "doc" instead. '], -\ 'doc' : [ ' ', ' Source XML document to be parsed. '], -\ 'systemId' : [ ' ', ' The system identifier (URI) for parsing the XML document. '], -\ 'filter' : [ ' ', ' Filter to be applied to the source document. '], -\ 'result' : [ ' ', ' Result Object that captures or processes the transformation result. '], -\ 'xmlSystemId' : [ ' ', ' Deprecated. Use attribute "docSystemId" instead. '], -\ 'docSystemId' : [ ' ', ' The system identifier (URI) for parsing the XML document. '], -\ 'xslt' : [ ' ', ' javax.xml.transform.Source Transformation stylesheet as a String, Reader, or Source object. '], -\ 'xsltSystemId' : [ ' ', ' The system identifier (URI) for parsing the XSLT stylesheet. '] -\ }, -\} diff --git a/home/.vim/autoload/xml/tc.vim b/home/.vim/autoload/xml/tc.vim deleted file mode 100644 index 6830514..0000000 --- a/home/.vim/autoload/xml/tc.vim +++ /dev/null @@ -1,463 +0,0 @@ -let g:xmldata_tc= { -\ 'script': [ -\ [], -\ { 'onexit' : [],'file' : [],'onsubmit' : [],'onunload' : [],'onload' : []} -\ ], -\ 'tabChangeListener': [ -\ [], -\ { 'listener' : [],'type' : [],'binding' : []} -\ ], -\ 'include': [ -\ [], -\ { 'id' : [],'value' : []} -\ ], -\ 'validateSubmittedValueLength': [ -\ [], -\ { 'minimum' : [],'maximum' : []} -\ ], -\ 'attribute': [ -\ [], -\ { 'value' : [],'name' : []} -\ ], -\ 'converter': [ -\ [], -\ { 'binding' : [],'converterId' : []} -\ ], -\ 'style': [ -\ [], -\ { 'style' : [],'id' : []} -\ ], -\ 'popupReference': [ -\ [], -\ { 'for' : []} -\ ], -\ 'forEach': [ -\ [], -\ { 'begin' : [],'step' : [],'items' : [],'end' : [],'var' : []} -\ ], -\ 'loadBundle': [ -\ [], -\ { 'var' : [],'basename' : []} -\ ], -\ 'validateFileItem': [ -\ [], -\ { 'maxSize' : [],'contentType' : []} -\ ], -\ 'treeListbox': [ -\ [], -\ { 'id' : [],'binding' : [],'rendered' : [],'value' : [],'state' : [],'idReference' : [],'nameReference' : [],'required' : [],'tipReference' : [],'selectable' : []} -\ ], -\ 'link': [ -\ [], -\ { 'action' : [],'actionListener' : [],'immediate' : [],'onclick' : [],'link' : [],'transition' : [],'id' : [],'binding' : [],'rendered' : [],'label' : [],'accessKey' : [],'labelWithAccessKey' : [],'disabled' : [],'inline' : [],'type' : [],'target' : [],'tip' : [],'image' : [],'markup' : [],'tabIndex' : []} -\ ], -\ 'hidden': [ -\ [], -\ { 'id' : [],'binding' : [],'value' : [],'converter' : [],'validator' : []} -\ ], -\ 'toolBarCheck': [ -\ [], -\ { 'action' : [],'actionListener' : [],'immediate' : [],'onclick' : [],'link' : [],'transition' : [],'id' : [],'binding' : [],'rendered' : [],'label' : [],'accessKey' : [],'labelWithAccessKey' : [],'type' : [],'image' : [],'disabled' : [],'value' : [],'tip' : []} -\ ], -\ 'progress': [ -\ [], -\ { 'id' : [],'binding' : [],'rendered' : [],'tip' : [],'markup' : [],'value' : []} -\ ], -\ 'object': [ -\ [], -\ { 'id' : [],'src' : []} -\ ], -\ 'popup': [ -\ [], -\ { 'id' : [],'rendered' : [],'width' : [],'height' : [],'modal' : [],'left' : [],'top' : []} -\ ], -\ 'menuItem': [ -\ [], -\ { 'action' : [],'actionListener' : [],'immediate' : [],'onclick' : [],'link' : [],'transition' : [],'id' : [],'binding' : [],'rendered' : [],'label' : [],'accessKey' : [],'labelWithAccessKey' : [],'disabled' : [],'type' : [],'image' : [],'target' : []} -\ ], -\ 'sheet': [ -\ [], -\ { 'id' : [],'binding' : [],'rendered' : [],'columns' : [],'pagingLength' : [],'showPageRange' : [],'directLinkCount' : [],'state' : [],'rows' : [],'selectable' : [],'showDirectLinks' : [],'sortActionListener' : [],'forceVerticalScrollbar' : [],'var' : [],'value' : [],'stateChangeListener' : [],'pagingStart' : [],'showHeader' : [],'first' : [],'showRowRange' : []} -\ ], -\ 'datePicker': [ -\ [], -\ { 'for' : [],'tabIndex' : []} -\ ], -\ 'panel': [ -\ [], -\ { 'id' : [],'binding' : [],'rendered' : [],'width' : [],'height' : [],'markup' : []} -\ ], -\ 'textarea': [ -\ [], -\ { 'validator' : [],'onchange' : [],'value' : [],'valueChangeListener' : [],'tabIndex' : [],'id' : [],'binding' : [],'rendered' : [],'converter' : [],'readonly' : [],'disabled' : [],'width' : [],'height' : [],'focus' : [],'required' : [],'label' : [],'accessKey' : [],'labelWithAccessKey' : [],'tip' : [],'rows' : [],'markup' : []} -\ ], -\ 'cell': [ -\ [], -\ { 'id' : [],'binding' : [],'rendered' : [],'scrollbars' : [],'spanY' : [],'spanX' : []} -\ ], -\ 'menuCheckbox': [ -\ [], -\ { 'action' : [],'actionListener' : [],'immediate' : [],'onclick' : [],'link' : [],'transition' : [],'id' : [],'binding' : [],'rendered' : [],'disabled' : [],'type' : [],'value' : [],'label' : [],'accessKey' : [],'labelWithAccessKey' : []} -\ ], -\ 'command': [ -\ [], -\ { 'action' : [],'actionListener' : [],'immediate' : [],'onclick' : [],'link' : [],'transition' : [],'id' : []} -\ ], -\ 'message': [ -\ [], -\ { 'id' : [],'binding' : [],'rendered' : [],'for' : [],'showDetail' : [],'showSummary' : []} -\ ], -\ 'reload': [ -\ [], -\ { 'id' : [],'binding' : [],'rendered' : [],'immediate' : [],'frequency' : [],'update' : []} -\ ], -\ 'selectOneRadio': [ -\ [], -\ { 'validator' : [],'onchange' : [],'value' : [],'valueChangeListener' : [],'tabIndex' : [],'markup' : [],'disabled' : [],'id' : [],'inline' : [],'renderRange' : [],'rendered' : [],'binding' : [],'converter' : [],'readonly' : [],'required' : []} -\ ], -\ 'toolBarCommand': [ -\ [], -\ { 'action' : [],'actionListener' : [],'immediate' : [],'onclick' : [],'link' : [],'transition' : [],'id' : [],'binding' : [],'rendered' : [],'label' : [],'accessKey' : [],'labelWithAccessKey' : [],'image' : [],'disabled' : [],'type' : [],'tip' : [],'target' : []} -\ ], -\ 'toolBar': [ -\ [], -\ { 'id' : [],'binding' : [],'rendered' : [],'width' : [],'height' : [],'markup' : [],'iconSize' : [],'orientation' : [],'labelPosition' : []} -\ ], -\ 'selectOneChoice': [ -\ [], -\ { 'validator' : [],'onchange' : [],'value' : [],'valueChangeListener' : [],'tabIndex' : [],'markup' : [],'id' : [],'disabled' : [],'readonly' : [],'inline' : [],'label' : [],'accessKey' : [],'labelWithAccessKey' : [],'rendered' : [],'converter' : [],'binding' : [],'tip' : [],'required' : []} -\ ], -\ 'date': [ -\ [], -\ { 'validator' : [],'onchange' : [],'value' : [],'valueChangeListener' : [],'tabIndex' : [],'id' : [],'binding' : [],'rendered' : [],'readonly' : [],'disabled' : [],'converter' : [],'inline' : [],'focus' : [],'label' : [],'accessKey' : [],'labelWithAccessKey' : [],'tip' : [],'required' : [],'markup' : []} -\ ], -\ 'columnEvent': [ -\ [], -\ { 'id' : [],'binding' : [],'event' : []} -\ ], -\ 'selectReference': [ -\ [], -\ { 'id' : [],'binding' : [],'rendered' : [],'for' : [],'renderRange' : []} -\ ], -\ 'box': [ -\ [], -\ { 'id' : [],'binding' : [],'rendered' : [],'width' : [],'height' : [],'label' : [],'markup' : []} -\ ], -\ 'selectManyCheckbox': [ -\ [], -\ { 'validator' : [],'onchange' : [],'value' : [],'valueChangeListener' : [],'tabIndex' : [],'markup' : [],'disabled' : [],'id' : [],'inline' : [],'renderRange' : [],'rendered' : [],'required' : [],'binding' : [],'readonly' : [],'converter' : []} -\ ], -\ 'selectOneListbox': [ -\ [], -\ { 'validator' : [],'onchange' : [],'value' : [],'valueChangeListener' : [],'tabIndex' : [],'markup' : [],'id' : [],'disabled' : [],'readonly' : [],'label' : [],'accessKey' : [],'labelWithAccessKey' : [],'rendered' : [],'binding' : [],'height' : [],'tip' : [],'required' : []} -\ ], -\ 'out': [ -\ [], -\ { 'id' : [],'binding' : [],'rendered' : [],'converter' : [],'inline' : [],'tip' : [],'value' : [],'escape' : [],'markup' : []} -\ ], -\ 'selectItem': [ -\ [], -\ { 'binding' : [],'id' : [],'markup' : [],'itemLabel' : [],'value' : [],'itemValue' : [],'itemImage' : [],'itemDisabled' : [],'itemDescription' : []} -\ ], -\ 'in': [ -\ [], -\ { 'validator' : [],'onchange' : [],'value' : [],'valueChangeListener' : [],'tabIndex' : [],'id' : [],'binding' : [],'rendered' : [],'converter' : [],'readonly' : [],'disabled' : [],'width' : [],'inline' : [],'focus' : [],'required' : [],'tip' : [],'label' : [],'accessKey' : [],'labelWithAccessKey' : [],'password' : [],'suggestMethod' : [],'markup' : []} -\ ], -\ 'tree': [ -\ [], -\ { 'id' : [],'binding' : [],'rendered' : [],'value' : [],'state' : [],'idReference' : [],'actionListener' : [],'nameReference' : [],'required' : [],'tabIndex' : [],'showJunctions' : [],'disabledReference' : [],'tipReference' : [],'showIcons' : [],'showRoot' : [],'mutable' : [],'showRootJunction' : [],'mode' : [],'selectable' : []} -\ ], -\ 'menucheck': [ -\ [], -\ { 'action' : [],'actionListener' : [],'immediate' : [],'onclick' : [],'link' : [],'transition' : [],'id' : [],'binding' : [],'rendered' : [],'disabled' : [],'type' : [],'value' : [],'label' : [],'accessKey' : [],'labelWithAccessKey' : []} -\ ], -\ 'menuSeparator': [ -\ [], -\ { 'rendered' : [],'binding' : []} -\ ], -\ 'label': [ -\ [], -\ { 'id' : [],'binding' : [],'rendered' : [],'accessKey' : [],'labelWithAccessKey' : [],'for' : [],'inline' : [],'width' : [],'tip' : [],'markup' : [],'value' : []} -\ ], -\ 'form': [ -\ [], -\ { 'binding' : [],'id' : []} -\ ], -\ 'selectManyListbox': [ -\ [], -\ { 'validator' : [],'onchange' : [],'value' : [],'valueChangeListener' : [],'tabIndex' : [],'markup' : [],'id' : [],'disabled' : [],'height' : [],'inline' : [],'label' : [],'accessKey' : [],'labelWithAccessKey' : [],'rendered' : [],'binding' : [],'tip' : [],'readonly' : [],'required' : []} -\ ], -\ 'menuBar': [ -\ [], -\ { 'id' : [],'binding' : [],'rendered' : [],'width' : []} -\ ], -\ 'button': [ -\ [], -\ { 'action' : [],'actionListener' : [],'immediate' : [],'onclick' : [],'link' : [],'transition' : [],'id' : [],'binding' : [],'rendered' : [],'label' : [],'accessKey' : [],'labelWithAccessKey' : [],'image' : [],'disabled' : [],'type' : [],'defaultCommand' : [],'width' : [],'tip' : [],'inline' : [],'target' : [],'markup' : [],'tabIndex' : []} -\ ], -\ 'selectItems': [ -\ [], -\ { 'id' : [],'binding' : [],'value' : []} -\ ], -\ 'separator': [ -\ [], -\ { 'id' : [],'binding' : [],'rendered' : []} -\ ], -\ 'tabGroup': [ -\ [], -\ { 'id' : [],'binding' : [],'rendered' : [],'width' : [],'height' : [],'immediate' : [],'showNavigationBar' : [],'selectedIndex' : [],'serverside' : [],'switchType' : [],'state' : []} -\ ], -\ 'menuradio': [ -\ [], -\ { 'action' : [],'actionListener' : [],'immediate' : [],'onclick' : [],'link' : [],'transition' : [],'id' : [],'binding' : [],'rendered' : [],'label' : [],'disabled' : [],'type' : [],'value' : []} -\ ], -\ 'calendar': [ -\ [], -\ { 'id' : [],'binding' : [],'rendered' : [],'value' : []} -\ ], -\ 'image': [ -\ [], -\ { 'id' : [],'binding' : [],'rendered' : [],'border' : [],'width' : [],'height' : [],'tip' : [],'alt' : [],'value' : []} -\ ], -\ 'toolBarSelectOne': [ -\ [], -\ { 'action' : [],'actionListener' : [],'immediate' : [],'onclick' : [],'link' : [],'transition' : [],'id' : [],'binding' : [],'rendered' : [],'disabled' : [],'type' : [],'value' : []} -\ ], -\ 'file': [ -\ [], -\ { 'validator' : [],'onchange' : [],'valueChangeListener' : [],'id' : [],'binding' : [],'rendered' : [],'disabled' : [],'label' : [],'accessKey' : [],'labelWithAccessKey' : [],'tip' : [],'readonly' : [],'required' : [],'tabIndex' : [],'value' : []} -\ ], -\ 'gridLayout': [ -\ [], -\ { 'id' : [],'border' : [],'cellspacing' : [],'margin' : [],'marginRight' : [],'marginBottom' : [],'marginTop' : [],'marginLeft' : [],'columns' : [],'rows' : [],'binding' : []} -\ ], -\ 'menuRadio': [ -\ [], -\ { 'action' : [],'actionListener' : [],'immediate' : [],'onclick' : [],'link' : [],'transition' : [],'id' : [],'binding' : [],'rendered' : [],'label' : [],'disabled' : [],'type' : [],'value' : []} -\ ], -\ 'columnSelector': [ -\ [], -\ { 'disabled' : [],'rendered' : [],'binding' : []} -\ ], -\ 'messages': [ -\ [], -\ { 'id' : [],'binding' : [],'rendered' : [],'for' : [],'maxNumber' : [],'orderBy' : [],'minSeverity' : [],'maxSeverity' : [],'showDetail' : [],'globalOnly' : [],'showSummary' : []} -\ ], -\ 'time': [ -\ [], -\ { 'validator' : [],'onchange' : [],'value' : [],'valueChangeListener' : [],'tabIndex' : [],'id' : [],'binding' : [],'rendered' : [],'readonly' : [],'disabled' : [],'inline' : [],'label' : [],'accessKey' : [],'labelWithAccessKey' : [],'tip' : [],'required' : []} -\ ], -\ 'page': [ -\ [], -\ { 'label' : [],'id' : [],'width' : [],'height' : [],'binding' : [],'state' : [],'focusId' : [],'applicationIcon' : [],'doctype' : []} -\ ], -\ 'selectBooleanCheckbox': [ -\ [], -\ { 'validator' : [],'onchange' : [],'valueChangeListener' : [],'id' : [],'binding' : [],'rendered' : [],'label' : [],'accessKey' : [],'labelWithAccessKey' : [],'value' : [],'disabled' : [],'inline' : [],'tip' : [],'readonly' : [],'markup' : [],'tabIndex' : []} -\ ], -\ 'menu': [ -\ [], -\ { 'id' : [],'binding' : [],'rendered' : [],'label' : [],'accessKey' : [],'labelWithAccessKey' : [],'disabled' : [],'image' : []} -\ ], -\ 'tab': [ -\ [], -\ { 'id' : [],'binding' : [],'rendered' : [],'label' : [],'accessKey' : [],'labelWithAccessKey' : [],'tip' : [],'markup' : [],'disabled' : []} -\ ], -\ 'column': [ -\ [], -\ { 'id' : [],'binding' : [],'rendered' : [],'label' : [],'tip' : [],'width' : [],'align' : [],'markup' : [],'sortable' : []} -\ ], -\ 'vimxmltaginfo': { -\ 'script' : [ ' ', 'This tag add client side script to the rendered page.'], -\ 'tabChangeListener' : [ ' ', 'Register an TabChangedListener instance on the UIComponent associated with the closest parent UIComponent custom action.'], -\ 'include' : [ ' ', '<p>**** @deprecated. Will be removed in a future version **** </p>'], -\ 'validateSubmittedValueLength' : [ ' ', 'Register an SubmittedValueLengthValidator instance on the UIComponent associated with the closest parent UIComponent custom action.'], -\ 'attribute' : [ ' ', 'Add an attribute on the UIComponent associated with the closest parent UIComponent custom action.'], -\ 'converter' : [ ' ', 'Register an Converter instance on the UIComponent associated with the closest parent UIComponent.'], -\ 'style' : [ ' ', 'Add a style tag. Collected bodyContent is rendered as content into a style tag.'], -\ 'popupReference' : [ ' ', 'Register an PopupActionListener instance on the UIComponent associated with the closest parent UIComponent.'], -\ 'forEach' : [ ' ', '<p>**** @deprecated. Will be removed in a future version **** </p>Replacement for the JSTL <c:foreach> tag. <br /> This tags iterates over the body content without setting up an exported scope variable, but replaces all occurrence"s of <code>var</code> in <code>TobagoTag"s ValueBinding</code> attributes.<br /> All non TobagoTags are treated as they are, no replacement is done, and so no ability to use the <code>var</code> in el.'], -\ 'loadBundle' : [ ' ', 'Load a resource bundle localized for the Locale of the current view from the tobago resource path, and expose it (as a Map) in the request attributes of the current request.'], -\ 'validateFileItem' : [ ' ', 'Register an FileItemValidator instance on the UIComponent associated with the closest parent UIComponent custom action.'], -\ 'treeListbox' : [ ' ', '<p>**** Preliminary. Maybe subject to changed in a future version: Implement a var attribute for the tree like in the sheet (http://issues.apache.org/jira/browse/TOBAGO-18) **** </p>Renders a listbox view of a tree.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UITreeListbox</p><p><b>RendererType: </b>TreeListbox</p>'], -\ 'link' : [ ' ', 'Renders a link element.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UILinkCommand</p><p><b>RendererType: </b>Link</p><p><b>Supported facets:</b></p><dl><dt><b>confirmation</b></dt><dd>Contains a UIOutput instance with the confirmation message.</dd></dl>'], -\ 'hidden' : [ ' ', 'Renders a "hidden" input element.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UIHiddenInput</p><p><b>RendererType: </b>Hidden</p>'], -\ 'toolBarCheck' : [ ' ', 'Renders a selectable command button within a toolbar.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UISelectBooleanCommand</p><p><b>RendererType: </b>MenuCommand</p>'], -\ 'progress' : [ ' ', 'Renders a progressbar.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UIProgress</p><p><b>RendererType: </b>Progress</p><p><b>Supported facets:</b></p><dl><dt><b>complete</b></dt><dd>Contains an instance of UICommand (tc:command). The action is invoked if the full progress has reached</dd></dl>'], -\ 'object' : [ ' ', '<p><b>UIComponentClass: </b>javax.faces.component.UIOutput</p><p><b>RendererType: </b>Object</p>'], -\ 'popup' : [ ' ', 'Renders a popup panel.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UIPopup</p><p><b>RendererType: </b>Popup</p>'], -\ 'menuItem' : [ ' ', 'Renders a menu item.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UIMenuCommand</p><p><b>RendererType: </b>MenuCommand</p>'], -\ 'sheet' : [ ' ', 'Render a sheet element.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UIData</p><p><b>RendererType: </b>Sheet</p><p><b>Supported facets:</b></p><dl><dt><b>reload</b></dt><dd>Contains an instance of UIReload</dd></dl>'], -\ 'datePicker' : [ ' ', 'Renders a date picker. The component needs a DateFormat Pattern from a converter. The converter should be an instance of DateTimeConverter and return a valid pattern from the method getPattern()<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UIDatePicker</p><p><b>RendererType: </b>DatePicker</p>'], -\ 'panel' : [ ' ', 'Intended for use in situations when only one UIComponent child can be nested, such as in the case of facets.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UIPanel</p><p><b>RendererType: </b>Panel</p><p><b>Supported facets:</b></p><dl><dt><b>reload</b></dt><dd>Contains an instance of UIReload</dd><dt><b>layout</b></dt><dd>Contains an instance of UILayout</dd></dl>'], -\ 'textarea' : [ ' ', 'Renders a multiline text input control.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UIInput</p><p><b>RendererType: </b>TextArea</p>'], -\ 'cell' : [ ' ', 'Renders a layout cell. A panel with ability to span over more than one layout cells.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UICell</p><p><b>RendererType: </b>Panel</p>'], -\ 'menuCheckbox' : [ ' ', 'Renders a checkable menuitem.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UISelectBooleanCommand</p><p><b>RendererType: </b>MenuCommand</p>'], -\ 'command' : [ ' ', 'Use this tag only as a facet for click, change in selectOneRadio, selectBooleanCheckbox, selectManyCheckbox and selectOneChoice<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UICommand</p><p><b>RendererType: </b>Command</p>'], -\ 'message' : [ ' ', '<p>**** @deprecated. Will be removed in a future version **** </p>Renders error/validation message.<p><b>UIComponentClass: </b>javax.faces.component.UIMessage</p><p><b>RendererType: </b>Message</p>'], -\ 'reload' : [ ' ', 'Update the parent component<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UIReload</p><p><b>RendererType: </b></p>'], -\ 'selectOneRadio' : [ ' ', 'Render a set of radiobuttons.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UISelectOne</p><p><b>RendererType: </b>SelectOneRadio</p><p><b>Supported facets:</b></p><dl><dt><b>click</b></dt><dd>This facet can contain a UICommand that is invoked in case of a click event from the component</dd><dt><b>change</b></dt><dd>This facet can contain a UICommand that is invoked in case of a change event from the component</dd></dl>'], -\ 'toolBarCommand' : [ ' ', 'Renders a command button within a toolbar.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UICommand</p><p><b>RendererType: </b>Button</p>'], -\ 'toolBar' : [ ' ', '<p/> Renders a toolbar.<p /> Allowed subcomponents are subtypes of UICommand i.e. <code>"button"</code> and <code>"link"</code> tags. These are rendered by ToolbarRenderer, so the result has no difference.<p /> To add an dropdown menu to a button add a facet <code>"menupopup"</code> containing a <a href="menu.html"><code><tc:menu></code></a> tag to the button. Label"s and Image"s on those menu tag"s are ignored and replaced by the renderer. <pre> <tc:button onclick="alert("test 0")" label="Alert 0" > <f:facet name="menupopup"> <tc:menu> <tc:menuItem onclick="alert("test 1")" label="Alert 1"/> <tc:menuItem onclick="alert("test 2")" label="Alert 2"/> <tc:menuItem onclick="alert("test 3")" label="Alert 3"/> </tc:menu> </f:facet> </tc:button> </pre><p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UIToolBar</p><p><b>RendererType: </b>ToolBar</p>'], -\ 'selectOneChoice' : [ ' ', 'Render a single selection dropdown list.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UISelectOne</p><p><b>RendererType: </b>SelectOneChoice</p><p><b>Supported facets:</b></p><dl><dt><b>click</b></dt><dd>This facet can contain a UICommand that is invoked in case of a click event from the component</dd><dt><b>change</b></dt><dd>This facet can contain a UICommand that is invoked in case of a change event from the component</dd></dl>'], -\ 'date' : [ ' ', 'Renders a date input field.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UIDateInput</p><p><b>RendererType: </b>Date</p>'], -\ 'columnEvent' : [ ' ', '<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UIColumnEvent</p><p><b>RendererType: </b></p>'], -\ 'selectReference' : [ ' ', 'Renders a set of option related to and same type as the <strong>for</strong> component.<p><b>UIComponentClass: </b>javax.faces.component.UIOutput</p><p><b>RendererType: </b>SelectReference</p>'], -\ 'box' : [ ' ', 'Renders a panel with border and title.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UIBox</p><p><b>RendererType: </b>Box</p><p><b>Supported facets:</b></p><dl><dt><b>toolBar</b></dt><dd>Contains an instance of UIToolBar</dd><dt><b>layout</b></dt><dd>Contains an instance of UILayout</dd></dl>'], -\ 'selectManyCheckbox' : [ ' ', 'Render a group of checkboxes.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UISelectMany</p><p><b>RendererType: </b>SelectManyCheckbox</p>'], -\ 'selectOneListbox' : [ ' ', 'Render a single selection option listbox.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UISelectOne</p><p><b>RendererType: </b>SelectOneListbox</p><p><b>Supported facets:</b></p><dl><dt><b>click</b></dt><dd>This facet can contain a UICommand that is invoked in case of a click event from the component</dd><dt><b>change</b></dt><dd>This facet can contain a UICommand that is invoked in case of a change event from the component</dd></dl>'], -\ 'out' : [ ' ', 'Renders a text<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UIOutput</p><p><b>RendererType: </b>Out</p>'], -\ 'selectItem' : [ ' ', 'Add a child UISelectItem component to the UIComponent associated with the closed parent UIComponent custom action.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UISelectItem</p><p><b>RendererType: </b></p>'], -\ 'in' : [ ' ', 'Renders a text input field.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UIInput</p><p><b>RendererType: </b>In</p>'], -\ 'tree' : [ ' ', '<p>**** @deprecated. Will be removed in a future version **** </p>Renders a tree view.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UITreeOld</p><p><b>RendererType: </b>TreeOld</p>'], -\ 'menucheck' : [ ' ', '<p>**** @deprecated. Will be removed in a future version **** </p>Renders a checkable menuitem.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UISelectBooleanCommand</p><p><b>RendererType: </b>MenuCommand</p>'], -\ 'menuSeparator' : [ ' ', 'Renders a separator.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UIMenuSeparator</p><p><b>RendererType: </b></p>'], -\ 'label' : [ ' ', 'Renders a label component.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UILabel</p><p><b>RendererType: </b>Label</p>'], -\ 'form' : [ ' ', '<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UIForm</p><p><b>RendererType: </b>Form</p>'], -\ 'selectManyListbox' : [ ' ', 'Render a multi selection option listbox.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UISelectMany</p><p><b>RendererType: </b>SelectManyListbox</p>'], -\ 'menuBar' : [ ' ', 'Renders a menu bar.<br /> Add menu bar as facet name="menuBar" to page tag or use it anywhere on page.<br /><p><b>UIComponentClass: </b>javax.faces.component.UIPanel</p><p><b>RendererType: </b>MenuBar</p>'], -\ 'button' : [ ' ', 'Renders a button element.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UIButtonCommand</p><p><b>RendererType: </b>Button</p><p><b>Supported facets:</b></p><dl><dt><b>confirmation</b></dt><dd>Contains a UIOutput instance with the confirmation message.</dd><dt><b>popup</b></dt><dd>Contains a UIPopup instance.</dd></dl>'], -\ 'selectItems' : [ ' ', 'Add a child UISelectItems component to the UIComponent associated with the closed parent UIComponent custom action.<p><b>UIComponentClass: </b>javax.faces.component.UISelectItems</p><p><b>RendererType: </b></p>'], -\ 'separator' : [ ' ', 'Renders a separator.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UISeparator</p><p><b>RendererType: </b>Separator</p><p><b>Supported facets:</b></p><dl><dt><b>label</b></dt><dd>This facet contains a UILabel</dd></dl>'], -\ 'tabGroup' : [ ' ', 'Renders a tabpanel.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UITabGroup</p><p><b>RendererType: </b>TabGroup</p>'], -\ 'menuradio' : [ ' ', '<p>**** @deprecated. Will be removed in a future version **** </p>Renders a submenu with select one items.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UISelectOneCommand</p><p><b>RendererType: </b>MenuCommand</p>'], -\ 'calendar' : [ ' ', 'Renders a calendar.<p><b>UIComponentClass: </b>javax.faces.component.UIOutput</p><p><b>RendererType: </b>Calendar</p>'], -\ 'image' : [ ' ', 'Renders a Image.<p><b>UIComponentClass: </b>javax.faces.component.UIGraphic</p><p><b>RendererType: </b>Image</p>'], -\ 'toolBarSelectOne' : [ ' ', 'Renders a set of radio command button"s within a toolbar.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UISelectOneCommand</p><p><b>RendererType: </b>MenuCommand</p>'], -\ 'file' : [ ' ', 'Renders a file input field. You need to define an org.apache.myfaces.tobago.webapp.TobagoMultipartFormdataFilter in your web.xml or add the tobago-fileupload.jar to your project. The tobago-fileupload.jar contains a FacesContextFactory that wraps the multipart-formdata request inside the facesContext.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UIFileInput</p><p><b>RendererType: </b>File</p>'], -\ 'gridLayout' : [ ' ', 'Renders a GridLayout. <pre> columns/rows ::= LAYOUT LAYOUT ::= TOKEN [";" TOKEN]+ TOKEN ::= FIXED | PIXEL | PROPORTIONAL FIXED ::= "fixed" PIXEL ::= NUMBER "px" PROPORTIONAL ::= [NUMBER] "*" </pre> <p/> <table border="1"> <tr> <th>Parent</th> <th>Child</th> <th>Okay?</th> <th>Remarks</th> </tr> <tr> <td>FIXED</td> <td>any combination of FIXED or PIXEL but no PROPORTIONAL</td> <td>okay</td> <td>-</td> </tr> <tr> <td>FIXED</td> <td>any combination with at least one PROPORTIONAL</td> <td>wrong</td> <td>LayoutManager cannot compute the fixed value.</td> </tr> <tr> <td>PIXEL</td> <td>any combination of FIXED or PIXEL but no PROPORTIONAL</td> <td>potentially wrong</td> <td>The values depend on each other, the programmer has to keep consistency manually.</td> </tr> <tr> <td>PIXEL</td> <td>any combination with at least one PROPORTIONAL</td> <td>okay</td> <td>-</td> </tr> <tr> <td>PROPORTIONAL</td> <td>any combination of FIXED or PIXEL but no PROPORTIONAL</td> <td>potentially wrong</td> <td>No automatical matching:<ul><li>too little space: scrollbar</li> <li>too much space: elements will be spreaded.</li></ul></td> </tr> <tr> <td>PROPORTIONAL</td> <td>any combination with at least one PROPORTIONAL</td> <td>okay</td> <td>-</td> </tr> </table><p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UIGridLayout</p><p><b>RendererType: </b>GridLayout</p>'], -\ 'menuRadio' : [ ' ', 'Renders a submenu with select one items (like a radio button).<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UISelectOneCommand</p><p><b>RendererType: </b>MenuCommand</p>'], -\ 'columnSelector' : [ ' ', 'Renders a column with checkboxes to mark selected rows.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UIColumnSelector</p><p><b>RendererType: </b>ColumnSelector</p>'], -\ 'messages' : [ ' ', 'Renders error/validation messages.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UIMessages</p><p><b>RendererType: </b>Messages</p>'], -\ 'time' : [ ' ', 'Renders a time input field.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UITimeInput</p><p><b>RendererType: </b>Time</p>'], -\ 'page' : [ ' ', 'TODO description of page tag<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UIPage</p><p><b>RendererType: </b>Page</p><p><b>Supported facets:</b></p><dl><dt><b>action</b></dt><dd>Contains an instance of UICommand (tc:command) for an auto-action</dd><dt><b>menuBar</b></dt><dd>Menubar</dd><dt><b>layout</b></dt><dd>Contains an instance of UILayout</dd></dl>'], -\ 'selectBooleanCheckbox' : [ ' ', 'Renders a checkbox.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UISelectBoolean</p><p><b>RendererType: </b>SelectBooleanCheckbox</p><p><b>Supported facets:</b></p><dl><dt><b>click</b></dt><dd>This facet can contain a UICommand that is invoked in case of a click event from the component</dd><dt><b>change</b></dt><dd>This facet can contain a UICommand that is invoked in case of a change event from the component</dd></dl>'], -\ 'menu' : [ ' ', 'Container component to hold submenus and items.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UIMenu</p><p><b>RendererType: </b></p>'], -\ 'tab' : [ ' ', 'Renders a tab within a tabgroup.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UITab</p><p><b>RendererType: </b>Tab</p>'], -\ 'column' : [ ' ', 'Renders a UIComponent that represents a single column of data within a parent UIData component.<p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UIColumn</p><p><b>RendererType: </b></p>'] -\ }, -\ 'vimxmlattrinfo': { -\ 'onexit' : [ ' ', 'A script function which is invoked during onUnload Handler on the client, when the unload is invoked to a non Tobago page. E.g. close-button, back-button, entering new url, etc.'], -\ 'file' : [ ' ', 'Absolute url to script file or script name to lookup in tobago resource path'], -\ 'onsubmit' : [ ' ', 'A script function which is invoked on client just before submitting the action. This should be a single function call. If the result is typeof "boolean" and false the further processing is canceled and the page is not submitted.'], -\ 'onunload' : [ ' ', 'A script function which is invoked during onUnload Handler on the client, if the action is a normal submit inside of Tobago.'], -\ 'onload' : [ ' ', 'A script function which is invoked during onLoad Handler on the client.'], -\ 'listener' : [ ' ', 'A method binding expression to a processTabChange(TabChangeEvent tabChangeEvent) method.'], -\ 'type' : [ ' ', 'Fully qualified Java class name of a TabChangeListener to be created and registered.'], -\ 'binding' : [ ' ', 'The value binding expression to a TabChangeListener.'], -\ 'id' : [ ' ', 'The component identifier for this component. This value must be unique within the closest parent component that is a naming container.'], -\ 'value' : [ ' ', 'The current value of this component.'], -\ 'minimum' : [ ' ', ''], -\ 'maximum' : [ ' ', ''], -\ 'name' : [ ' ', 'The name of a attribute.'], -\ 'converterId' : [ ' ', 'The converterId of a registered converter.'], -\ 'style' : [ ' ', 'Name of the stylsheet file to add to page.'], -\ 'for' : [ ' ', 'The id of a Popup.'], -\ 'begin' : [ ' ', 'Index at which the iteration begins.'], -\ 'step' : [ ' ', 'Index increments every iteration by this value.'], -\ 'items' : [ ' ', '<strong>ValueBindingExpression</strong> pointing to a <code>java.util.List</code>, <code>java.util.Map</code> or <code>Object[]</code> of items to iterate over.'], -\ 'end' : [ ' ', 'Index at which the iteration stops. Defaults to <code>items.length()</code>.'], -\ 'var' : [ ' ', 'Name of a request-scope attribute under which the model data for for each subobject is accessible.'], -\ 'basename' : [ ' ', 'Base name of the resource bundle to be loaded.'], -\ 'maxSize' : [ ' ', ''], -\ 'contentType' : [ ' ', ''], -\ 'rendered' : [ ' ', 'Flag indicating whether or not this component should be rendered (during Render Response Phase), or processed on any subsequent form submit.'], -\ 'state' : [ ' ', '<strong>ValueBindingExpression</strong> pointing to a object to save the component"s state.'], -\ 'idReference' : [ ' ', 'Bean property reference to fetch the id for the treeNode"s.<br /> Example:<br /> a idReference="userObject.id" try"s to invoke <code><UITreeNode>.getUserObject().getId()</code> to fetch the id.'], -\ 'nameReference' : [ ' ', 'Bean property reference to fetch the label for the treeNode"s.<br /> Example:<br /> a idReference="userObject.name" try"s to invoke <code><UITreeNode>.getUserObject().getName()</code> to fetch the label.'], -\ 'required' : [ ' ', 'Flag indicating that a value is required. If the value is an empty string a ValidationError occurs and a Error Message is rendered.'], -\ 'tipReference' : [ ' ', 'reference to tip value.'], -\ 'selectable' : [ ' ', 'Flag indicating whether or not this component should be render selectable items. Possible values are: <ul> <li><strong>single</strong> : a singleselection tree is rendered</li> <li><strong>singleLeafOnly</strong> : a singleselection tree is rendered, only Leaf"s are selectable</li> <li><strong>siblingLeafOnly</strong> : a multiselection tree is rendered, where only sibling Leaf"s are selectable</li> </ul>'], -\ 'action' : [ ' ', 'Action to invoke when clicked. This must be a MethodBinding or a String representing the application action to invoke when this component is activated by the user. The MethodBinding must evaluate to a public method that takes no parameters, and returns a String (the logical outcome) which is passed to the NavigationHandler for this application. The String is directly passed to the Navigationhandler.'], -\ 'actionListener' : [ ' ', 'MethodBinding representing an action listener method that will be notified when this component is activated by the user. The expression must evaluate to a public method that takes an ActionEvent parameter, with a return type of void.'], -\ 'immediate' : [ ' ', 'Flag indicating that, if this component is activated by the user, notifications should be delivered to interested listeners and actions immediately (that is, during Apply Request Values phase) rather than waiting until Invoke Application phase.'], -\ 'onclick' : [ ' ', 'Script to be invoked when clicked'], -\ 'link' : [ ' ', 'Link to an arbitrary URL'], -\ 'transition' : [ ' ', 'Specify, if the command calls an JSF-Action. Useful to switch off the Double-Submit-Check and Waiting-Behavior.'], -\ 'label' : [ ' ', 'Text value to display as label. If text contains an underscore the next character is used as accesskey.'], -\ 'accessKey' : [ ' ', '<p>**** @deprecated. Will be removed in a future version **** </p>Deprecated! Has not longer any function.'], -\ 'labelWithAccessKey' : [ ' ', '<p>**** @deprecated. Will be removed in a future version **** </p>Deprecated! Use "label" instead. Text value to display as label. If text contains an underscore the next character overwrites "accesskey".'], -\ 'disabled' : [ ' ', 'Flag indicating that this element is disabled.'], -\ 'inline' : [ ' ', 'Flag indicating this component should rendered as an inline element.'], -\ 'target' : [ ' ', 'Name of a frame where the resource retrieved via this hyperlink is to be displayed.'], -\ 'tip' : [ ' ', 'Text value to display as tooltip.'], -\ 'image' : [ ' ', 'Url to an image to display.'], -\ 'markup' : [ ' ', 'Indicate markup of this component. Possible value is "none". But this can be overridden in the theme.'], -\ 'tabIndex' : [ ' ', ''], -\ 'converter' : [ ' ', 'An expression that specifies the Converter for this component. If the value binding expression is a String, the String is used as an ID to look up a Converter. If the value binding expression is a Converter, uses that instance as the converter. The value can either be a static value (ID case only) or an EL expression.'], -\ 'validator' : [ ' ', 'A method binding EL expression, accepting FacesContext, UIComponent, and Object parameters, and returning void, that validates the component"s local value.'], -\ 'src' : [ ' ', 'URI to object source'], -\ 'width' : [ ' ', 'The width for this component. This value is used in the gridLayouts columns attribute. See gridLayout tag for valid values.'], -\ 'height' : [ ' ', 'The height for this component.'], -\ 'modal' : [ ' ', ''], -\ 'left' : [ ' ', ''], -\ 'top' : [ ' ', ''], -\ 'columns' : [ ' ', 'LayoutConstraints for column layout. Semicolon separated list of layout tokens ("<x>*", "<x>px" or "<x>%").'], -\ 'pagingLength' : [ ' ', '<p>**** @deprecated. Will be removed in a future version **** </p>Please use "rows" instead. The number of rows to display, starting with the one identified by the "pageingStart" property.'], -\ 'showPageRange' : [ ' ', 'Flag indicating whether and where the range pages should rendered in the sheet"s footer. Rendering this range also offers the capability to enter the index displayed page directly.<br /> Valid values are <strong>left</strong>, <strong>center</strong>, <strong>right</strong> and <strong>none</strong>. The <strong>default</strong> is <code>none</code>.'], -\ 'directLinkCount' : [ ' ', 'The count of rendered direct paging links in the sheet"s footer.<br /> The <strong>default</strong> is 9.'], -\ 'rows' : [ ' ', 'The number of rows to display, starting with the one identified by the "pageingStart/first" property.'], -\ 'showDirectLinks' : [ ' ', 'Flag indicating whether or not a range of direct paging links should be rendered in the sheet"s footer.<br /> Valid values are <strong>left</strong>, <strong>center</strong>, <strong>right</strong> and <strong>none</strong>. The <strong>default</strong> is <code>none</code>.'], -\ 'sortActionListener' : [ ' ', 'Method binding representing an actionListener method that will be invoked when sorting was requested by the user. Use this if your application needs special handling for sorting columns. If this is not set and the sortable attribute column is set to true the sheet implementation will use a default sort method. The expression must evaluate to a public method which takes an ActionEvent as parameter and with a return type of void. The method will receive a {@link org.apache.myfaces.tobago.event.SortActionEvent}. The method should sort according to the sortColumnId and direction getting from the sheet"s {@link org.apache.myfaces.tobago.model.SheetState} object.'], -\ 'forceVerticalScrollbar' : [ ' ', 'Flag indicating whether or not this sheet should reserve space for vertical toolbar when calculating column width"s.<br /> Possible values are: <pre> "auto" : sheet try to estimate the need of scrollbar, this is the default. "true" : space for scroolbar is reserved. "false" : no space is reserved. </pre>'], -\ 'stateChangeListener' : [ ' ', 'Method binding representing a stateChangeListener method that will be notified when the state was changed by the user. The expression must evaluate to a public method that takes a SheetStateChangeEvent parameter, with a return type of void.'], -\ 'pagingStart' : [ ' ', '<p>**** @deprecated. Will be removed in a future version **** </p>Please use "first" instead. Zero-relative row number of the first row to be displayed.'], -\ 'showHeader' : [ ' ', 'Flag indicating the header should be rendered.'], -\ 'first' : [ ' ', 'Zero-relative row number of the first row to be displayed.'], -\ 'showRowRange' : [ ' ', 'Flag indicating whether or not the range of displayed rows should rendered in the sheet"s footer. Rendering this range also offers the capability to enter the index of the start row directly. <br /> Valid values are <strong>left</strong>, <strong>center</strong>, <strong>right</strong> and <strong>none</strong>. The <strong>default</strong> is <code>none</code>.'], -\ 'onchange' : [ ' ', 'Clientside script function to add to this component"s onchange handler.'], -\ 'valueChangeListener' : [ ' ', 'MethodBinding representing a value change listener method that will be notified when a new value has been set for this input component. The expression must evaluate to a public method that takes a ValueChangeEvent parameter, with a return type of void.'], -\ 'readonly' : [ ' ', 'Flag indicating that this component will prohibit changes by the user.'], -\ 'focus' : [ ' ', 'Flag indicating this component should recieve the focus.'], -\ 'scrollbars' : [ ' ', 'possible values are: "false" : no scrollbars should rendered "true" : scrollbars should always rendered "auto" : scrollbars should rendered when needed'], -\ 'spanY' : [ ' ', 'Count of layout row"s to span over.'], -\ 'spanX' : [ ' ', 'Count of layout column"s to span over.'], -\ 'showDetail' : [ ' ', 'Flag indicating whether the detail should be included The default is "false".'], -\ 'showSummary' : [ ' ', 'Flag indicating whether the summary should be included The default is "true".'], -\ 'frequency' : [ ' ', 'Time in milliseconds after which the parent component is automaticaly reloaded.'], -\ 'update' : [ ' ', 'Is update required.'], -\ 'renderRange' : [ ' ', 'Range of items to render.'], -\ 'iconSize' : [ ' ', 'Size of button images, possible values are: small, big, off.'], -\ 'orientation' : [ ' ', 'Orientation of toolbar'], -\ 'labelPosition' : [ ' ', 'Position of the button label, possible values are: right, bottom, off. If toolbar is facet of box: bottom is changed to right!'], -\ 'event' : [ ' ', ''], -\ 'escape' : [ ' ', 'Flag indicating that characters that are sensitive in HTML and XML markup must be escaped. This flag is set to "true" by default.'], -\ 'itemLabel' : [ ' ', 'Label to be displayed to the user for this option.'], -\ 'itemValue' : [ ' ', 'Value to be returned to the server if this option is selected by the user.'], -\ 'itemImage' : [ ' ', 'Image to be displayed to the user for this option.'], -\ 'itemDisabled' : [ ' ', 'Flag indicating whether the option created by this component is disabled.'], -\ 'itemDescription' : [ ' ', 'Flag indicating whether the option created by this component is disabled.'], -\ 'password' : [ ' ', 'Flag indicating whether or not this component should be rendered as password field , so you will not see the typed charakters.'], -\ 'suggestMethod' : [ ' ', 'MethodBinding which generates a list of suggested input values based on a passed prefix -- the currently entered text. The expression has to evaluate to a public method which has a String parameter and a List<String> as return type.'], -\ 'showJunctions' : [ ' ', ''], -\ 'disabledReference' : [ ' ', 'Bean property reference to fetch the disabled state for the treeNode"s.<br /> Example:<br /> a disabledReference="userObject.disabled" try"s to invoke <code><UITreeNode>.getUserObject().getDisabled()</code> to fetch the state.'], -\ 'showIcons' : [ ' ', ''], -\ 'showRoot' : [ ' ', ''], -\ 'mutable' : [ ' ', ''], -\ 'showRootJunction' : [ ' ', ''], -\ 'mode' : [ ' ', 'Display option: Normal tree or menu.'], -\ 'defaultCommand' : [ ' ', 'If true the command is excuted as default -- for example if the user presses the enter key inside a related input field.'], -\ 'showNavigationBar' : [ ' ', '<p>**** @deprecated. Will be removed in a future version **** </p>Flag indicating that the Tab Navigationbar is rendered.'], -\ 'selectedIndex' : [ ' ', '<strong>ValueBindingExpression</strong> pointing to a Integer to save the component"s selected Tab.'], -\ 'serverside' : [ ' ', '<p>**** @deprecated. Will be removed in a future version **** </p>Deprecated! Use "switchType" instead. Flag indicating that tab switching is done by server request.'], -\ 'switchType' : [ ' ', 'Flag indicating how tab switching should be done. <p/> Possible values are: "client" : Tab switching id done on client, no server Request. This is default. "reloadPage" : Tab switching id done by server request. Full page is reloaded. "reloadTab" : Tab switching id done by server request. Only the Tab is reloaded.'], -\ 'border' : [ ' ', 'Border size of this component.'], -\ 'alt' : [ ' ', 'Alternate textual description of the image rendered by this component.'], -\ 'cellspacing' : [ ' ', 'Spacing between component and layout cell"s'], -\ 'margin' : [ ' ', 'Margin between container component and layouted children.'], -\ 'marginRight' : [ ' ', 'Right margin between container component and layouted children.'], -\ 'marginBottom' : [ ' ', 'Bottom margin between container component and layouted children.'], -\ 'marginTop' : [ ' ', 'Top margin between container component and layouted children.'], -\ 'marginLeft' : [ ' ', 'Left margin between container component and layouted children.'], -\ 'maxNumber' : [ ' ', 'Sets the maximum number of messages to show. The default is 2147483647 (more or less unlimited).'], -\ 'orderBy' : [ ' ', 'Sets the order of the messages. The default "occurence".'], -\ 'minSeverity' : [ ' ', 'Sets the mininum severity to be shown. E. g. "warn" shows only "warn", "error" and "fatal". The default is "info".'], -\ 'maxSeverity' : [ ' ', 'Sets the maximum severity to be shown. E. g. "warn" shows only "warn" and "info". When setting this attribute you usually shoud take care, that you have a second message tag to show the higher severity levels. The default is "fatal".'], -\ 'globalOnly' : [ ' ', 'Flag indicating that only messages that are not associated to any particular UIComponent should be displayed. That are messages without clientId. The default is "false".'], -\ 'focusId' : [ ' ', 'Contains the id of the component wich should have the focus after loading the page. Set to emtpy string for disabling setting of focus. Default (null) enables the "auto focus" feature.'], -\ 'applicationIcon' : [ ' ', 'Absolute URL to an image or image name to lookup in tobago resource path representing the application. In HTML it is used as a favicon.'], -\ 'doctype' : [ ' ', 'Possible values for doctype are: <dl> <dt>strict</dt><dd>HTML 4.01 Strict DTD</dd> <dt>loose</dt><dd>HTML 4.01 Transitional DTD</dd> <dt>frameset</dt><dd>HTML 4.01 Frameset DTD</dd> </dl> All other values are ignored and no DOCTYPE is set. The default value is "loose".'], -\ 'align' : [ ' ', 'Alignment of this column.'], -\ 'sortable' : [ ' ', 'Flag indicating whether or not this column is sortable. To make a column sortable the data of the sheet must be one of <code>java.util.List</code> or <code>Object[]</code>.'] -\ }, -\} diff --git a/home/.vim/autoload/xml/tx.vim b/home/.vim/autoload/xml/tx.vim deleted file mode 100644 index 93ec1f4..0000000 --- a/home/.vim/autoload/xml/tx.vim +++ /dev/null @@ -1,109 +0,0 @@ -let g:xmldata_tx= { -\ 'menuRadio': [ -\ [], -\ { 'action' : [],'actionListener' : [],'immediate' : [],'onclick' : [],'link' : [],'transition' : [],'id' : [],'binding' : [],'rendered' : [],'label' : [],'disabled' : [],'value' : [],'converter' : []} -\ ], -\ 'separator': [ -\ [], -\ { 'id' : [],'binding' : [],'rendered' : [],'label' : []} -\ ], -\ 'label': [ -\ [], -\ { 'value' : [],'tip' : []} -\ ], -\ 'date': [ -\ [], -\ { 'value' : [],'valueChangeListener' : [],'validator' : [],'id' : [],'binding' : [],'rendered' : [],'converter' : [],'readonly' : [],'disabled' : [],'onchange' : [],'required' : [],'tip' : [],'label' : [],'markup' : [],'labelWidth' : [],'focus' : [],'inline' : [],'tabIndex' : []} -\ ], -\ 'textarea': [ -\ [], -\ { 'value' : [],'valueChangeListener' : [],'id' : [],'binding' : [],'rendered' : [],'converter' : [],'validator' : [],'readonly' : [],'disabled' : [],'markup' : [],'required' : [],'tip' : [],'label' : [],'labelWidth' : [],'focus' : [],'onchange' : [],'tabIndex' : []} -\ ], -\ 'selectManyListbox': [ -\ [], -\ { 'id' : [],'value' : [],'valueChangeListener' : [],'disabled' : [],'height' : [],'inline' : [],'label' : [],'labelWidth' : [],'rendered' : [],'binding' : [],'tip' : [],'converter' : [],'validator' : [],'onchange' : [],'readonly' : [],'markup' : [],'focus' : [],'required' : [],'tabIndex' : []} -\ ], -\ 'selectBooleanCheckbox': [ -\ [], -\ { 'validator' : [],'onchange' : [],'valueChangeListener' : [],'id' : [],'binding' : [],'rendered' : [],'label' : [],'value' : [],'labelWidth' : [],'disabled' : [],'tip' : [],'readonly' : [],'markup' : [],'tabIndex' : [],'focus' : []} -\ ], -\ 'selectOneListbox': [ -\ [], -\ { 'id' : [],'value' : [],'valueChangeListener' : [],'disabled' : [],'label' : [],'labelWidth' : [],'readonly' : [],'onchange' : [],'rendered' : [],'markup' : [],'binding' : [],'height' : [],'focus' : [],'tip' : [],'required' : [],'converter' : [],'validator' : [],'tabIndex' : []} -\ ], -\ 'in': [ -\ [], -\ { 'value' : [],'valueChangeListener' : [],'validator' : [],'id' : [],'binding' : [],'rendered' : [],'converter' : [],'readonly' : [],'disabled' : [],'onchange' : [],'markup' : [],'required' : [],'tip' : [],'label' : [],'labelWidth' : [],'password' : [],'focus' : [],'suggestMethod' : [],'tabIndex' : []} -\ ], -\ 'time': [ -\ [], -\ { 'value' : [],'valueChangeListener' : [],'validator' : [],'id' : [],'binding' : [],'rendered' : [],'converter' : [],'readonly' : [],'disabled' : [],'onchange' : [],'required' : [],'tip' : [],'label' : [],'labelWidth' : [],'focus' : [],'inline' : [],'tabIndex' : []} -\ ], -\ 'selectOneRadio': [ -\ [], -\ { 'id' : [],'value' : [],'valueChangeListener' : [],'disabled' : [],'markup' : [],'readonly' : [],'onchange' : [],'inline' : [],'label' : [],'labelWidth' : [],'required' : [],'rendered' : [],'binding' : [],'tip' : [],'validator' : [],'converter' : [],'renderRange' : [],'tabIndex' : []} -\ ], -\ 'selectManyCheckbox': [ -\ [], -\ { 'id' : [],'value' : [],'valueChangeListener' : [],'disabled' : [],'height' : [],'inline' : [],'label' : [],'labelWidth' : [],'rendered' : [],'binding' : [],'tip' : [],'converter' : [],'validator' : [],'onchange' : [],'readonly' : [],'markup' : [],'focus' : [],'required' : [],'tabIndex' : [],'renderRange' : []} -\ ], -\ 'menuCheckbox': [ -\ [], -\ { 'action' : [],'actionListener' : [],'immediate' : [],'onclick' : [],'link' : [],'transition' : [],'id' : [],'binding' : [],'rendered' : [],'disabled' : [],'value' : [],'label' : []} -\ ], -\ 'file': [ -\ [], -\ { 'validator' : [],'onchange' : [],'value' : [],'valueChangeListener' : [],'tabIndex' : [],'id' : [],'binding' : [],'rendered' : [],'disabled' : [],'tip' : [],'label' : [],'labelWidth' : [],'required' : []} -\ ], -\ 'selectOneChoice': [ -\ [], -\ { 'id' : [],'value' : [],'valueChangeListener' : [],'disabled' : [],'readonly' : [],'onchange' : [],'inline' : [],'label' : [],'labelWidth' : [],'required' : [],'rendered' : [],'focus' : [],'binding' : [],'tip' : [],'validator' : [],'converter' : [],'markup' : [],'tabIndex' : []} -\ ], -\ 'vimxmltaginfo': { -\ 'menuRadio' : [ ' ', 'Renders a submenu with select one items (like a radio button).<p><b>Extended tag: </b>org.apache.myfaces.tobago.taglib.component.MenuRadioTag</p><p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UISelectOneCommand</p><p><b>RendererType: </b>MenuCommand</p>'], -\ 'separator' : [ ' ', 'Renders a separator. <br /> Short syntax of: <p/> <pre> <tc:separator> <f:facet name="label"> <tc:label value="label"/> </f:facet> </tc:separator> </pre><p><b>Extended tag: </b>org.apache.myfaces.tobago.taglib.component.SeparatorTag</p><p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UISeparator</p><p><b>RendererType: </b>Separator</p><p><b>Supported facets:</b></p><dl><dt><b>label</b></dt><dd>This facet contains a UILabel</dd></dl>'], -\ 'label' : [ ' ', '<p><b>Extended tag: </b>org.apache.myfaces.tobago.taglib.component.LabelTag</p><p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UILabel</p><p><b>RendererType: </b>Label</p>'], -\ 'date' : [ ' ', 'Renders a date input field with a date picker and a label. <br /> Short syntax of: <p/> <pre> <tc:panel> <f:facet name="layout"> <tc:gridLayout columns="fixed;*"/> </f:facet> <tc:label value="#{label}" for="@auto"/> <tc:date value="#{value}"> ... </tc:in> </tc:panel> </pre><p><b>Extended tag: </b>org.apache.myfaces.tobago.taglib.component.DateTag</p><p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UIDateInput</p><p><b>RendererType: </b>Date</p>'], -\ 'textarea' : [ ' ', 'Renders a multiline text input control with a label. <br /> Short syntax of: <p/> <pre> <tc:panel> <f:facet name="layout"> <tc:gridLayout columns="fixed;*"/> </f:facet> <tc:label value="#{label}" for="@auto"/> <tc:textarea value="#{value}"> ... </tc:in> </tc:panel> </pre><p><b>Extended tag: </b>org.apache.myfaces.tobago.taglib.component.TextAreaTag</p><p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UIInput</p><p><b>RendererType: </b>TextArea</p>'], -\ 'selectManyListbox' : [ ' ', 'Render a group of checkboxes.<p><b>Extended tag: </b>org.apache.myfaces.tobago.taglib.component.SelectManyListboxTag</p><p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UISelectMany</p><p><b>RendererType: </b>SelectManyListbox</p>'], -\ 'selectBooleanCheckbox' : [ ' ', 'Renders a checkbox.<p><b>Extended tag: </b>org.apache.myfaces.tobago.taglib.component.SelectBooleanCheckboxTag</p><p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UISelectBoolean</p><p><b>RendererType: </b>SelectBooleanCheckbox</p><p><b>Supported facets:</b></p><dl><dt><b>click</b></dt><dd>This facet can contain a UICommand that is invoked in case of a click event from the component</dd><dt><b>change</b></dt><dd>This facet can contain a UICommand that is invoked in case of a change event from the component</dd></dl>'], -\ 'selectOneListbox' : [ ' ', 'Render a single selection option listbox.<p><b>Extended tag: </b>org.apache.myfaces.tobago.taglib.component.SelectOneListboxTag</p><p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UISelectOne</p><p><b>RendererType: </b>SelectOneListbox</p><p><b>Supported facets:</b></p><dl><dt><b>click</b></dt><dd>This facet can contain a UICommand that is invoked in case of a click event from the component</dd><dt><b>change</b></dt><dd>This facet can contain a UICommand that is invoked in case of a change event from the component</dd></dl>'], -\ 'in' : [ ' ', 'Renders a text input field with a label. <br /> Short syntax of: <p/> <pre> <tc:panel> <f:facet name="layout"> <tc:gridLayout columns="fixed;*"/> </f:facet> <tc:label value="#{label}" for="@auto"/> <tc:in value="#{value}"> ... </tc:in> </tc:panel> </pre><p><b>Extended tag: </b>org.apache.myfaces.tobago.taglib.component.InTag</p><p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UIInput</p><p><b>RendererType: </b>In</p>'], -\ 'time' : [ ' ', 'Renders a time input field with a label. <br /> Short syntax of: <p/> <pre> <tc:panel> <f:facet name="layout"> <tc:gridLayout columns="fixed;*"/> </f:facet> <tc:label value="#{label}" for="@auto"/> <tc:time value="#{value}"> ... </tc:in> </tc:panel> </pre><p><b>Extended tag: </b>org.apache.myfaces.tobago.taglib.component.TimeTag</p><p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UITimeInput</p><p><b>RendererType: </b>Time</p>'], -\ 'selectOneRadio' : [ ' ', 'Render a set of radiobuttons.<p><b>Extended tag: </b>org.apache.myfaces.tobago.taglib.component.SelectOneRadioTag</p><p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UISelectOne</p><p><b>RendererType: </b>SelectOneRadio</p><p><b>Supported facets:</b></p><dl><dt><b>click</b></dt><dd>This facet can contain a UICommand that is invoked in case of a click event from the component</dd><dt><b>change</b></dt><dd>This facet can contain a UICommand that is invoked in case of a change event from the component</dd></dl>'], -\ 'selectManyCheckbox' : [ ' ', 'Render a group of checkboxes.<p><b>Extended tag: </b>org.apache.myfaces.tobago.taglib.component.SelectManyCheckboxTag</p><p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UISelectMany</p><p><b>RendererType: </b>SelectManyCheckbox</p>'], -\ 'menuCheckbox' : [ ' ', 'Renders a checkable menuitem.<p><b>Extended tag: </b>org.apache.myfaces.tobago.taglib.component.MenuCheckboxTag</p><p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UISelectBooleanCommand</p><p><b>RendererType: </b>MenuCommand</p>'], -\ 'file' : [ ' ', 'Renders a file input field with a label. <p/> Short syntax of: <p/> <pre> <tc:panel> <f:facet name="layout"> <tc:gridLayout columns="fixed;*"/> </f:facet> <tc:label value="#{label}" for="@auto"/> <tc:file value="#{value}"> ... </tc:in> </tc:panel> </pre><p><b>Extended tag: </b>org.apache.myfaces.tobago.taglib.component.FileTag</p><p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UIFileInput</p><p><b>RendererType: </b>File</p>'], -\ 'selectOneChoice' : [ ' ', 'Render a single selection dropdown list with a label.<p><b>Extended tag: </b>org.apache.myfaces.tobago.taglib.component.SelectOneChoiceTag</p><p><b>UIComponentClass: </b>org.apache.myfaces.tobago.component.UISelectOne</p><p><b>RendererType: </b>SelectOneChoice</p><p><b>Supported facets:</b></p><dl><dt><b>click</b></dt><dd>This facet can contain a UICommand that is invoked in case of a click event from the component</dd><dt><b>change</b></dt><dd>This facet can contain a UICommand that is invoked in case of a change event from the component</dd></dl>'] -\ }, -\ 'vimxmlattrinfo': { -\ 'action' : [ ' ', 'Action to invoke when clicked. This must be a MethodBinding or a String representing the application action to invoke when this component is activated by the user. The MethodBinding must evaluate to a public method that takes no parameters, and returns a String (the logical outcome) which is passed to the NavigationHandler for this application. The String is directly passed to the Navigationhandler.'], -\ 'actionListener' : [ ' ', 'MethodBinding representing an action listener method that will be notified when this component is activated by the user. The expression must evaluate to a public method that takes an ActionEvent parameter, with a return type of void.'], -\ 'immediate' : [ ' ', 'Flag indicating that, if this component is activated by the user, notifications should be delivered to interested listeners and actions immediately (that is, during Apply Request Values phase) rather than waiting until Invoke Application phase.'], -\ 'onclick' : [ ' ', 'Script to be invoked when clicked'], -\ 'link' : [ ' ', 'Link to an arbitrary URL'], -\ 'transition' : [ ' ', 'Specify, if the command calls an JSF-Action. Useful to switch off the Double-Submit-Check and Waiting-Behavior.'], -\ 'id' : [ ' ', 'The component identifier for this component. This value must be unique within the closest parent component that is a naming container.'], -\ 'binding' : [ ' ', 'The value binding expression linking this component to a property in a backing bean.'], -\ 'rendered' : [ ' ', 'Flag indicating whether or not this component should be rendered (during Render Response Phase), or processed on any subsequent form submit.'], -\ 'label' : [ ' ', 'Text value to display as label. If text contains an underscore the next character is used as accesskey.'], -\ 'disabled' : [ ' ', 'Flag indicating that this element is disabled.'], -\ 'value' : [ ' ', 'The current value of this component.'], -\ 'converter' : [ ' ', 'An expression that specifies the Converter for this component. If the value binding expression is a String, the String is used as an ID to look up a Converter. If the value binding expression is a Converter, uses that instance as the converter. The value can either be a static value (ID case only) or an EL expression.'], -\ 'tip' : [ ' ', 'Text value to display as tooltip.'], -\ 'valueChangeListener' : [ ' ', 'MethodBinding representing a value change listener method that will be notified when a new value has been set for this input component. The expression must evaluate to a public method that takes a ValueChangeEvent parameter, with a return type of void.'], -\ 'validator' : [ ' ', 'A method binding EL expression, accepting FacesContext, UIComponent, and Object parameters, and returning void, that validates the component"s local value.'], -\ 'readonly' : [ ' ', 'Flag indicating that this component will prohibit changes by the user.'], -\ 'onchange' : [ ' ', 'Clientside script function to add to this component"s onchange handler.'], -\ 'required' : [ ' ', 'Flag indicating that a value is required. If the value is an empty string a ValidationError occurs and a Error Message is rendered.'], -\ 'markup' : [ ' ', 'Indicate markup of this component. Possible value is "none". But this can be overridden in the theme.'], -\ 'labelWidth' : [ ' ', 'The width for the label component. Default: "fixed". This value is used in the gridLayouts columns attribute. See gridLayout tag for valid values.'], -\ 'focus' : [ ' ', 'Flag indicating this component should recieve the focus.'], -\ 'inline' : [ ' ', 'Flag indicating this component should rendered as an inline element.'], -\ 'tabIndex' : [ ' ', ''], -\ 'height' : [ ' ', '<p>**** @deprecated. Will be removed in a future version **** </p>The height for this component.'], -\ 'password' : [ ' ', 'Flag indicating whether or not this component should be rendered as password field , so you will not see the typed charakters.'], -\ 'suggestMethod' : [ ' ', 'MethodBinding which generates a list of suggested input values based on a passed prefix -- the currently entered text. The expression has to evaluate to a public method which has a String parameter and a List<String> as return type.'], -\ 'renderRange' : [ ' ', 'Range of items to render.'] -\ }, -\} diff --git a/home/.vim/compiler/javac_ex.vim b/home/.vim/compiler/javac_ex.vim deleted file mode 100644 index 5ae0a09..0000000 --- a/home/.vim/compiler/javac_ex.vim +++ /dev/null @@ -1,19 +0,0 @@ -" Vim compiler file -" Compiler: javac -" Maintainer: Doug Kearns <djkea2@gus.gscit.monash.edu.au> -" URL: http://gus.gscit.monash.edu.au/~djkea2/vim/compiler/javac.vim -" Last Change: 2004 Nov 27 - -if exists("current_compiler") - finish -endif -let current_compiler = "javac_ex" - -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - -CompilerSet makeprg=javac - -"CompilerSet errorformat=%E%f:%l:\ %m,%-Z%p^,%-C%.%#,%-G%.%# -CompilerSet errorformat=%E%f:%l:\ %m,%-Z%p^,%+C%.%#,%-G.%#
\ No newline at end of file diff --git a/home/.vim/doc/CSApprox.txt b/home/.vim/doc/CSApprox.txt deleted file mode 100644 index d91bb62..0000000 --- a/home/.vim/doc/CSApprox.txt +++ /dev/null @@ -1,599 +0,0 @@ -*CSApprox.txt* Bringing GVim colorschemes to the terminal! - - *csapprox* *csapprox.vim* - - _____ ____ ___ ~ - / ___// __// _ | ___ ___ ____ ___ __ __ ~ - / /__ _\ \ / __ | / _ \ / _ \ / __// _ \ \ \ / ~ - \___//___//_/ |_|/ .__// .__//_/ \___//_\_\ ~ - /_/ /_/ ~ - For Vim version 7.0 or newer - Last changed 01 Apr 2009 - - By Matt Wozniski - mjw@drexel.edu - - Reference Manual~ - - *csapprox-toc* - -1. Introduction |csapprox-intro| -2. Requirements |csapprox-requirements| -3. Configuration |csapprox-configure| -4. Rationale/Design |csapprox-design| -5. Known Bugs and Limitations |csapprox-limitations| -6. Appendix - Terminals and Palettes |csapprox-terminal-list| -7. Changelog |csapprox-changelog| -8. Contact Info |csapprox-author| - -The functionality mentioned here is a plugin, see |add-plugin|. -You can avoid loading this plugin by setting the "CSApprox_loaded" global -variable in your |vimrc| file: > - :let g:CSApprox_loaded = 1 - -============================================================================== -1. Introduction *csapprox-intro* - -It's hard to find colorschemes for terminal Vim. Most colorschemes are -written to only support GVim, and don't work at all in terminal Vim. - -This plugin makes GVim-only colorschemes Just Work in terminal Vim, as long -as the terminal supports 88 or 256 colors - and most do these days. This -usually requires no user interaction (but see below for what to do if things -don't Just Work). After getting this plugin happily installed, any time you -use :colorscheme it will do its magic and make the colorscheme Just Work. - -Whenever you change colorschemes using the :colorscheme command this script -will be executed. It will take the colors that the scheme specified for use -in the GUI and use an approximation algorithm to try to gracefully degrade -them to the closest color available in your terminal. If you are running in -a GUI or if your terminal doesn't support 88 or 256 colors, no changes are -made. Also, no changes will be made if the colorscheme seems to have been -high color already. - -If for some reason this transparent method isn't suitable to you (for instance -if your environment can't be configured to meet the |csapprox-requirements|, -or you need to work in Vim 6), another option is also available: using the -|:CSApproxSnapshot| command to create a new GUI/88-/256-color terminal -colorscheme. To use this command, a user would generally start GVim, choose a -colorscheme that sets up the desired colors, and then use |:CSApproxSnapshot| -to create a new colorscheme based on those colors that works in high color -terminals. This method is more flexible than the transparent mode and works -in more places, but also requires more user intervention, and makes it harder -to deal with colorschemes being updated and such. - *:CSApproxSnapshot* -The full syntax for the command is: > - :CSApproxSnapshot[!] /path/to/new/colorscheme -< For example: > - :CSApproxSnapshot ~/.vim/colors/foobar.vim -< -NOTE: The generated colorscheme will only work in 88- and 256-color terminals, - and in GVim. It will not work at all in a terminal with 16 or fewer - colors. There's just no reliable way to approximate down from - 16,777,216 colors to 16 colors, especially without there being any - standard for what those 16 colors look like other than 'orange-ish', - 'red-ish', etc. - -NOTE: Although :CSApproxSnapshot can be used in both GVim and terminal Vim, - the resulting colors might be slightly off when run from terminal Vim. - I can find no way around this; Vim internally sets different colors when - running in a terminal than running in the GUI, and there's no way for - terminal Vim to figure out what color would have been used in GVim. - -============================================================================== -2. Requirements *csapprox-requirements* - -For CSApprox to work, there are 2 major requirements that must be met. - -a) GUI support *csapprox-gui-support* *csapprox-+gui* - -If CSApprox is being used to adjust a scheme's colors transparently, then the -terminal "vim" binary that is being run must be built with GUI support (see -|csapprox-limitations| for an explanation). If |:CSApproxSnapshot| is being -used to create a terminal colorscheme for high color terminals, then the -"vim" binary being used to create the scheme must be built with +gui, but the -scheme can be used in terminal "vim" binaries that weren't built with +gui. -NOTE that creating snapshots with GVim will work better than making them with -Vim, and (obviously) all "gvim" binaries are built with +gui. - -Unfortunately, several Linux distributions only include GUI support in their -"gvim" binary, and not in their "vim" binary. You can check if GUI support is -available with the following command: - :echo has('gui') - -If that prints 0, the first thing to try would be searching for a larger vim -package provided by your distribution, like "vim-enhanced" on RedHat/CentOS -or "vim-gtk" or "vim-gnome" on Debian/Ubuntu. - -If you are unable to obtain a "vim" binary that includes GUI support, but -have a "gvim" binary available, you can probably launch Vim with GUI support -anyway by calling gvim with the |-v| flag in the shell: > - gvim -v - -If the above works, you can remove the need to call "gvim -v" instead of "vim" -all the time by creating a symbolic link from your "gvim" binary to "vim" -somewhere in your $PATH, for example: - sudo ln -s $(which gvim) $(which vim) - -If launching as "gvim -v" doesn"t work, and no package with GUI support is -available, you will need to compile Vim yourself and ensure that GUI support -is included to use CSApprox in its transparent mode, or create a snapshotted -scheme from GVim to use its snapshot mode. If this is inconvenient for you, -make sure that the Vim maintainer for your distribution knows it; they made a -conscious decision to build "vim" without +gui and "gvim" without terminal -support. - -b) Properly configured terminal *csapprox-terminal* - -As said above, many modern terminals support 88 or 256 colors, but most of -these default to setting $TERM to something generic (usually "xterm"). Since -Vim uses the value of the "colors" attribute for the current $TERM in terminfo -to figure out the number of colors used internally as 't_Co', this plugin will -either need for 't_Co' to be set to 88 or 256 in |vimrc|, or for $TERM to be -set to something that implies high color support. Possible choices include -"xterm-256color" for 256 color support and "rxvt-unicode" for 88 color -support. - *csapprox-palettes* -Also, there are three different 256 color cube palettes available and CSApprox -has no way to tell which you're using unless $TERM is set to something that is -specific to the terminal, like "konsole-256color" or "Eterm". Because of this, the -most sane behavior is assuming the user is using the most popular palette, -which is used by all but Konsole and Eterm, whenever $TERM is set to something -generic like "xterm" or "screen". You can override this default, however - -see |csapprox-configure|. - *csapprox-terminal-example* -To turn on high color support without fixing $TERM, you can change t_Co in -your .vimrc, and set either CSApprox_konsole or CSApprox_eterm if appropriate. -One way would be to put something like this into your |vimrc|: -> - if (&term == 'xterm' || &term =~? '^screen') && hostname() == 'my-machine' - " On my machine, I use Konsole with 256 color support - set t_Co=256 - let g:CSApprox_konsole = 1 - endif - -Gnome Terminal, as of the time that I am writing this, doesn't support having -the terminal emulator set $TERM to something adequately descriptive. In cases -like this, something like the following would be appropriate: -> - if &term =~ '^\(xterm\|screen\)$' && $COLORTERM == 'gnome-terminal' - set t_Co=256 - endif - -============================================================================== -3. Configuration *csapprox-configure* - -There are several global variables that can be set to configure the behavior -of CSApprox. They are listed roughly based on the likelihood that the end -user might want to know about them. - -g:CSApprox_loaded *g:CSApprox_loaded* - If set in your |vimrc|, CSApprox is not loaded. Has no effect on - snapshotted schemes. - -g:CSApprox_verbose_level *g:CSApprox_verbose_level* - When CSApprox is run, the 'verbose' option will be temporarily raised to - the value held in this variable unless it is already greater. The default - value is 1, which allows CSApprox to default to warning whenever something - is wrong, even if it is recoverable, but allows the user to quiet us if he - wants by changing this variable to 0. The most important messages will be - shown at verbosity level 1; some less important ones will be shown at - higher verbosity levels. Has no effect on snapshotted schemes. - -g:CSApprox_eterm *g:CSApprox_eterm* - If set to a non-zero number, CSApprox will use the Eterm palette when - 'term' is set to "xterm" or begins with "screen". Otherwise, the xterm - palette would be used. This also affects snapshotted schemes. - -g:CSApprox_konsole *g:CSApprox_konsole* - If set to a non-zero number, CSApprox will use the Konsole palette when - 'term' is set to "xterm" or begins with "screen". Otherwise, the xterm - palette would be used. This also affects snapshotted schemes. - -g:CSApprox_attr_map *g:CSApprox_attr_map* - Since some attributes (like 'guisp') can't be used in a terminal, and - others (like 'italic') are often very ugly in terminals, a generic way to - map between a requested attribute and another attribute is included. This - variable should be set to a Dictionary, where the keys are strings - representing the attributes the author wanted set, and the values are the - strings that the user wants set instead. If a value is '', it means the - attribute should just be ignored. The default is to replace 'italic' with - 'underline', and to use 'fg' instead of 'sp': > - let g:CSApprox_attr_map = { 'italic' : 'underline', 'sp' : 'fg' } -< - Your author prefers disabling bold and italic entirely, so uses this: > - let g:CSApprox_attr_map = { 'bold' : '', 'italic' : '', 'sp' : 'fg' } -< - - Note: This transformation is considered at the time a snapshotted scheme - is created, rather than when it is used. - - Note: You can only map an attribute representing a color to another - attribute representing a color; likewise with boolean attributes. - After all, sp -> bold and italic -> fg would be nonsensical. - - *g:CSApprox_hook_pre* *g:CSApprox_hook_{scheme}_pre* - *g:CSApprox_hook_post* *g:CSApprox_hook_{scheme}_post* -g:CSApprox_hook_pre -g:CSApprox_hook_post -g:CSApprox_hook_{scheme}_pre -g:CSApprox_hook_{scheme}_post *csapprox-hooks* - These variables provide a method for adjusting tweaking the approximation - algorithm, either for all schemes, or on a per scheme basis. For - snapshotted schemes, these will only take effect when the snapshotted - scheme is created, rather than when it is used. Each of these variables - may be set to either a String containing a command to be :execute'd, or a - List of such Strings. The _pre hooks are executed before any - approximations have been done. In order to affect the approximation at - this stage, you would need to change the gui colors for a group; the cterm - colors will then be approximated from those gui colors. Example: -> - let g:CSApprox_hook_pre = 'hi Comment guibg=#ffddff' -< - The advantage to tweaking the colors at this stage is that CSApprox will - handle approximating the given gui colors to the proper cterm colors, - regardless of the number of colors the terminal supports. The - disadvantage is that certain things aren't possible, including clearing - the background or foreground color for a group, selecting a precise cterm - color to be used, and overriding the mappings made by g:CSApprox_attr_map. - Another notable disadvantage is that overriding things at this level will - actually affect the gui colors, in case the :gui is used to start gvim - from the running vim instance. - - To overcome these disadvantages, the _post hooks are provided. These - hooks will be executed only after all approximations have been completed. - At this stage, in order to have changes appear the cterm* colors must be - modified. For example: - *csapprox-transparency* -> - let g:CSApprox_hook_post = ['hi Normal ctermbg=NONE ctermfg=NONE', - \ 'hi NonText ctermbg=NONE ctermfg=NONE' ] -< - Setting g:CSApprox_hook_post as shown above will clear the background of - the Normal and NonText groups, forcing the terminal's default background - color to be used instead, including any pseudotransparency done by that - terminal emulator. As noted, though, the _post functions do not allow - CSApprox to approximate the colors. This may be desired, but if this is - an inconvenience the function named by g:CSApprox_approximator_function - can still be called manually. For example: -> - let g:CSApprox_hook_post = 'exe "hi Comment ctermbg="' - \ . '. g:CSApprox_approximator_function(0xA0,0x50,0x35)' -< - The _{scheme}_ versions are exactly like their counterparts, except that - they will only be executed if the value of g:colors_name matches the - scheme name embedded in the variable name. They will be executed after - the corresponding hook without _{scheme}_, which provides a way to - override a less specific hook with a more specific one. For example, to - clear the Normal and NonText groups, but only for the colorscheme - "desert", one could do the following: -> - let g:CSApprox_hook_desert_post = ['hi Normal ctermbg=NONE ctermfg=NONE', - \ 'hi NonText ctermbg=NONE ctermfg=NONE' ] -< - One final example: If you want CSApprox to be active for nearly all - colorschemes, but want one or two particular schemes to be ignored, you - can take advantage of the CSApprox logic that skips over any color scheme - that is already high color by setting a color to a number above 255. Note - that most colors greater than 15 will work, but some will not - 256 should - always work. For instance, you can prevent CSApprox from modifying the - colors of the zellner colorscheme like this: -> - let g:CSApprox_hook_zellner_pre = 'hi _FakeGroup ctermbg=256' -< - NOTE: Any characters that would stop the string stored in g:colors_name - from being a valid variable name will be removed before the - _{scheme}_ hook is searched. Basically, this means that first all - characters that are neither alphanumeric nor underscore will be - removed, then any leading digits will be removed. So, for a - colorscheme named "123 foo_bar-baz456.vim", the hook searched for - will be, eg, g:CSApprox_hook_foo_barbaz456_post - -g:CSApprox_use_showrgb *g:CSApprox_use_showrgb* - By default, CSApprox will use a built in mapping of color names to values. - This optimization greatly helps speed, but means that colors addressed by - name might not match up perfectly between gvim (which uses the system's - real rgb database) and CSApprox (which uses the builtin database). To - force CSApprox to try the systemwide database first, and only fall back on - the builtin database if it isn't available, set this variable non-zero. - -g:CSApprox_approximator_function *g:CSApprox_approximator_function* - If the default approximation function doesn't work well enough, the user - (or another author wishing to extend this plugin) can write another - approximation function. This function should take three numbers, - representing r, g, and b in decimal, and return the index on the color - cube that best matches those colors. Assigning a |Funcref| to this - variable will override the default approximator with the one the Funcref - references. This option will take effect at the time a snapshotted scheme - is created, rather than when it's used. - -g:CSApprox_redirfallback *g:CSApprox_redirfallback* - Until Vim 7.2.052, there was a bug in the Vim function synIDattr() that - made it impossible to determine syntax information about the |guisp| - attribute. CSApprox includes a workaround for this problem, as well as a - test that ought to disable this workaround if synIDattr() works properly. - If this test should happen to give improper results somehow, the user can - force the behavior with this variable. When set to 1, the workaround will - always be used, and when set to 0, synIDattr() is blindly used. Needless - to say, if this automatic detection should ever fail, the author would - like to be notified! This option will take effect at the time a - snapshotted scheme is created, rather than when it's used. - -============================================================================== -4. Rationale/Design *csapprox-design* - -There is a wealth of colorschemes available for Vim. Unfortunately, since -traditional terminal emulators have only supported 2, 8 or 16 colors, -colorscheme authors have tended to avoid writing colorschemes for terminal -Vim, sticking instead to GVim. Even now that nearly every popular terminal -supports either 88 or 256 colors, few colorschemes are written to support -them. This may be because the terminal color codes are just numbers from 0 to -87 or 255 with no semantic meaning, or because the same number doesn't yield -the same color in all terminals, or simply because the colorscheme author -doesn't use the terminal and doesn't want to take the time to support -terminals. - -Whatever the reason, this leaves users of many modern terminal emulators in -the awkward position of having a terminal emulator that supports many colors, -but having very few colorschemes that were written to utilize those colors. - -This is where CSApprox comes in. It attempts to fill this void allowing GVim -colorschemes to be used in terminal Vim. CSApprox has two distinct modes of -operation. In the first mode, it attempts to make GVim colorschemes -transparently backwards compatible with terminal Vim in a high color terminal. -Basically, whenever a colorscheme is run it should set some colors for the -GUI, and this script will then run and attempt to figure out the closest color -available in the terminal's color palette to the color the scheme author asked -for. Unfortunately, this does not work well all the time, and it has some -limitations (see |csapprox-limitations|). Most of the time, however, this -gives a very close approximation to the GVim colors without requiring any -changes to the colorscheme, or any user interaction. It only requires that -the plugin be installed on the machine where Vim is being run, and that the -user's environment meets the needs specified at |csapprox-requirements|. In -the event that this doesn't work, a second option - using :CSApproxSnapshot -to create a new, 88-/256-color capable colorscheme - is available. - -Ideally, the aim is for CSApprox to be completely transparent to the user. -This is why the approach I take is entirely different from the GuiColorScheme -script, which will break on any but the simplest colorschemes. Unfortunately, -given the difficulty of determining exactly which terminal emulator the user -is running, and what features it supports, and which color palette it's using, -perfect transparency is difficult. So, to this end, I've attempted to default -to settings that make it unlikely that this script ever makes things worse -(this is why I chose not to override t_Co to 256 myself), and I've attempted -to make it easy to override my choice of defaults when necessary (through -g:CSApprox_approximator_function, g:CSApprox_konsole, g:CSApprox_eterm, -g:CSApprox_attr_map, etc). - -In the event that the transparent solution is undesirable, or that the user's -environment can't be configured to allow it (no GVim and no Vim with +gui, for -instance), |:CSApproxSnapshot| should provide a workable alternative - less -cool, and less flexible, but it will work in more environments, and the -snapshotted colorscheme will even work in Vim 6. - -If any of my design choices seem to be causing extra work with no real -advantages, though, I'd like to hear about it. Feel free to email me with any -improvements or complaints. - -============================================================================== -5. Known Bugs and Limitations *csapprox-limitations* - -GUI support is required for transparently adapting schemes. - - There is nothing I can do about this given my chosen design. CSApprox works - by being notified every time a colorscheme sets some GUI colors, then - approximating those colors to similar terminal colors. Unfortunately, when - Vim is not built with GUI support, it doesn't bother to store the GUI - colors, so querying for them fails. This leaves me completely unable to - tell what the colorscheme was trying to do. See |csapprox-+gui| for some - potential workarounds if your distribution doesn't provide a Vim with +gui. - -User intervention is sometimes required for information about the terminal. - - This is really an insurmountable problem. Unfortunately, most terminal - emulators default to setting $TERM to 'xterm', even when they're not really - compatible with an xterm. $TERM is really the only reliable way to - find anything at all out about the terminal you're running in, so there's no - way to know if the terminal supports 88 or 256 colors without either the - terminal telling me (using $TERM) or the user telling me (using 't_Co'). - Similarly, unless $TERM is set to something that implies a certain color - palette ought to be used, there's no way for me to know, so I'm forced to - default to the most common, xterm's palette, and allow the user to override - my choice with |g:CSApprox_konsole| or |g:CSApprox_eterm|. An example of - configuring Vim to work around a terminal where $TERM is set to something - generic without configuring the terminal properly is shown at - |csapprox-terminal-example|. - -Some colorschemes could fail to be converted if they try to be too smart. - - A colorscheme could decide to only set colors for the mode Vim is running - in. If a scheme only sets GUI colors when the GUI is running, instead of - using the usual approach of setting all colors and letting Vim choose which - to use, my approach falls apart. My method for figuring out what the scheme - author wants the scheme to look like absolutely depends upon him setting the - GUI colors in all modes. Fortunately, the few colorschemes that do this - seem to be, by and large, intended for 256 color terminals already, meaning - that skipping them is the proper behavior. Note that this will only affect - transparently adapted schemes and snapshots made from terminal Vim; - snapshots made from GVim are immune to this problem. - -Transparently adapting schemes is slow. - - For me, it takes Vim's startup time from 0.15 seconds to 0.35 seconds. This - is probably still acceptable, but it is definitely worth trying to cut down - on this time in future versions. Snapshotted schemes are faster to use, - since all of the hard evaluations are made when they're made instead of when - they're used. - - NOTE: As of CSApprox 3.50, the overhead is down to about 0.10 seconds on my - test machine. - -============================================================================== -6. Appendix - Terminals and Palettes *csapprox-terminal-list* - -What follows is a list of terminals known to have and known not to have high -color support. This list is certainly incomplete; feel free to contact me -with more to add to either list. - - *csapprox-terminals-good* -------------------------------- Good Terminals ------------------------------- - -The most recent versions of each of these terminals can be compiled with -either 88 or 256 color support. - - *csapprox-xterm* -xterm: - 256 color palette - Colors composed of: [ 0x00, 0x5F, 0x87, 0xAF, 0xD7, 0xFF ] - Greys composed of: [ 0x08, 0x12, 0x1C, 0x26, 0x30, 0x3A, 0x44, 0x4E, - 0x58, 0x62, 0x6C, 0x76, 0x80, 0x8A, 0x94, 0x9E, - 0xA8, 0xB2, 0xBC, 0xC6, 0xD0, 0xDA, 0xE4, 0xEE ] - - *csapprox-urxvt* -rxvt-unicode (urxvt): - 88 colors by default (but a patch is available to use xterm's palette) - Colors composed of: [ 0x00, 0x8B, 0xCD, 0xFF ] - Greys composed of: [ 0x2E, 0x5C, 0x73, 0x8B, 0xA2, 0xB9, 0xD0, 0xE7 ] - - *csapprox-pterm* *csapprox-putty* -PuTTY (pterm; putty.exe): - 256 colors; same palette as xterm - - *csapprox-mrxvt* -Mrxvt (mrxvt): - 256 colors; same palette as xterm - - *csapprox-gnome-terminal* -GNOME Terminal (gnome-terminal): - 256 colors; same palette as xterm - - *csapprox-roxterm* -ROXTerm (roxterm): - 256 colors; same palette as xterm - - *csapprox-xfce4-terminal* -Terminal (xfce4-terminal): - 256 colors; same palette as xterm - - *csapprox-iterm.app* -iTerm (iTerm.app): - 256 colors; same palette as xterm - *csapprox-konsole* -Konsole (konsole): - 256 color palette - Colors composed of: [ 0x00, 0x33, 0x66, 0x99, 0xCC, 0xFF ] - Same greyscales as xterm - You should set the g:CSApprox_konsole variable unless $TERM begins with - 'konsole', case insensitive - - *csapprox-eterm* -eterm (Eterm): - 256 color palette - Colors composed of: [ 0x00, 0x2A, 0x55, 0x7F, 0xAA, 0xD4 ] - Same greyscales as xterm - You should set the g:CSApprox_eterm variable unless $TERM begins with - 'eterm', case insensitive - - *csapprox-screen* -GNU Screen (screen): - 256 color support. Internally, uses the xterm palette, but this is only - relevant when running screen inside a terminal with fewer than 256 colors, - in which case screen will attempt to map between its own 256 color cube - and the colors supported by the real terminal to the best of its ability, - in much the same way as CSApprox maps between GUI and terminal colors. - - *csapprox-terminals-bad* --------------------------------- Bad Terminals ------------------------------- -This is a list of terminals known _not_ to have high color support. If any of -these terminals have high color support added at some point in the future, -please tell me and I'll update this information. - - *csapprox-terminal.app* -Terminal.app (as of OS X 10.5.2) - - *csapprox-aterm* -aterm (as of version 1.00.01) - - *csapprox-xiterm* -xiterm (as of version 0.5) - - *csapprox-wterm* -wterm (as of version 6.2.9) - - *csapprox-mlterm* -mlterm (as of version 2.9.4) - - *csapprox-kterm* -kterm (as of version 6.2.0) - -============================================================================== -7. Changelog *csapprox-changelog* - - 3.50 01 Apr 2009 Fix a major regression that prevented the Eterm and - Konsole colors from being correctly snapshotted - - Fix a related bug causing incorrect terminal colors - after calling :CSApproxSnapshot - - Fix a bug causing black to be used instead of dark grey - - Have snapshots calculate g:colors_name programmatically - - Introduce many tweaks for better speed - - Clarify some things at :help csapprox-terminal-example - - Default to using our own list of rgb.txt colors rather - than searching, for performance. Add a new variable, - g:CSApprox_use_showrgb, which forces us to try finding - the colors using the "showrgb" program instead, and fall - back on our own list if it isn't available - - Remove g:CSApprox_extra_rgb_txt_dirs - not needed in - light of the above change - - 3.05 31 Jan 2009 Fix a harmless "Undefined variable" error in - :CSApproxSnapshot - - Fix a behavioral bug when dumping out colors defined - external to the scheme. - - 3.00 21 Jan 2009 Update the docs for better info on :CSApproxSnapshot - - Allow snapshotted schemes to work on Vim 6, and work - properly in Konsole and Eterm (thanks David Majnemer!) - - Fix a bug causing a syntax error when using GVim while - CSApprox was loaded. (thanks again, David Majnemer!) - - 2.00 14 Dec 2008 Add a hooks system, allowing users to specify a command - to run, either before or after the approximation - algorithm is run, for all schemes or one specific one. - - Also rewrite :CSApproxSnapshot to be more maintainable - and less of a hack, and fix several bugs that it - contained. - - 1.50 19 Nov 2008 Add CSApproxSnapshot command, as an alternative solution - when the user has gvim or a vim with gui support, but - sometimes needs to use a vim without gui support. - - 1.10 28 Oct 2008 Enable running on systems with no rgb.txt (Penn Su) - Begin distributing a copy of rgb.txt with CSApprox - - 1.00 04 Oct 2008 First public release - - 0.90 14 Sep 2008 Initial beta release - -============================================================================== -8. Contact Info *csapprox-author* - -Your author, a Vim nerd with some free time, was sick of seeing terminals -always get the short end of the stick. He'd like to be notified of any -problems you find - after all, he took the time to write all this lovely -documentation, and this plugin, which took more time than you could possibly -imagine to get working transparently for every colorscheme he could get his -hands on. You can contact him with any problems or praises at mjw@drexel.edu - -============================================================================== -vim:tw=78:fo=tcq2:isk=!-~,^*,^\|,^\":ts=8:ft=help:norl: diff --git a/home/.vim/doc/buftabline.txt b/home/.vim/doc/buftabline.txt new file mode 100644 index 0000000..5647321 --- /dev/null +++ b/home/.vim/doc/buftabline.txt @@ -0,0 +1,135 @@ +*buftabline.txt* Use the tabline to render buffer tabs + + BUFTABLINE by Aristotle Pagaltzis + +============================================================================== +0. Contents *buftabline* + + 1. Intro ....................................... |buftabline-intro| + 2. Configuration settings ...................... |buftabline-config| + 3. Mappings .................................... |buftabline-mappings| + 4. Tab coloring and colorscheme support ........ |buftabline-colors| + 5. Source ...................................... |buftabline-source| + + +============================================================================== +1. Intro *buftabline-intro* + +This plugin takes over the 'tabline' and renders the buffer list in it instead +of a tab list. It is designed with the ideal that it should Just Work: drop it +into your setup and you're done. There is only minimal configurable behavior. + + +============================================================================== +2. Configuration settings *buftabline-config* + +Changes to any of the plugin's configuration settings at runtime will not take +effect immediately unless you force an update: > + :call buftabline#update(0) +< + +*g:buftabline_show* number (default 2) + + The value of this option specifies when the line with buffer labels will + be displayed: + 0: never + 1: only if there are at least two buffers + 2: always + This is analogous to the 'showtabline' setting, only for the |buftabline|. + + +*g:buftabline_numbers* number (default 0) + + The value of this option specifies how to number the buffer labels: + 0: no numbering + 1: buffer number + 2: ordinal number + The buffer number corresponds to Vim's internal buffer number as shown by + the |:ls| command, whereas the ordinal number is a simple sequential count + from left to right. + + +*g:buftabline_indicators* boolean (default off) + + When on, the buffer's state is indicated in the buffer label. Currently + the only state indicated is whether the buffer is 'modified'. + + +*g:buftabline_separators* boolean (default off) + + When on, a vertical line is drawn inbetween tabs. (This is not strictly + correct. The effect is actually achieved by replacing the space on the + left side of each tab with U+23B8 LEFT VERTICAL BOX LINE. Therefore the + separator will be highlighted the same way as the tab to its left.) + + +*g:buftabline_plug_max* number (default 10) + + The number of |buftabline-mappings| that will be created by the plugin. + You can request more of them or turn off the functionality entirely by + setting this to 0. Note it only has an effect before loading the plugin, + not if you change it later. + + +============================================================================== +3. Mappings *buftabline-mappings* + +To switch buffers by their ordinal number (|g:buftabline_numbers| = 2) you can +map keys to the |<Plug>| mappings provided by this plugin: > + nmap <leader>1 <Plug>BufTabLine.Go(1) + nmap <leader>2 <Plug>BufTabLine.Go(2) + nmap <leader>3 <Plug>BufTabLine.Go(3) + nmap <leader>4 <Plug>BufTabLine.Go(4) + nmap <leader>5 <Plug>BufTabLine.Go(5) + nmap <leader>6 <Plug>BufTabLine.Go(6) + nmap <leader>7 <Plug>BufTabLine.Go(7) + nmap <leader>8 <Plug>BufTabLine.Go(8) + nmap <leader>9 <Plug>BufTabLine.Go(9) + nmap <leader>0 <Plug>BufTabLine.Go(10) +< +On Mac OS, you probably want to use a |<D-| mapping instead, which will emulate +the standard Cmd+1, Cmd+2, etc. keybindings for this feature: > + nmap <D-1> <Plug>BufTabLine.Go(1) + nmap <D-2> <Plug>BufTabLine.Go(2) + nmap <D-3> <Plug>BufTabLine.Go(3) + nmap <D-4> <Plug>BufTabLine.Go(4) + nmap <D-5> <Plug>BufTabLine.Go(5) + nmap <D-6> <Plug>BufTabLine.Go(6) + nmap <D-7> <Plug>BufTabLine.Go(7) + nmap <D-8> <Plug>BufTabLine.Go(8) + nmap <D-9> <Plug>BufTabLine.Go(9) + nmap <D-0> <Plug>BufTabLine.Go(10) +< +You can ask for more (or fewer) than the default 10 <Plug> mappings using the +|g:buftabline_plug_max| setting. + +============================================================================== +4. Tab coloring and colorscheme support *buftabline-colors* + +This plugin uses several custom highlight groups to render the buffer tabs. +The custom groups are linked to several other built-in Vim highlight groups +that should provide a sensible default which automatically harmonizes with +your |colorscheme|. + +However, if you dislike your colorscheme's chosen tabline colours, you can +override the default links in your |vimrc| -- c.f. |:hi-link|. + +Or if you are a colorscheme designer (|44.1|), you can add support to your +colorscheme for this plugin specifically. + +The highlight groups and their default links are as follows: + + Custom group Default link Meaning + *BufTabLineCurrent* |TabLineSel| Buffer shown in current window + *BufTabLineActive* |PmenuSel| Buffer shown in other window + *BufTabLineHidden* |TabLine| Buffer not currently visible + *BufTabLineFill* |TabLineFill| Empty area + + +============================================================================== +5. Source *buftabline-source* + +https://github.com/ap/vim-buftabline + + +vim:tw=78:et:ft=help:norl: diff --git a/home/.vim/doc/javacomplete.txt b/home/.vim/doc/javacomplete.txt deleted file mode 100644 index ef5f211..0000000 --- a/home/.vim/doc/javacomplete.txt +++ /dev/null @@ -1,568 +0,0 @@ -*javacomplete.txt* For Vim version 7.0 and above. Last change: 2011-01-30 - - JAVACOMPLETE REFERENCE MANUAL by cheng fang~ - fangread@yahoo.com.cn~ - - -1. Overview |javacomplete-overview| - 1.1 Features |javacomplete-features| - 1.2 Requirements |javacomplete-requirements| - 1.3 Download |javacomplete-download| - 1.4 Install |javacomplete-install| -2. Usage |javacomplete-usage| - 2.1 Input contexts |javacomplete-contexts| - 2.2 Kind letter |javacomplete-kindletter| - 2.3 Options |javacomplete-options| - 2.4 Commands |javacomplete-commands| -3. Java parser in Vim |javacomplete-parser| - 3.1 Abstract Syntax Tree |javacomplete-ast| - 3.2 Global Constants |javacomplete-constants| - 3.3 Parsing Functions |javacomplete-functions| - 3.4 Sample |javacomplete-sample| -4. FAQ |javacomplete-faq| -5. Limitations |javacomplete-limitations| -6. History - 6.1 javacomplete |javacomplete-history| - 6.2 Parser |java-parser-history| - 6.2 Reflection.java |javacomplete-reflection| -7. Todo |javacomplete-todo| -8. Thanks |javacomplete-thanks| - -============================================================================== -1. Overview *javacomplete-overview* - -This is javacomplete, an omni-completion script of JAVA language for vim 7 and -above. It includes javacomplete.vim, java_parser.vim, Reflection.java, and -javacomplete.txt. - -1.1 Features *javacomplete-features* - -- List members of a class, including (static) fields, (static) methods and ctors. -- List classes or subpackages of a package. -- Provide parameters information of a method, list all overload methods. -- Complete an incomplete word. -- Provide a complete JAVA parser written in Vim script language. -- Use the JVM to obtain most information. -- Use the embedded parser to obtain the class information from source files. -- Tags generated by ctags can also be used. -- JSP is supported, Builtin objects such as request, session can be recognized. - The classes and jar files in the WEB-INF will be appended automatically to the classpath. - -1.2 Requirements *javacomplete-requirements* - -It works on all the platforms wherever -- Vim version 7.0 and above, -- JDK version 1.1 and above, -exists. - -1.3 Download *javacomplete-download* - -You can download the lastest version from this url: - http://www.vim.org/scripts/script.php?script_id=1785 - -1.4 Install *javacomplete-install* - -1. Unzip javacomplete.zip to a directory of 'runtimepath', e.g. -$HOME/.vim (unix/linux), $VIM/vimfiles (windows). > - > unzip javacomplete.zip -d ~/.vim - -< To update Vim help tags, run vim and run command: > - :helptags $HOME/.vim/doc -< or > - :helptags $VIM/vimfiles/doc - -NOTE: javacomplete.vim, java_parser.vim and Reflection.java should be in one -autoload directory of 'runtimepath'. -javacomplete.txt should be in one doc directory of 'runtimepath'. - -2. Set 'omnifunc' option. e.g. > - :setlocal omnifunc=javacomplete#Complete -< Or, use autocmd: > - :" Only do this part when compiled with support for autocommands. - :if has("autocmd") - : autocmd Filetype java setlocal omnifunc=javacomplete#Complete - :endif -You can add this command to your .vimrc or _vimrc. - -3. Set 'completefunc' option to show parameters information IF YOU LIKE. e.g. > - :setlocal completefunc=javacomplete#CompleteParamsInfo -You can map as follows for better display: > - :inoremap <buffer> <C-X><C-U> <C-X><C-U><C-P> - :inoremap <buffer> <C-S-Space> <C-X><C-U><C-P> - -4. Reflection.java will be automatcally compiled and placed to $HOME when you -use first time. Assure that Reflection.java is in the same directory with -javacomplete.vim to be searched in autoload subdirectory of &rtp. -If no Reflection.class is generated, check that you have the write permission -in $HOME directory. -If a previous Reflection.java is not compatible with the new version -javacomplete.vim, please compile Reflection.java manually. - -============================================================================== -2. Usage *javacomplete-usage* - -You can use it like other omni-completion script. Many samples of input context -are gived in the following section. - -Make sure a JVM launcher (default 'java') can be searched in the PATH enviroment -variable, otherwise Use javacomplete#SetJVMLauncher() to specify one. See option -`javacomplete-launcher`. - -See FAQ in time if some problem occurs. When meeting other problems not -described in FAQ, you can contact with the auther by the following e-mail: -fangread@yahoo.com.cn - -2.1 Input contexts |javacomplete-contexts| -It recognize nearly all kinds of Primary Expressions (see langspec-3.0) -except for "Primary.new Indentifier". Casting conversion is also supported. - -Samples of input contexts are as following: (Note that '|' indicates cursor) - (1). after '.', list members of a class or a package - - package.| subpackages and classes of a package - - Type.| static members of the 'Type' class and "class" - - var.| or field.| members of a variable or a field - - method().| members of result of method() - - this.| members of the current class - - ClassName.this.| members of the qualified class - - super.| members of the super class - - array.| members of an array object - - array[i].| array access, return members of the element of array - - "String".| String literal, return members of java.lang.String - - int.| or void.| primitive type or pseudo-type, return "class" - - int[].| array type, return members of a array type and "class" - - java.lang.String[].| - - new int[].| members of the new array instance - - new java.lang.String[i=1][].| - - new Type().| members of the new class instance - - Type.class.| class literal, return members of java.lang.Class - - void.class.| or int.class.| - - ((Type)var).| cast var as Type, return members of Type. - - (var.method()).| same with "var.|" - - (new Class()).| same with "new Class().|" - - (2). after '(', list matching methods with parameters information. - - method(|) methods matched - - var.method(|) methods matched - - new ClassName(|) constructors matched - - this(|) constructors of current class matched - - super(|) constructors of super class matched - Any place between '(' and ')' will be supported soon. - Help information of javadoc is not supported yet. - - (3). after an incomplete word, list all the matched beginning with it. - - var.ab| subset of members of var beginning with `ab` - - ab| list of all maybes - - (4). import statement - - " import java.util.|" - - " import java.ut|" - - " import ja|" - - " import java.lang.Character.|" e.g. "Subset" - - " import static java.lang.Math.|" e.g. "PI, abs" - - (5). package declaration - - " package com.|" - - The above are in simple expression. - (6). after compound expression: - - PrimaryExpr.var.| - - PrimaryExpr.method().| - - PrimaryExpr.method(|) - - PrimaryExpr.var.ab| - e.g. - - "java.lang . System.in .|" - - "java.lang.System.getenv().|" - - "int.class.toString().|" - - "list.toArray().|" - - "new ZipFile(path).|" - - "new ZipFile(path).entries().|" - - (7). Nested expression: - - "System.out.println( str.| )" - - "System.out.println(str.charAt(| )" - - "for (int i = 0; i < str.|; i++)" - - "for ( Object o : a.getCollect| )" - - -2.2 Kind letter *javacomplete-kindletter* - -A single letter indicates the kind of compeltion item. These kinds are: - + ctor - v local variable or parameter - f nonstatic field - F static field - m nonstatic method - M static method - P package - C class type - I interface type - -2.3 Options *javacomplete-options* - -1. Set java compiler (default 'javac') using the following function: - javacomplete#SetCompiler('javac') *javacomplete-compiler* - -2. Set java launcher (default 'java') using the following function: - javacomplete#SetJVMLauncher('java') *javacomplete-launcher* - -3. Set classpath using the following function: > - javacomplete#AddClassPath('jarfile_or_classes_path') - javacomplete#DelClassPath('jarfile_or_classes_path') - javacomplete#SetClassPath('semicolon_separated_string') -< - Another two variables will be used if they are existing: - |g:java_classpath| global classpath - |b:classpath| associated with current buffer - In one sense, s:classpath is like a classpath option for a PROJECT. - If some of them are body set, the priority of these variables is: - first, b:classpath first, - second, s:classpath - third, g:java_classpath - last, $CLASSPATH - -4. Set sourcepath using the following function: > - javacomplete#AddSourcePath('sources_file_path') - javacomplete#DelSourcePath('sources_file_path') - javacomplete#SetSourcePath('sources_file_path') - -5. Set option for using JDK1.1 if you meet the problem described in FAQ 3: > - javacomplete#UseJDK11() - -6. Set methods to search declaration: > - " 1 - by builtin searchdecl(), quickest but inaccurate in many cases. - " 2 - by special Searchdecl(), work NOT WELL YET. - " 4 - by java_parser, slowest but accurate in most cases. Not for JSP. - javacomplete#SetSearchdeclMethod() - -2.4 Commands *javacomplete-commands* - -============================================================================== -3. Java parser in Vim *javacomplete-parser* - -3.1 Abstract Syntax Tree *javacomplete-ast* - -3.2 Global Constants *javacomplete-constants* - -3.3 Parsing Functions *javacomplete-functions* - -3.4 Sample Codes *javacomplete-sample* -This parser can be a good candidate for anyone who needs a java parser to get -a abstract syntax tree for many use. The following are sample codes: > - - " NOTE: The script contains a single parser instance. You cannot create - " another parser! The only way to parse another JAVA code is reset the - " parser by calling java_parser#InitParser(). - - " 1. Initialize the parser - " for a code snippet, - call java_parser#InitParser(['for (int i = 0; i < N; i++) {', '', '}']) - " or for the current buffer, - call java_parser#InitParser(getline('^', '$')) - " or for a whole source file - call java_parser#InitParser(readfile('java/util/Arrays.java')) - - " 2. Get the result tree - call java_parser#compilationUnit() - " or others according to the input code - call java_parser#expression() - call java_parser#block() - call java_parser#statement() - - " 3. Use the tree as you like - - " 4. The default scan strategy is scanning only sklenton. - " You can change it by set the option 'scanStrategy'. - " The values for 'scanStrategy' option are: - " 0 - only class members when parse full file; - " 1 - keep statement as a whole string; - " 2 - all - call java_parser#InitParser(getline('^', '$'), {'scanStrategy': 2}) - - " 5. I recommend that keeping scanStrategy as default. - " If you want to parse a code snippet such as a method body of the whole - " file, you can call java_parser#GotoPosition() to go to what you are going - " to start parsing. - " Then, call java_parser#block(), java_parser#statement() or - " java_parser#expression() to parse the smaller snippet. - " NOTE: This way will keep the result tree reserved. - call java_parser#GotoPosition(def.body.pos) - call java_parser#block() - -============================================================================== -4. FAQ *javacomplete-faq* - -(1). When you meets the following problem: > - omni-completion error: Exception in thread "main" - java.lang.NoClassDefFoundError: Reflection -It is Reflection.class not found in autoload directory or $HOME that cause -this problem. -There are several reasons causing this problem: - o No compiler. Use javacomplete#SetCompiler() to specify one. - o No write permission for $HOME directory. - -(2). Reflection.java should be searched in autoload subdirectory of &rtp. -Reflection.class should be searched in $HOME or autoload subdirectory of &rtp. -If not found, javacomplete try to compile it and place the generated class -file in $HOME. - -(3). A error when using JDK1.1: - Unable to initialize threads: cannot find class java/lang/Thread -When I tested JDK1.1.8 on Windows XP, I found -classpath options cause it. -There are two way to avoid it is: - o Add the runtime classes to classpath, like - "${JDK118}\classes;${JDK118}\lib\classes.zip;${JDK118}\lib\classes.jar;" - o Add Reflection.class and others to the CLASSPATH enviroment variable. - And call javacomplete#UseJDK11() to set option. - -============================================================================== -5. Limitations *javacomplete-limitations* - -The embedded parser works a bit slower than expected. - -============================================================================== -6. History - -6.1 javacomplete *javacomplete-history* - -v0.77.1.2 - 2011-01-30 Fixed to adapt globpath() (vim < 7.2). Patched by Sam Lidder. - -v0.77.1.1 - 2010-11-12 Fixed to ignore the 'suffixes' and 'wildignore' options which - make Reflection.class can not be found. - -v0.77.1 - 2007-09-19 Supported showing method parameters information in any place - between parenthesises. - -v0.77 - 2007-09-19 bug fix - 2007-09-18 Added GetCurrentFileKey() avoid empty key of s:files for current buffer. - 2007-09-16 Use a new strategy for searching inherited members. - 2007-09-11 - - Supported new contexts "jav|", "var|", just after an incomplete word. - - Supported new context "abs(|)", a imported static method. - 2007-09-10 - - Improved FoundClassDeclaration() - - Fixed bug calling cursor(0, 0) - 2007-09-09 Rewrote DoGetClassInfo(), GetFQN() and IsFQN()¡£ - 2007-09-08 Fixed a bug when merging superclass's members - 2007-09-05 -- 07 - - Improved s:MergeLines() and s:ExtractCleanExpr(). - - Rewrote CompleteAfterDot(). Added ParseExpr(). Removed s:GetNextSubexprType() - - Supported accessible static imported members. - - Supported accessible inherited members. - - 2007-09-04 Used b:changedtick and getftime() to check buffer (or other file) for changing. - 2007-09-01 Supported not-file-name toplevel or static member class in source files. - -v0.76.8 - 2007-08-30 - - Created the s:TreeVisitor to search type or symbol names. - - Supported local and anonymous class. - - 2007-08-29 - - Supported appending automatically classpath under WEB-INF for jsp files. - -v0.76.7 - 2007-08-28 - - Fixed case of "new java.util.zip.ZipFile().|" - - Improved process of type arguments and method parameters. JAVA5+ - - Reorganize codes in javacomplete#Complete() - - Added CONTEXT_NEED_TYPE, removed CONTEXT_INCOMPLETE_WORD - - 2007-08-24 Add Context types for type declaration: CONTEXT_NEED_TYPE - -v0.76.6 - 2007-08-23 Improved GetStatement() and related. Bug fixed. - -v0.76.5 - 2007-08-21 - - Fixed bug: "foo().|", "getFoo().foo().|", - "for (Enumeration entries = ; entries.|; )". - - Supported input contexts: "((Object)o).|", "((Object)o).getClass().|", - "new ZipFile(path).|", "(new String().)|". - -v0.76.4 - 2007-08-17 - - Improved input contexts: "int.class.toString().|", "list.toArray().|". - - Fixed recognizing "this(|)", "method1(|)" - - Added the 'kind' letter to distinguish between classes and packages. - 2007-08-14 - - Support accessible nested classes. - - Support import static members and import accessible nested classes. - 2007-08-11 - - Fixed a bug when Reflection.java is in the path which contains space. - - Improved process of this and super in JSP. - - Fixed an severe bug parsing current jsp file. - -v0.76.3 - 2007-08-10 - - Add an option 'searchdecl' set by javacomplete#SetSearchdeclMethod(). - - Make an improvement for jsp file. - - Clear cache when set options affecting classpath. - - Improved DoGetPackageList() and s:GenerateImports(). - - Replace codes searching list of string with index(). - -v0.76.2 - 2007-08-08 - - Fix failing to list members of nested class. - - Combine members of local packages and loadable packages. - - Add quick recognition of package or import. - 2007-08-06 Add inherited fields and methods to local class. - -v0.76.1 - 2007-08-04 - - Fix using a: in javacomplete#SetClassPath() - - Fix a bug in javacomplete#GetClassPath() - -v0.76 2007-08-04 - 2007-08-04 - - Fix a infinite loop bug in s:GetMatchedIndexEx() - - Fix that array type not recognised in compound expression. - - Add a option for JDK1.1. See FAQ 3. - 2007-08-03 - - Improve for 'this' or 'super'. - - Support searching toplevel class in sourcepath. - - Clean - 2007-08-02 - - Improve the process of checking a class in one of packages. - 2007-08-01 - - Add Searchdecl() using java_parser.vim to provide quick information. - - Supports input context: "StringLiteral".|, "int.|", "void.|" - 2007-07-28 - - Automatcally compile Reflection.java and place it to $HOME. - - Add option 'javacompiler', default 'javac' - - Add option 'java', default 'java' - -v0.75 2007-02-13 - - Add java_parser.vim. - - Add b:sourcepath option. - - Improve recognition of classes defined in current buffer or in source path. - - Support generating class information from tags instead of returning list directly. - -v0.74 2007-02-03 - - Support jre1.2 (and above). - - Support input context like "boolean.class.|" - - Handle java primitive types like 'int'. - -v0.73 2007-02-01 - - Fix bug that CLASSPATH not used when b:classpath or g:java_classpath not set. - - Fix bug that call filter() without making a copy for incomplete. - - Improve recognition of declaration of this class - -v0.72 2007-01-31 Handle nested expression. -v0.71 2007-01-28 Add Basic support for class in current folder. -v0.70 2007-01-27 Complete the reflection part. -v0.60 2007-01-25 Design TClassInfo, etc. -v0.50 2007-01-21 Use java and Reflection.class directly. - - -6.2 Parser *java-parser-history* - -v0.67 - 2007-09-11 Append a error string to imported qid when error occurs. - 2007-09-10 Improved regexp constants. - 2007-09-07 Fixed type2Str(). Removed qualident2Str(). - -v0.66.1 08-30 Changed classCreatorRest(). -v0.66 08-27 Minor changes - -v0.65 - 2007-08-23 - - Improved s:scanComment(), s:Strpart(), s:String2Flags(). - - Improved recognizing methods, ctors, and variable declarators declared in most common form. - - Added s:optFinalParameter(), s:methodDeclaratorRest_opt(). - - Removed s:GetLine() and s:GetCol(). - - Rewrote binary functions. - -v0.64 - 2007-08-21 - - Added quick recognizing fields or methods declared in most common form. - - Optimized code: s:modeAndEXPR(), formalParameter(), and others. - -v0.63 - 2007-08-10 - - Removed the unclear s:tokens and s:modifier_keywords. - - Add java_parser#GetSnapshot() and java_parser#Restore(). - 2007-08-09 Fixed a bug when no top level class defined - -v0.62 2007-08-08 - 2007-08-08 Fix values in s:Flags and s:modifiersOpt() and the related. - 2007-08-07 Optimize code of scanDoubleQuote() and importDeclaration(). - -v0.61 2007-08-04 - 2007-08-01 Fix a bug typetag(). return a:token -> return tolower(a:token) - 2007-07-31 - - Rename all script functions matching "s:Java_\(\i\+\)" to "s:\1". - - Change s:EOI = '' - - Use get() instead of s:GetOption(). Remove it. - - Use repeat() instead of s:PrependChar(). Remove it. - - Improve scanChar() - -v0.60 2007-07-31 Now it nearly is a complete parser and support Java5,6. - And tested correctly on all java files in jdk6 src.zip. - 2007-07-19 Support new language features in java 5 and above. - 2007-07-25 Add supports for parsing statement, block or expression - 2007-07-28 Place it to autoload directory. - 2007-07-30 Clean this script. - -v0.51 2007-02-13 Optimize several scan function. -v0.50 2007-02-10 Complete the skeleton. - - -6.3 Reflection.java *javacomplete-reflection* - -v0.77 - 2007-09-14 Improved generating information of all packages in jar files. - 2007-09-06 - - Improved getting paths of all system jar files for different JDKs - in different platforms. - 2007-08-14 Major improvement. Support nontoplevel classes. - -v0.76.3 - 2007-08-09 Redefined '-P' option for returning all packages and subpackages info in one time. - -v0.76.2 - 2007-08-06 Return a modifier value as a string because it more than 32bit. - -v0.76 - 2007-08-04 Support checking and reading package members for '-E'. - 2007-08-02 - - Add an option '-E'. - - Use ZipFile and ZipEntry instead of JarFile and JarEntry, - so that it can be compiled by and run on JDK1.1 and above. -v0.7 2007-02-17 - -============================================================================== -7. Todo *javacomplete-todo* - -- Improve performance of the embedded parser. Incremental parser. -- Add quick information using balloonexpr, ballooneval, balloondelay. -- Add javadoc -- Give a hint for class name conflict in different packages. -- Support parameter information for template - -============================================================================== -8. Thanks *javacomplete-thanks* - * Bram Moolenaar and all Vim contributors for Vim - * The insenvim project - * The javac and gjc sources - * All of you for using this script :) - - * For help, documentation, bug report : - Martin Stubenschrott author of IComplete - Vissale NEANG author of OmniCppComplete - David Fishburn author of SQLComplete and others - Nico Weber testing on the Mac - Thomas Link testing on cygwin+bash - Zhixing Yu - * For the bug of 'wildignore' options - Rodrigo Rosenfeld Rosas - Alexandru Mo?oi - -FeedBack: -Any problem, bug or suggest are welcome to send to fangread@yahoo.com.cn - -============================================================================== - vim:tw=78:ts=8:ft=help:norl: diff --git a/home/.vim/doc/tags b/home/.vim/doc/tags deleted file mode 100644 index b55caa0..0000000 --- a/home/.vim/doc/tags +++ /dev/null @@ -1,332 +0,0 @@ -'BuildWin_FinishBehavior' buildwin.txt /*'BuildWin_FinishBehavior'* -'BuildWin_Height' buildwin.txt /*'BuildWin_Height'* -'BuildWin_Position' buildwin.txt /*'BuildWin_Position'* -'BuildWin_UpdateTime' buildwin.txt /*'BuildWin_UpdateTime'* -'NERDChristmasTree' NERD_tree.txt /*'NERDChristmasTree'* -'NERDTreeAutoCenter' NERD_tree.txt /*'NERDTreeAutoCenter'* -'NERDTreeAutoCenterThreshold' NERD_tree.txt /*'NERDTreeAutoCenterThreshold'* -'NERDTreeBookmarksFile' NERD_tree.txt /*'NERDTreeBookmarksFile'* -'NERDTreeCaseSensitiveSort' NERD_tree.txt /*'NERDTreeCaseSensitiveSort'* -'NERDTreeChDirMode' NERD_tree.txt /*'NERDTreeChDirMode'* -'NERDTreeHighlightCursorline' NERD_tree.txt /*'NERDTreeHighlightCursorline'* -'NERDTreeHijackNetrw' NERD_tree.txt /*'NERDTreeHijackNetrw'* -'NERDTreeIgnore' NERD_tree.txt /*'NERDTreeIgnore'* -'NERDTreeMouseMode' NERD_tree.txt /*'NERDTreeMouseMode'* -'NERDTreeQuitOnOpen' NERD_tree.txt /*'NERDTreeQuitOnOpen'* -'NERDTreeShowBookmarks' NERD_tree.txt /*'NERDTreeShowBookmarks'* -'NERDTreeShowFiles' NERD_tree.txt /*'NERDTreeShowFiles'* -'NERDTreeShowHidden' NERD_tree.txt /*'NERDTreeShowHidden'* -'NERDTreeShowLineNumbers' NERD_tree.txt /*'NERDTreeShowLineNumbers'* -'NERDTreeSortOrder' NERD_tree.txt /*'NERDTreeSortOrder'* -'NERDTreeStatusline' NERD_tree.txt /*'NERDTreeStatusline'* -'NERDTreeWinPos' NERD_tree.txt /*'NERDTreeWinPos'* -'NERDTreeWinSize' NERD_tree.txt /*'NERDTreeWinSize'* -'loaded_nerd_tree' NERD_tree.txt /*'loaded_nerd_tree'* -:Build buildwin.txt /*:Build* -:CSApproxSnapshot CSApprox.txt /*:CSApproxSnapshot* -:NERDTree NERD_tree.txt /*:NERDTree* -:NERDTreeClose NERD_tree.txt /*:NERDTreeClose* -:NERDTreeFind NERD_tree.txt /*:NERDTreeFind* -:NERDTreeFromBookmark NERD_tree.txt /*:NERDTreeFromBookmark* -:NERDTreeMirror NERD_tree.txt /*:NERDTreeMirror* -:NERDTreeToggle NERD_tree.txt /*:NERDTreeToggle* -:Todo CuteTodoList.txt /*:Todo* -:TodoClose CuteTodoList.txt /*:TodoClose* -:TodoOpen CuteTodoList.txt /*:TodoOpen* -:Todog CuteTodoList.txt /*:Todog* -<S-D> CuteTodoList.txt /*<S-D>* -BuildWin.txt buildwin.txt /*BuildWin.txt* -CSApprox.txt CSApprox.txt /*CSApprox.txt* -CuteTodoList.txt CuteTodoList.txt /*CuteTodoList.txt* -NERDTree NERD_tree.txt /*NERDTree* -NERDTree-? NERD_tree.txt /*NERDTree-?* -NERDTree-A NERD_tree.txt /*NERDTree-A* -NERDTree-B NERD_tree.txt /*NERDTree-B* -NERDTree-C NERD_tree.txt /*NERDTree-C* -NERDTree-C-J NERD_tree.txt /*NERDTree-C-J* -NERDTree-C-K NERD_tree.txt /*NERDTree-C-K* -NERDTree-D NERD_tree.txt /*NERDTree-D* -NERDTree-F NERD_tree.txt /*NERDTree-F* -NERDTree-I NERD_tree.txt /*NERDTree-I* -NERDTree-J NERD_tree.txt /*NERDTree-J* -NERDTree-K NERD_tree.txt /*NERDTree-K* -NERDTree-O NERD_tree.txt /*NERDTree-O* -NERDTree-P NERD_tree.txt /*NERDTree-P* -NERDTree-R NERD_tree.txt /*NERDTree-R* -NERDTree-T NERD_tree.txt /*NERDTree-T* -NERDTree-U NERD_tree.txt /*NERDTree-U* -NERDTree-X NERD_tree.txt /*NERDTree-X* -NERDTree-cd NERD_tree.txt /*NERDTree-cd* -NERDTree-contents NERD_tree.txt /*NERDTree-contents* -NERDTree-e NERD_tree.txt /*NERDTree-e* -NERDTree-f NERD_tree.txt /*NERDTree-f* -NERDTree-gi NERD_tree.txt /*NERDTree-gi* -NERDTree-go NERD_tree.txt /*NERDTree-go* -NERDTree-gs NERD_tree.txt /*NERDTree-gs* -NERDTree-i NERD_tree.txt /*NERDTree-i* -NERDTree-m NERD_tree.txt /*NERDTree-m* -NERDTree-o NERD_tree.txt /*NERDTree-o* -NERDTree-p NERD_tree.txt /*NERDTree-p* -NERDTree-q NERD_tree.txt /*NERDTree-q* -NERDTree-r NERD_tree.txt /*NERDTree-r* -NERDTree-s NERD_tree.txt /*NERDTree-s* -NERDTree-t NERD_tree.txt /*NERDTree-t* -NERDTree-u NERD_tree.txt /*NERDTree-u* -NERDTree-x NERD_tree.txt /*NERDTree-x* -NERDTreeAPI NERD_tree.txt /*NERDTreeAPI* -NERDTreeAbout NERD_tree.txt /*NERDTreeAbout* -NERDTreeAddKeyMap() NERD_tree.txt /*NERDTreeAddKeyMap()* -NERDTreeAddMenuItem() NERD_tree.txt /*NERDTreeAddMenuItem()* -NERDTreeAddMenuSeparator() NERD_tree.txt /*NERDTreeAddMenuSeparator()* -NERDTreeAddSubmenu() NERD_tree.txt /*NERDTreeAddSubmenu()* -NERDTreeBookmarkCommands NERD_tree.txt /*NERDTreeBookmarkCommands* -NERDTreeBookmarkTable NERD_tree.txt /*NERDTreeBookmarkTable* -NERDTreeBookmarks NERD_tree.txt /*NERDTreeBookmarks* -NERDTreeChangelog NERD_tree.txt /*NERDTreeChangelog* -NERDTreeCredits NERD_tree.txt /*NERDTreeCredits* -NERDTreeFunctionality NERD_tree.txt /*NERDTreeFunctionality* -NERDTreeGlobalCommands NERD_tree.txt /*NERDTreeGlobalCommands* -NERDTreeInvalidBookmarks NERD_tree.txt /*NERDTreeInvalidBookmarks* -NERDTreeKeymapAPI NERD_tree.txt /*NERDTreeKeymapAPI* -NERDTreeLicense NERD_tree.txt /*NERDTreeLicense* -NERDTreeMappings NERD_tree.txt /*NERDTreeMappings* -NERDTreeMenu NERD_tree.txt /*NERDTreeMenu* -NERDTreeMenuAPI NERD_tree.txt /*NERDTreeMenuAPI* -NERDTreeOptionDetails NERD_tree.txt /*NERDTreeOptionDetails* -NERDTreeOptionSummary NERD_tree.txt /*NERDTreeOptionSummary* -NERDTreeOptions NERD_tree.txt /*NERDTreeOptions* -NERDTreeRender() NERD_tree.txt /*NERDTreeRender()* -NERD_tree.txt NERD_tree.txt /*NERD_tree.txt* -Todo CuteTodoList.txt /*Todo* -TodoClose CuteTodoList.txt /*TodoClose* -TodoOpen CuteTodoList.txt /*TodoOpen* -Todog CuteTodoList.txt /*Todog* -Vjdegd vjde.txt /*Vjdegd* -Vjdeinfo vjde.txt /*Vjdeinfo* -and git-cheat.txt /*and* -buildwin-about buildwin.txt /*buildwin-about* -buildwin-commands buildwin.txt /*buildwin-commands* -buildwin-configure buildwin.txt /*buildwin-configure* -csapprox CSApprox.txt /*csapprox* -csapprox-+gui CSApprox.txt /*csapprox-+gui* -csapprox-aterm CSApprox.txt /*csapprox-aterm* -csapprox-author CSApprox.txt /*csapprox-author* -csapprox-changelog CSApprox.txt /*csapprox-changelog* -csapprox-configure CSApprox.txt /*csapprox-configure* -csapprox-design CSApprox.txt /*csapprox-design* -csapprox-eterm CSApprox.txt /*csapprox-eterm* -csapprox-gnome-terminal CSApprox.txt /*csapprox-gnome-terminal* -csapprox-gui-support CSApprox.txt /*csapprox-gui-support* -csapprox-hooks CSApprox.txt /*csapprox-hooks* -csapprox-intro CSApprox.txt /*csapprox-intro* -csapprox-iterm.app CSApprox.txt /*csapprox-iterm.app* -csapprox-konsole CSApprox.txt /*csapprox-konsole* -csapprox-kterm CSApprox.txt /*csapprox-kterm* -csapprox-limitations CSApprox.txt /*csapprox-limitations* -csapprox-mlterm CSApprox.txt /*csapprox-mlterm* -csapprox-mrxvt CSApprox.txt /*csapprox-mrxvt* -csapprox-palettes CSApprox.txt /*csapprox-palettes* -csapprox-pterm CSApprox.txt /*csapprox-pterm* -csapprox-putty CSApprox.txt /*csapprox-putty* -csapprox-requirements CSApprox.txt /*csapprox-requirements* -csapprox-roxterm CSApprox.txt /*csapprox-roxterm* -csapprox-screen CSApprox.txt /*csapprox-screen* -csapprox-terminal CSApprox.txt /*csapprox-terminal* -csapprox-terminal-example CSApprox.txt /*csapprox-terminal-example* -csapprox-terminal-list CSApprox.txt /*csapprox-terminal-list* -csapprox-terminal.app CSApprox.txt /*csapprox-terminal.app* -csapprox-terminals-bad CSApprox.txt /*csapprox-terminals-bad* -csapprox-terminals-good CSApprox.txt /*csapprox-terminals-good* -csapprox-toc CSApprox.txt /*csapprox-toc* -csapprox-transparency CSApprox.txt /*csapprox-transparency* -csapprox-urxvt CSApprox.txt /*csapprox-urxvt* -csapprox-wterm CSApprox.txt /*csapprox-wterm* -csapprox-xfce4-terminal CSApprox.txt /*csapprox-xfce4-terminal* -csapprox-xiterm CSApprox.txt /*csapprox-xiterm* -csapprox-xterm CSApprox.txt /*csapprox-xterm* -csapprox.vim CSApprox.txt /*csapprox.vim* -cuteBufferUsage CuteTodoList.txt /*cuteBufferUsage* -cuteTodoCommands CuteTodoList.txt /*cuteTodoCommands* -cuteTodoConfiguration CuteTodoList.txt /*cuteTodoConfiguration* -cuteTodoList CuteTodoList.txt /*cuteTodoList* -g:CSApprox_approximator_function CSApprox.txt /*g:CSApprox_approximator_function* -g:CSApprox_attr_map CSApprox.txt /*g:CSApprox_attr_map* -g:CSApprox_eterm CSApprox.txt /*g:CSApprox_eterm* -g:CSApprox_hook_post CSApprox.txt /*g:CSApprox_hook_post* -g:CSApprox_hook_pre CSApprox.txt /*g:CSApprox_hook_pre* -g:CSApprox_hook_{scheme}_post CSApprox.txt /*g:CSApprox_hook_{scheme}_post* -g:CSApprox_hook_{scheme}_pre CSApprox.txt /*g:CSApprox_hook_{scheme}_pre* -g:CSApprox_konsole CSApprox.txt /*g:CSApprox_konsole* -g:CSApprox_loaded CSApprox.txt /*g:CSApprox_loaded* -g:CSApprox_redirfallback CSApprox.txt /*g:CSApprox_redirfallback* -g:CSApprox_use_showrgb CSApprox.txt /*g:CSApprox_use_showrgb* -g:CSApprox_verbose_level CSApprox.txt /*g:CSApprox_verbose_level* -g:todo_generate_auto CuteTodoList.txt /*g:todo_generate_auto* -g:todo_list_buff_name CuteTodoList.txt /*g:todo_list_buff_name* -g:todo_list_filename CuteTodoList.txt /*g:todo_list_filename* -g:todo_list_globfilename CuteTodoList.txt /*g:todo_list_globfilename* -g:vimrplugin_browser_time r-plugin.txt /*g:vimrplugin_browser_time* -g:vimrplugin_hstart r-plugin.txt /*g:vimrplugin_hstart* -g:vimrplugin_latexcmd r-plugin.txt /*g:vimrplugin_latexcmd* -g:vimrplugin_map_r r-plugin.txt /*g:vimrplugin_map_r* -g:vimrplugin_maxdeparse r-plugin.txt /*g:vimrplugin_maxdeparse* -g:vimrplugin_noscreenrc r-plugin.txt /*g:vimrplugin_noscreenrc* -g:vimrplugin_nosingler r-plugin.txt /*g:vimrplugin_nosingler* -g:vimrplugin_term r-plugin.txt /*g:vimrplugin_term* -g:vimrplugin_term_cmd r-plugin.txt /*g:vimrplugin_term_cmd* -g:vimrplugin_underscore r-plugin.txt /*g:vimrplugin_underscore* -g:vjde_taglib_uri vjde.txt /*g:vjde_taglib_uri* -git-add git-cheat.txt /*git-add* -git-add-delete git-cheat.txt /*git-add-delete* -git-blame git-cheat.txt /*git-blame* -git-branch git-cheat.txt /*git-branch* -git-cheat git-cheat.txt /*git-cheat* -git-cheat.txt git-cheat.txt /*git-cheat.txt* -git-checkout git-cheat.txt /*git-checkout* -git-cherrypick git-cheat.txt /*git-cherrypick* -git-clone git-cheat.txt /*git-clone* -git-commit git-cheat.txt /*git-commit* -git-config git-cheat.txt /*git-config* -git-conflict git-cheat.txt /*git-conflict* -git-diff git-cheat.txt /*git-diff* -git-envvar git-cheat.txt /*git-envvar* -git-fetch git-cheat.txt /*git-fetch* -git-gui-blame git-cheat.txt /*git-gui-blame* -git-info git-cheat.txt /*git-info* -git-init git-cheat.txt /*git-init* -git-instaweb git-cheat.txt /*git-instaweb* -git-log git-cheat.txt /*git-log* -git-merge git-cheat.txt /*git-merge* -git-mergetool git-cheat.txt /*git-mergetool* -git-plumbing git-cheat.txt /*git-plumbing* -git-pull git-cheat.txt /*git-pull* -git-push git-cheat.txt /*git-push* -git-rebase git-cheat.txt /*git-rebase* -git-remote git-cheat.txt /*git-remote* -git-reset git-cheat.txt /*git-reset* -git-revert git-cheat.txt /*git-revert* -git-rm git-cheat.txt /*git-rm* -git-setup git-cheat.txt /*git-setup* -git-share git-cheat.txt /*git-share* -git-show git-cheat.txt /*git-show* -git-squash git-cheat.txt /*git-squash* -git-stage git-cheat.txt /*git-stage* -git-stashing git-cheat.txt /*git-stashing* -git-status git-cheat.txt /*git-status* -git-submodule git-cheat.txt /*git-submodule* -git-svn git-cheat.txt /*git-svn* -git-svn-clone git-cheat.txt /*git-svn-clone* -git-svn-dcommit git-cheat.txt /*git-svn-dcommit* -git-svn-rebase git-cheat.txt /*git-svn-rebase* -git-undo git-cheat.txt /*git-undo* -git-whatchanged git-cheat.txt /*git-whatchanged* -java-parser-history javacomplete.txt /*java-parser-history* -javacomplete-ast javacomplete.txt /*javacomplete-ast* -javacomplete-commands javacomplete.txt /*javacomplete-commands* -javacomplete-compiler javacomplete.txt /*javacomplete-compiler* -javacomplete-constants javacomplete.txt /*javacomplete-constants* -javacomplete-download javacomplete.txt /*javacomplete-download* -javacomplete-faq javacomplete.txt /*javacomplete-faq* -javacomplete-features javacomplete.txt /*javacomplete-features* -javacomplete-functions javacomplete.txt /*javacomplete-functions* -javacomplete-history javacomplete.txt /*javacomplete-history* -javacomplete-install javacomplete.txt /*javacomplete-install* -javacomplete-kindletter javacomplete.txt /*javacomplete-kindletter* -javacomplete-launcher javacomplete.txt /*javacomplete-launcher* -javacomplete-limitations javacomplete.txt /*javacomplete-limitations* -javacomplete-options javacomplete.txt /*javacomplete-options* -javacomplete-overview javacomplete.txt /*javacomplete-overview* -javacomplete-parser javacomplete.txt /*javacomplete-parser* -javacomplete-reflection javacomplete.txt /*javacomplete-reflection* -javacomplete-requirements javacomplete.txt /*javacomplete-requirements* -javacomplete-sample javacomplete.txt /*javacomplete-sample* -javacomplete-thanks javacomplete.txt /*javacomplete-thanks* -javacomplete-todo javacomplete.txt /*javacomplete-todo* -javacomplete-usage javacomplete.txt /*javacomplete-usage* -javacomplete.txt javacomplete.txt /*javacomplete.txt* -not git-cheat.txt /*not* -r-pager r-plugin.txt /*r-pager* -r-plugin-custom-key-bindings r-plugin.txt /*r-plugin-custom-key-bindings* -r-plugin-faq r-plugin.txt /*r-plugin-faq* -r-plugin-features r-plugin.txt /*r-plugin-features* -r-plugin-files r-plugin.txt /*r-plugin-files* -r-plugin-functioning r-plugin.txt /*r-plugin-functioning* -r-plugin-installation r-plugin.txt /*r-plugin-installation* -r-plugin-known-bugs r-plugin.txt /*r-plugin-known-bugs* -r-plugin-news r-plugin.txt /*r-plugin-news* -r-plugin-options r-plugin.txt /*r-plugin-options* -r-plugin-overview r-plugin.txt /*r-plugin-overview* -r-plugin-use r-plugin.txt /*r-plugin-use* -r-plugin.txt r-plugin.txt /*r-plugin.txt* -successful git-cheat.txt /*successful* -todo_+ CuteTodoList.txt /*todo_+* -todo_- CuteTodoList.txt /*todo_-* -todo_^ CuteTodoList.txt /*todo_^* -todo_generate_auto CuteTodoList.txt /*todo_generate_auto* -todo_list_buff_name CuteTodoList.txt /*todo_list_buff_name* -todo_list_filename CuteTodoList.txt /*todo_list_filename* -todo_list_globfilename CuteTodoList.txt /*todo_list_globfilename* -todo_m CuteTodoList.txt /*todo_m* -todo_o CuteTodoList.txt /*todo_o* -todo_s CuteTodoList.txt /*todo_s* -todo_u CuteTodoList.txt /*todo_u* -todo_v CuteTodoList.txt /*todo_v* -vcde vcde.txt /*vcde* -vim-r-plugin r-plugin.txt /*vim-r-plugin* -vjde vjde.txt /*vjde* -vjde-auto-comp vjde.txt /*vjde-auto-comp* -vjde-code vjde.txt /*vjde-code* -vjde-command vjde.txt /*vjde-command* -vjde-define vjde.txt /*vjde-define* -vjde-desc vjde.txt /*vjde-desc* -vjde-doc vjde.txt /*vjde-doc* -vjde-fix-ex vjde.txt /*vjde-fix-ex* -vjde-fix-im vjde.txt /*vjde-fix-im* -vjde-fix-th vjde.txt /*vjde-fix-th* -vjde-fix-tools vjde.txt /*vjde-fix-tools* -vjde-goto vjde.txt /*vjde-goto* -vjde-html vjde.txt /*vjde-html* -vjde-iabbr vjde.txt /*vjde-iabbr* -vjde-implements vjde.txt /*vjde-implements* -vjde-import-extract vjde.txt /*vjde-import-extract* -vjde-import-sort vjde.txt /*vjde-import-sort* -vjde-install vjde.txt /*vjde-install* -vjde-java vjde.txt /*vjde-java* -vjde-java-pkg vjde.txt /*vjde-java-pkg* -vjde-javadoc vjde.txt /*vjde-javadoc* -vjde-jsp vjde.txt /*vjde-jsp* -vjde-override vjde.txt /*vjde-override* -vjde-preview vjde.txt /*vjde-preview* -vjde-project vjde.txt /*vjde-project* -vjde-qa vjde.txt /*vjde-qa* -vjde-refactor vjde.txt /*vjde-refactor* -vjde-rft-arg vjde.txt /*vjde-rft-arg* -vjde-rft-const vjde.txt /*vjde-rft-const* -vjde-rft-field vjde.txt /*vjde-rft-field* -vjde-rft-local vjde.txt /*vjde-rft-local* -vjde-taglib vjde.txt /*vjde-taglib* -vjde-tasklist vjde.txt /*vjde-tasklist* -vjde-template vjde.txt /*vjde-template* -vjde-todolist vjde.txt /*vjde-todolist* -vjde-variable vjde.txt /*vjde-variable* -vjde-wizard vjde.txt /*vjde-wizard* -vjde-xdoclet vjde.txt /*vjde-xdoclet* -vjde-xml vjde.txt /*vjde-xml* -vjde-xmldata vjde.txt /*vjde-xmldata* -vjde.txt vjde.txt /*vjde.txt* -vjde_auto_mark vjde.txt /*vjde_auto_mark* -vjde_autoload_stl vjde.txt /*vjde_autoload_stl* -vjde_autoload_taglib vjde.txt /*vjde_autoload_taglib* -vjde_cfu_java_dot vjde.txt /*vjde_cfu_java_dot* -vjde_cfu_java_para vjde.txt /*vjde_cfu_java_para* -vjde_doc_gui_height vjde.txt /*vjde_doc_gui_height* -vjde_doc_gui_width vjde.txt /*vjde_doc_gui_width* -vjde_javadoc_path vjde.txt /*vjde_javadoc_path* -vjde_lib_path vjde.txt /*vjde_lib_path* -vjde_out_path vjde.txt /*vjde_out_path* -vjde_show_paras vjde.txt /*vjde_show_paras* -vjde_show_preview vjde.txt /*vjde_show_preview* -vjde_src_path vjde.txt /*vjde_src_path* -vjde_use_window vjde.txt /*vjde_use_window* -vjde_web_app vjde.txt /*vjde_web_app* -vjde_xml_advance vjde.txt /*vjde_xml_advance* diff --git a/home/.vim/ftplugin/sql.vim b/home/.vim/ftplugin/sql.vim deleted file mode 100644 index 3dff192..0000000 --- a/home/.vim/ftplugin/sql.vim +++ /dev/null @@ -1,264 +0,0 @@ -" SQL filetype plugin file -" Language: SQL -" Maintainer: Caleb Cushing <xenoterracide@gmail.com> -" Contributions: -" Michael Brailsford <brailsmt at yahoo dot com> " original author -" Hari Krishna Dara <hari_vim at yahoo dot com> -" Zak Beck <zak dot beck at e-peopleserve dot com> -" Last Change: Sun Oct 19 08:04:12 EDT 2008 -" Revision: 2.0.1 -" Download From: -" http://vim.sourceforge.net/script.php?script_id=2409 -" http://github.com/xenoterracide/sql_iabbr/tree/master -" git://github.com/xenoterracide/sql_iabbr.git -" Description: -" Capitalizes the SQL keywords when not typed in comments or string constants. -" To undo the previous immediate capitalization, press ^Xu. This will work -" correctly only when you are still next to the word for which you want to -" undo capitaliation and you have not left the insert mode since the -" capitaliation was done. -" Installation: -" Place it in your ftplugin directory (under user runtime directory). - -if exists("b:did_sql_iabbr") - finish -endif -let b:did_sql_iabbr = 1 - -inoreabbr <silent> <buffer> abort <C-R>=SqlIab_ReplaceConditionally('abort', 'ABORT')<CR> -inoreabbr <silent> <buffer> abstime <C-R>=SqlIab_ReplaceConditionally('abstime', 'ABSTIME')<CR> -inoreabbr <silent> <buffer> access <C-R>=SqlIab_ReplaceConditionally('access', 'ACCESS')<CR> -inoreabbr <silent> <buffer> aclitem <C-R>=SqlIab_ReplaceConditionally('aclitem', 'ACLITEM')<CR> -inoreabbr <silent> <buffer> add <C-R>=SqlIab_ReplaceConditionally('add', 'ADD')<CR> -inoreabbr <silent> <buffer> aggregate <C-R>=SqlIab_ReplaceConditionally('aggregate', 'AGGREGATE')<CR> -inoreabbr <silent> <buffer> all <C-R>=SqlIab_ReplaceConditionally('all', 'ALL')<CR> -inoreabbr <silent> <buffer> alter <C-R>=SqlIab_ReplaceConditionally('alter', 'ALTER')<CR> -inoreabbr <silent> <buffer> analyze <C-R>=SqlIab_ReplaceConditionally('analyze', 'ANALYZE')<CR> -inoreabbr <silent> <buffer> and <C-R>=SqlIab_ReplaceConditionally('and', 'AND')<CR> -inoreabbr <silent> <buffer> any <C-R>=SqlIab_ReplaceConditionally('any', 'ANY')<CR> -inoreabbr <silent> <buffer> as <C-R>=SqlIab_ReplaceConditionally('as', 'AS')<CR> -inoreabbr <silent> <buffer> as <C-R>=SqlIab_ReplaceConditionally('as', 'AS')<CR> -inoreabbr <silent> <buffer> asc <C-R>=SqlIab_ReplaceConditionally('asc', 'ASC')<CR> -inoreabbr <silent> <buffer> audit <C-R>=SqlIab_ReplaceConditionally('audit', 'AUDIT')<CR> -inoreabbr <silent> <buffer> authorization <C-R>=SqlIab_ReplaceConditionally('authorization', 'AUTHORIZATION')<CR> -inoreabbr <silent> <buffer> begin <C-R>=SqlIab_ReplaceConditionally('begin', 'BEGIN')<CR> -inoreabbr <silent> <buffer> between <C-R>=SqlIab_ReplaceConditionally('between', 'BETWEEN')<CR> -inoreabbr <silent> <buffer> bigint <C-R>=SqlIab_ReplaceConditionally('bigint', 'BIGINT')<CR> -inoreabbr <silent> <buffer> bit <C-R>=SqlIab_ReplaceConditionally('bit', 'BIT')<CR> -inoreabbr <silent> <buffer> blob <C-R>=SqlIab_ReplaceConditionally('blob', 'BLOB')<CR> -inoreabbr <silent> <buffer> boolean <C-R>=SqlIab_ReplaceConditionally('boolean', 'BOOLEAN')<CR> -inoreabbr <silent> <buffer> box <C-R>=SqlIab_ReplaceConditionally('box', 'BOX')<CR> -inoreabbr <silent> <buffer> by <C-R>=SqlIab_ReplaceConditionally('by', 'BY')<CR> -inoreabbr <silent> <buffer> bytea <C-R>=SqlIab_ReplaceConditionally('bytea', 'BYTEA')<CR> -inoreabbr <silent> <buffer> cascade <C-R>=SqlIab_ReplaceConditionally('cascade', 'CASCADE')<CR> -inoreabbr <silent> <buffer> char <C-R>=SqlIab_ReplaceConditionally('char', 'CHAR')<CR> -inoreabbr <silent> <buffer> character <C-R>=SqlIab_ReplaceConditionally('character', 'CHARACTER')<CR> -inoreabbr <silent> <buffer> check <C-R>=SqlIab_ReplaceConditionally('check', 'CHECK')<CR> -inoreabbr <silent> <buffer> checkpoint <C-R>=SqlIab_ReplaceConditionally('checkpoint', 'CHECKPOINT')<CR> -inoreabbr <silent> <buffer> cid <C-R>=SqlIab_ReplaceConditionally('cid', 'CID')<CR> -inoreabbr <silent> <buffer> cidr <C-R>=SqlIab_ReplaceConditionally('cidr', 'CIDR')<CR> -inoreabbr <silent> <buffer> circle <C-R>=SqlIab_ReplaceConditionally('circle', 'CIRCLE')<CR> -inoreabbr <silent> <buffer> close <C-R>=SqlIab_ReplaceConditionally('close', 'CLOSE')<CR> -inoreabbr <silent> <buffer> cluster <C-R>=SqlIab_ReplaceConditionally('cluster', 'CLUSTER')<CR> -inoreabbr <silent> <buffer> column <C-R>=SqlIab_ReplaceConditionally('column', 'COLUMN')<CR> -inoreabbr <silent> <buffer> count <C-R>=SqlIab_ReplaceConditionally('count', 'COUNT')<CR> -inoreabbr <silent> <buffer> comment <C-R>=SqlIab_ReplaceConditionally('comment', 'COMMENT')<CR> -inoreabbr <silent> <buffer> commit <C-R>=SqlIab_ReplaceConditionally('commit', 'COMMIT')<CR> -inoreabbr <silent> <buffer> compress <C-R>=SqlIab_ReplaceConditionally('compress', 'COMPRESS')<CR> -inoreabbr <silent> <buffer> connect <C-R>=SqlIab_ReplaceConditionally('connect', 'CONNECT')<CR> -inoreabbr <silent> <buffer> constraints <C-R>=SqlIab_ReplaceConditionally('constraints', 'CONSTRAINTS')<CR> -inoreabbr <silent> <buffer> copy <C-R>=SqlIab_ReplaceConditionally('copy', 'COPY')<CR> -inoreabbr <silent> <buffer> cre <C-R>=SqlIab_ReplaceConditionally('cre', 'CREATE')<CR> -inoreabbr <silent> <buffer> create <C-R>=SqlIab_ReplaceConditionally('create', 'CREATE')<CR> -inoreabbr <silent> <buffer> current <C-R>=SqlIab_ReplaceConditionally('current', 'CURRENT')<CR> -inoreabbr <silent> <buffer> cursor <C-R>=SqlIab_ReplaceConditionally('cursor', 'CURSOR')<CR> -inoreabbr <silent> <buffer> database <C-R>=SqlIab_ReplaceConditionally('database', 'DATABASE')<CR> -inoreabbr <silent> <buffer> date <C-R>=SqlIab_ReplaceConditionally('date', 'DATE')<CR> -inoreabbr <silent> <buffer> decimal <C-R>=SqlIab_ReplaceConditionally('decimal', 'DECIMAL')<CR> -inoreabbr <silent> <buffer> declare <C-R>=SqlIab_ReplaceConditionally('declare', 'DECLARE')<CR> -inoreabbr <silent> <buffer> default <C-R>=SqlIab_ReplaceConditionally('default', 'DEFAULT')<CR> -inoreabbr <silent> <buffer> delete <C-R>=SqlIab_ReplaceConditionally('delete', 'DELETE')<CR> -inoreabbr <silent> <buffer> desc <C-R>=SqlIab_ReplaceConditionally('desc', 'DESC')<CR> -inoreabbr <silent> <buffer> distinct <C-R>=SqlIab_ReplaceConditionally('distinct', 'DISTINCT')<CR> -inoreabbr <silent> <buffer> domain <C-R>=SqlIab_ReplaceConditionally('domain', 'DOMAIN')<CR> -inoreabbr <silent> <buffer> drop <C-R>=SqlIab_ReplaceConditionally('drop', 'DROP')<CR> -inoreabbr <silent> <buffer> else <C-R>=SqlIab_ReplaceConditionally('else', 'ELSE')<CR> -inoreabbr <silent> <buffer> elsif <C-R>=SqlIab_ReplaceConditionally('elsif', 'ELSIF')<CR> -inoreabbr <silent> <buffer> end <C-R>=SqlIab_ReplaceConditionally('end', 'END')<CR> -inoreabbr <silent> <buffer> escape <C-R>=SqlIab_ReplaceConditionally('escape', 'ESCAPE')<CR> -inoreabbr <silent> <buffer> exception <C-R>=SqlIab_ReplaceConditionally('exception', 'EXCEPTION')<CR> -inoreabbr <silent> <buffer> exclusive <C-R>=SqlIab_ReplaceConditionally('exclusive', 'EXCLUSIVE')<CR> -inoreabbr <silent> <buffer> execute <C-R>=SqlIab_ReplaceConditionally('execute', 'EXECUTE')<CR> -inoreabbr <silent> <buffer> exists <C-R>=SqlIab_ReplaceConditionally('exists', 'EXISTS')<CR> -inoreabbr <silent> <buffer> explain <C-R>=SqlIab_ReplaceConditionally('explain', 'EXPLAIN')<CR> -inoreabbr <silent> <buffer> false <C-R>=SqlIab_ReplaceConditionally('false', 'FALSE')<CR> -inoreabbr <silent> <buffer> fetch <C-R>=SqlIab_ReplaceConditionally('fetch', 'FETCH')<CR> -inoreabbr <silent> <buffer> file <C-R>=SqlIab_ReplaceConditionally('file', 'FILE')<CR> -inoreabbr <silent> <buffer> float <C-R>=SqlIab_ReplaceConditionally('float', 'FLOAT')<CR> -inoreabbr <silent> <buffer> for <C-R>=SqlIab_ReplaceConditionally('for', 'FOR')<CR> -inoreabbr <silent> <buffer> foreign <C-R>=SqlIab_ReplaceConditionally('foreign', 'FOREIGN')<CR> -inoreabbr <silent> <buffer> foriegn <C-R>=SqlIab_ReplaceConditionally('foriegn', 'FOREIGN')<CR> -inoreabbr <silent> <buffer> from <C-R>=SqlIab_ReplaceConditionally('from', 'FROM')<CR> -inoreabbr <silent> <buffer> function <C-R>=SqlIab_ReplaceConditionally('function', 'FUNCTION')<CR> -inoreabbr <silent> <buffer> grant <C-R>=SqlIab_ReplaceConditionally('grant', 'GRANT')<CR> -inoreabbr <silent> <buffer> group <C-R>=SqlIab_ReplaceConditionally('group', 'GROUP')<CR> -inoreabbr <silent> <buffer> having <C-R>=SqlIab_ReplaceConditionally('having', 'HAVING')<CR> -inoreabbr <silent> <buffer> identified <C-R>=SqlIab_ReplaceConditionally('identified', 'IDENTIFIED')<CR> -inoreabbr <silent> <buffer> if <C-R>=SqlIab_ReplaceConditionally('if', 'IF')<CR> -inoreabbr <silent> <buffer> immediate <C-R>=SqlIab_ReplaceConditionally('immediate', 'IMMEDIATE')<CR> -inoreabbr <silent> <buffer> in <C-R>=SqlIab_ReplaceConditionally('in', 'IN')<CR> -inoreabbr <silent> <buffer> increment <C-R>=SqlIab_ReplaceConditionally('increment', 'INCREMENT')<CR> -inoreabbr <silent> <buffer> index <C-R>=SqlIab_ReplaceConditionally('index', 'INDEX')<CR> -inoreabbr <silent> <buffer> inet <C-R>=SqlIab_ReplaceConditionally('inet', 'INET')<CR> -inoreabbr <silent> <buffer> initial <C-R>=SqlIab_ReplaceConditionally('initial', 'INITIAL')<CR> -inoreabbr <silent> <buffer> inner <C-R>=SqlIab_ReplaceConditionally('inner', 'INNER')<CR> -inoreabbr <silent> <buffer> ins <C-R>=SqlIab_ReplaceConditionally('ins', 'INSERT')<CR> -inoreabbr <silent> <buffer> insert <C-R>=SqlIab_ReplaceConditionally('insert', 'INSERT')<CR> -inoreabbr <silent> <buffer> int <C-R>=SqlIab_ReplaceConditionally('int', 'INTEGER')<CR> -inoreabbr <silent> <buffer> int2vector <C-R>=SqlIab_ReplaceConditionally('int2vector', 'INT2VECTOR')<CR> -inoreabbr <silent> <buffer> integer <C-R>=SqlIab_ReplaceConditionally('integer', 'INTEGER')<CR> -inoreabbr <silent> <buffer> intersect <C-R>=SqlIab_ReplaceConditionally('intersect', 'INTERSECT')<CR> -inoreabbr <silent> <buffer> interval <C-R>=SqlIab_ReplaceConditionally('interval', 'INTERVAL')<CR> -inoreabbr <silent> <buffer> into <C-R>=SqlIab_ReplaceConditionally('into', 'INTO')<CR> -inoreabbr <silent> <buffer> is <C-R>=SqlIab_ReplaceConditionally('is', 'IS')<CR> -inoreabbr <silent> <buffer> join <C-R>=SqlIab_ReplaceConditionally('join', 'JOIN')<CR> -inoreabbr <silent> <buffer> key <C-R>=SqlIab_ReplaceConditionally('key', 'KEY')<CR> -inoreabbr <silent> <buffer> language <C-R>=SqlIab_ReplaceConditionally('language', 'LANGUAGE')<CR> -inoreabbr <silent> <buffer> level <C-R>=SqlIab_ReplaceConditionally('level', 'LEVEL')<CR> -inoreabbr <silent> <buffer> line <C-R>=SqlIab_ReplaceConditionally('line', 'LINE')<CR> -inoreabbr <silent> <buffer> listen <C-R>=SqlIab_ReplaceConditionally('listen', 'LISTEN')<CR> -inoreabbr <silent> <buffer> load <C-R>=SqlIab_ReplaceConditionally('load', 'LOAD')<CR> -inoreabbr <silent> <buffer> lock <C-R>=SqlIab_ReplaceConditionally('lock', 'LOCK')<CR> -inoreabbr <silent> <buffer> long <C-R>=SqlIab_ReplaceConditionally('long', 'LONG')<CR> -inoreabbr <silent> <buffer> loop <C-R>=SqlIab_ReplaceConditionally('loop', 'LOOP')<CR> -inoreabbr <silent> <buffer> lseg <C-R>=SqlIab_ReplaceConditionally('lseg', 'LSEG')<CR> -inoreabbr <silent> <buffer> macaddr <C-R>=SqlIab_ReplaceConditionally('macaddr', 'MACADDR')<CR> -inoreabbr <silent> <buffer> maxextents <C-R>=SqlIab_ReplaceConditionally('maxextents', 'MAXEXTENTS')<CR> -inoreabbr <silent> <buffer> minus <C-R>=SqlIab_ReplaceConditionally('minus', 'MINUS')<CR> -inoreabbr <silent> <buffer> mlslabel <C-R>=SqlIab_ReplaceConditionally('mlslabel', 'MLSLABEL')<CR> -inoreabbr <silent> <buffer> mode <C-R>=SqlIab_ReplaceConditionally('mode', 'MODE')<CR> -inoreabbr <silent> <buffer> modify <C-R>=SqlIab_ReplaceConditionally('modify', 'MODIFY')<CR> -inoreabbr <silent> <buffer> money <C-R>=SqlIab_ReplaceConditionally('money', 'MONEY')<CR> -inoreabbr <silent> <buffer> move <C-R>=SqlIab_ReplaceConditionally('move', 'MOVE')<CR> -inoreabbr <silent> <buffer> name <C-R>=SqlIab_ReplaceConditionally('name', 'NAME')<CR> -inoreabbr <silent> <buffer> noaudit <C-R>=SqlIab_ReplaceConditionally('noaudit', 'NOAUDIT')<CR> -inoreabbr <silent> <buffer> nocompress <C-R>=SqlIab_ReplaceConditionally('nocompress', 'NOCOMPRESS')<CR> -inoreabbr <silent> <buffer> not <C-R>=SqlIab_ReplaceConditionally('not', 'NOT')<CR> -inoreabbr <silent> <buffer> notify <C-R>=SqlIab_ReplaceConditionally('notify', 'NOTIFY')<CR> -inoreabbr <silent> <buffer> nowait <C-R>=SqlIab_ReplaceConditionally('nowait', 'NOWAIT')<CR> -inoreabbr <silent> <buffer> null <C-R>=SqlIab_ReplaceConditionally('null', 'NULL')<CR> -inoreabbr <silent> <buffer> number <C-R>=SqlIab_ReplaceConditionally('number', 'NUMBER')<CR> -inoreabbr <silent> <buffer> numeric <C-R>=SqlIab_ReplaceConditionally('numeric', 'NUMERIC')<CR> -inoreabbr <silent> <buffer> of <C-R>=SqlIab_ReplaceConditionally('of', 'OF')<CR> -inoreabbr <silent> <buffer> offline <C-R>=SqlIab_ReplaceConditionally('offline', 'OFFLINE')<CR> -inoreabbr <silent> <buffer> oid <C-R>=SqlIab_ReplaceConditionally('oid', 'OID')<CR> -inoreabbr <silent> <buffer> oidvector <C-R>=SqlIab_ReplaceConditionally('oidvector', 'OIDVECTOR')<CR> -inoreabbr <silent> <buffer> on <C-R>=SqlIab_ReplaceConditionally('on', 'ON')<CR> -inoreabbr <silent> <buffer> online <C-R>=SqlIab_ReplaceConditionally('online', 'ONLINE')<CR> -inoreabbr <silent> <buffer> operator <C-R>=SqlIab_ReplaceConditionally('operator', 'OPERATOR')<CR> -inoreabbr <silent> <buffer> option <C-R>=SqlIab_ReplaceConditionally('option', 'OPTION')<CR> -inoreabbr <silent> <buffer> or <C-R>=SqlIab_ReplaceConditionally('or', 'OR')<CR> -inoreabbr <silent> <buffer> order <C-R>=SqlIab_ReplaceConditionally('order', 'ORDER')<CR> -inoreabbr <silent> <buffer> out <C-R>=SqlIab_ReplaceConditionally('out', 'OUT')<CR> -inoreabbr <silent> <buffer> path <C-R>=SqlIab_ReplaceConditionally('path', 'PATH')<CR> -inoreabbr <silent> <buffer> pctfree <C-R>=SqlIab_ReplaceConditionally('pctfree', 'PCTFREE')<CR> -inoreabbr <silent> <buffer> point <C-R>=SqlIab_ReplaceConditionally('point', 'POINT')<CR> -inoreabbr <silent> <buffer> polygon <C-R>=SqlIab_ReplaceConditionally('polygon', 'POLYGON')<CR> -inoreabbr <silent> <buffer> primary <C-R>=SqlIab_ReplaceConditionally('primary', 'PRIMARY')<CR> -inoreabbr <silent> <buffer> prior <C-R>=SqlIab_ReplaceConditionally('prior', 'PRIOR')<CR> -inoreabbr <silent> <buffer> privileges <C-R>=SqlIab_ReplaceConditionally('privileges', 'PRIVILEGES')<CR> -inoreabbr <silent> <buffer> procedure <C-R>=SqlIab_ReplaceConditionally('procedure', 'PROCEDURE')<CR> -inoreabbr <silent> <buffer> public <C-R>=SqlIab_ReplaceConditionally('public', 'PUBLIC')<CR> -inoreabbr <silent> <buffer> raw <C-R>=SqlIab_ReplaceConditionally('raw', 'RAW')<CR> -inoreabbr <silent> <buffer> real <C-R>=SqlIab_ReplaceConditionally('real', 'REAL')<CR> -inoreabbr <silent> <buffer> refcursor <C-R>=SqlIab_ReplaceConditionally('refcursor', 'REFCURSOR')<CR> -inoreabbr <silent> <buffer> references <C-R>=SqlIab_ReplaceConditionally('references', 'REFERENCES')<CR> -inoreabbr <silent> <buffer> refs <C-R>=SqlIab_ReplaceConditionally('refs', 'REFERENCES')<CR> -inoreabbr <silent> <buffer> regproc <C-R>=SqlIab_ReplaceConditionally('regproc', 'REGPROC')<CR> -inoreabbr <silent> <buffer> reindex <C-R>=SqlIab_ReplaceConditionally('reindex', 'REINDEX')<CR> -inoreabbr <silent> <buffer> reltime <C-R>=SqlIab_ReplaceConditionally('reltime', 'RELTIME')<CR> -inoreabbr <silent> <buffer> rename <C-R>=SqlIab_ReplaceConditionally('rename', 'RENAME')<CR> -inoreabbr <silent> <buffer> reset <C-R>=SqlIab_ReplaceConditionally('reset', 'RESET')<CR> -inoreabbr <silent> <buffer> resource <C-R>=SqlIab_ReplaceConditionally('resource', 'RESOURCE')<CR> -inoreabbr <silent> <buffer> return <C-R>=SqlIab_ReplaceConditionally('return', 'RETURN')<CR> -inoreabbr <silent> <buffer> returns <C-R>=SqlIab_ReplaceConditionally('returns', 'RETURNS')<CR> -inoreabbr <silent> <buffer> revoke <C-R>=SqlIab_ReplaceConditionally('revoke', 'REVOKE')<CR> -inoreabbr <silent> <buffer> rollback <C-R>=SqlIab_ReplaceConditionally('rollback', 'ROLLBACK')<CR> -inoreabbr <silent> <buffer> row <C-R>=SqlIab_ReplaceConditionally('row', 'ROW')<CR> -inoreabbr <silent> <buffer> rowid <C-R>=SqlIab_ReplaceConditionally('rowid', 'ROWID')<CR> -inoreabbr <silent> <buffer> rowlabel <C-R>=SqlIab_ReplaceConditionally('rowlabel', 'ROWLABEL')<CR> -inoreabbr <silent> <buffer> rownum <C-R>=SqlIab_ReplaceConditionally('rownum', 'ROWNUM')<CR> -inoreabbr <silent> <buffer> rows <C-R>=SqlIab_ReplaceConditionally('rows', 'ROWS')<CR> -inoreabbr <silent> <buffer> rule <C-R>=SqlIab_ReplaceConditionally('rule', 'RULE')<CR> -inoreabbr <silent> <buffer> savepoint <C-R>=SqlIab_ReplaceConditionally('savepoint', 'SAVEPOINT')<CR> -inoreabbr <silent> <buffer> schema <C-R>=SqlIab_ReplaceConditionally('schema', 'SCHEMA')<CR> -inoreabbr <silent> <buffer> select <C-R>=SqlIab_ReplaceConditionally('select', 'SELECT')<CR> -inoreabbr <silent> <buffer> sequence <C-R>=SqlIab_ReplaceConditionally('sequence', 'SEQUENCE')<CR> -inoreabbr <silent> <buffer> serial <C-R>=SqlIab_ReplaceConditionally('serial', 'SERIAL')<CR> -inoreabbr <silent> <buffer> session <C-R>=SqlIab_ReplaceConditionally('session', 'SESSION')<CR> -inoreabbr <silent> <buffer> set <C-R>=SqlIab_ReplaceConditionally('set', 'SET')<CR> -inoreabbr <silent> <buffer> share <C-R>=SqlIab_ReplaceConditionally('share', 'SHARE')<CR> -inoreabbr <silent> <buffer> show <C-R>=SqlIab_ReplaceConditionally('show', 'SHOW')<CR> -inoreabbr <silent> <buffer> size <C-R>=SqlIab_ReplaceConditionally('size', 'SIZE')<CR> -inoreabbr <silent> <buffer> smallint <C-R>=SqlIab_ReplaceConditionally('smallint', 'SMALLINT')<CR> -inoreabbr <silent> <buffer> smgr <C-R>=SqlIab_ReplaceConditionally('smgr', 'SMGR')<CR> -inoreabbr <silent> <buffer> some <C-R>=SqlIab_ReplaceConditionally('some', 'SOME')<CR> -inoreabbr <silent> <buffer> start <C-R>=SqlIab_ReplaceConditionally('start', 'START')<CR> -inoreabbr <silent> <buffer> successful <C-R>=SqlIab_ReplaceConditionally('successful', 'SUCCESSFUL')<CR> -inoreabbr <silent> <buffer> synonym <C-R>=SqlIab_ReplaceConditionally('synonym', 'SYNONYM')<CR> -inoreabbr <silent> <buffer> sysdate <C-R>=SqlIab_ReplaceConditionally('sysdate', 'SYSDATE')<CR> -inoreabbr <silent> <buffer> table <C-R>=SqlIab_ReplaceConditionally('table', 'TABLE')<CR> -inoreabbr <silent> <buffer> text <C-R>=SqlIab_ReplaceConditionally('text', 'TEXT')<CR> -inoreabbr <silent> <buffer> then <C-R>=SqlIab_ReplaceConditionally('then', 'THEN')<CR> -inoreabbr <silent> <buffer> tid <C-R>=SqlIab_ReplaceConditionally('tid', 'TID')<CR> -inoreabbr <silent> <buffer> timestamp <C-R>=SqlIab_ReplaceConditionally('timestamp', 'TIMESTAMP')<CR> -inoreabbr <silent> <buffer> tinterval <C-R>=SqlIab_ReplaceConditionally('tinterval', 'TINTERVAL')<CR> -inoreabbr <silent> <buffer> to <C-R>=SqlIab_ReplaceConditionally('to', 'TO')<CR> -inoreabbr <silent> <buffer> trans <C-R>=SqlIab_ReplaceConditionally('trans', 'TRANSACTION')<CR> -inoreabbr <silent> <buffer> transaction <C-R>=SqlIab_ReplaceConditionally('transaction', 'TRANSACTION')<CR> -inoreabbr <silent> <buffer> trigger <C-R>=SqlIab_ReplaceConditionally('trigger', 'TRIGGER')<CR> -inoreabbr <silent> <buffer> true <C-R>=SqlIab_ReplaceConditionally('true', 'TRUE')<CR> -inoreabbr <silent> <buffer> truncate <C-R>=SqlIab_ReplaceConditionally('truncate', 'TRUNCATE')<CR> -inoreabbr <silent> <buffer> type <C-R>=SqlIab_ReplaceConditionally('type', 'TYPE')<CR> -inoreabbr <silent> <buffer> type <C-R>=SqlIab_ReplaceConditionally('type', 'TYPE')<CR> -inoreabbr <silent> <buffer> uid <C-R>=SqlIab_ReplaceConditionally('uid', 'UID')<CR> -inoreabbr <silent> <buffer> union <C-R>=SqlIab_ReplaceConditionally('union', 'UNION')<CR> -inoreabbr <silent> <buffer> unique <C-R>=SqlIab_ReplaceConditionally('unique', 'UNIQUE')<CR> -inoreabbr <silent> <buffer> unknown <C-R>=SqlIab_ReplaceConditionally('unknown', 'UNKNOWN')<CR> -inoreabbr <silent> <buffer> unlisten <C-R>=SqlIab_ReplaceConditionally('unlisten', 'UNLISTEN')<CR> -inoreabbr <silent> <buffer> update <C-R>=SqlIab_ReplaceConditionally('update', 'UPDATE')<CR> -inoreabbr <silent> <buffer> user <C-R>=SqlIab_ReplaceConditionally('user', 'USER')<CR> -inoreabbr <silent> <buffer> using <C-R>=SqlIab_ReplaceConditionally('using', 'USING')<CR> -inoreabbr <silent> <buffer> vacuum <C-R>=SqlIab_ReplaceConditionally('vacuum', 'VACUUM')<CR> -inoreabbr <silent> <buffer> validate <C-R>=SqlIab_ReplaceConditionally('validate', 'VALIDATE')<CR> -inoreabbr <silent> <buffer> value <C-R>=SqlIab_ReplaceConditionally('value', 'VALUE')<CR> -inoreabbr <silent> <buffer> values <C-R>=SqlIab_ReplaceConditionally('values', 'VALUES')<CR> -inoreabbr <silent> <buffer> varchar <C-R>=SqlIab_ReplaceConditionally('varchar', 'VARCHAR')<CR> -inoreabbr <silent> <buffer> varchar2 <C-R>=SqlIab_ReplaceConditionally('varchar2', 'VARCHAR2')<CR> -inoreabbr <silent> <buffer> varray <C-R>=SqlIab_ReplaceConditionally('varray', 'VARRAY')<CR> -inoreabbr <silent> <buffer> view <C-R>=SqlIab_ReplaceConditionally('view', 'VIEW')<CR> -inoreabbr <silent> <buffer> whenever <C-R>=SqlIab_ReplaceConditionally('whenever', 'WHENEVER')<CR> -inoreabbr <silent> <buffer> where <C-R>=SqlIab_ReplaceConditionally('where', 'WHERE')<CR> -inoreabbr <silent> <buffer> with <C-R>=SqlIab_ReplaceConditionally('with', 'WITH')<CR> -inoreabbr <silent> <buffer> xid <C-R>=SqlIab_ReplaceConditionally('xid', 'XID')<CR> -inoreabbr <silent> <buffer> replace <C-R>=SqlIab_ReplaceConditionally('replace', 'REPLACE')<CR> -inoreabbr <silent> <buffer> error <C-R>=SqlIab_ReplaceConditionally('error', 'ERROR')<CR> -inoreabbr <silent> <buffer> output <C-R>=SqlIab_ReplaceConditionally('output', 'OUTPUT')<CR> -inoreabbr <silent> <buffer> owned <C-R>=SqlIab_ReplaceConditionally('owned', 'OWNED')<CR> -inoreabbr <silent> <buffer> datetime <C-R>=SqlIab_ReplaceConditionally('datetime', 'DATETIME')<CR> - -function! SqlIab_ReplaceConditionally(original, replacement) - " only replace outside of comments or strings (which map to constant) - let elesyn = synIDtrans(synID(line("."), col(".") - 1, 0)) - if elesyn != hlID('Comment') && elesyn != hlID('Constant') - let word = a:replacement - else - let word = a:original - endif - - let g:UndoBuffer = a:original - return word -endfunction - -inoremap <buffer> <C-X>u <C-W><C-R>=g:UndoBuffer<CR><C-V><Space> - diff --git a/home/.vim/plugin/ScreenShot.vim b/home/.vim/plugin/ScreenShot.vim deleted file mode 100644 index b25a7ef..0000000 --- a/home/.vim/plugin/ScreenShot.vim +++ /dev/null @@ -1,1189 +0,0 @@ -" Copyright (c) 2006, Michael Shvarts <shvarts@akmosoft.com> -" -"{{{-----------License: -" ScreenShot.vim is free software; you can redistribute it and/or modify it under -" the terms of the GNU General Public License as published by the Free -" Software Foundation; either version 2, or (at your option) any later -" version. -" -" ScreenShot.vim is distributed in the hope that it will be useful, but WITHOUT ANY -" WARRANTY; without even the implied warranty of MERCHANTABILITY or -" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -" for more details. -" -" You should have received a copy of the GNU General Public License along -" with ScreenShot.vim; see the file COPYING. If not, write to the Free Software -" Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. -"}}} -"{{{-----------Info: -" Version: 0.8 -" Description: -" Generates screenshot of your current VIM session as HTML code -" -" FEEDBACK PLEASE -" -" Installation: Drop it into your plugin directory -" -" History: -" 0.7: Initial upload -" 0.8: -" Added: -" a) Full 'nowrap' option support -" b) Non-printable characters support -" c) 'showbreak' option support -" d) 'display' option support (lastline and uhex both) -" e) 'list' option support -" 0.9: -" Added: -" a)Custom statusline (i.e. 'stl' option support) -" b)Tabline bar(only for console or if 'guioptions' does not contain 'e'). Custom tabline also supported -" c)Title bar with VIM logo (can be disabled). Custom title(i.e. option 'titlestring') also supported -" d)Credits in right bottom corner(can be disabled) -" 1.0: -" Added: -" a)Diff mode support -" b)New command Diff2Html -" 1.01: -" Fixed: -" 1. Italic, bold and underline was broken in 1.0 version, now repaired -" 2. Proper highligting of number of buffers in tabline -" 3. Proper rendering of too long tabline or too long titleline -" 4. Proper title for 'nofile' current buffer -" 1.02: -" Fixed: -" Reverse attribute improper handling in some cases -" 1.03: A few bugfixes by Cyril Slobin <slobin@ice.ru> -" Fixed: -" 1. Unqualified variables in statusline are treated as global now -" 3. When encoding is set to utf-8, non-ASCII letters are displayed now -" 4. Flag options like [+] long ago haven't space before them, fixea -" Fixed: (by MS) -" 5. Incorrect highlighting in the case when foreground set and -" background unset and reverse attribute set -" 6. Incorrect HTML when vim compiled with gui but running in terminal -" Added: -" 7. Support for 256-color xterm added -" 1.04: -" Fixed: -" 1. Proper colors for DOS and win32 console versions(suggestion by Cyril Slobin <slobin@ice.ru>) -" 2. Black color is now default for background in console, even if no -" "reverse" attribute set, because it is typical behaviour of terminals. -" Added: -" 3. 'force_background' option added to g:ScreenShot dictionary to enable -" user to adjust HTML-generation to terminal behaviour distinct from typical. -" (color should be specified as a string in HTML format #RRGGBB) -" 1.05: -" Added: -" Good multibyte support(thanks Cyril Slobin <slobin@ice.ru> for suggestion) -" 1.06: -" Fixed: -" 1. Folds are displayed correctly now(was broken in 1.05) -" 2. Unprintable unicode chracters are displayed correctly now -" 1.07: -" Html size optimized -" Fixed: -" 1. Status line %V item -" 2. Proper embedding in HTML page with defined default color -" -"" -" TODO: -" 1.Very small windows proper rendering -" 2.Linebreak option support -" }}} -"{{{-----------Status Line -function! s:Dump(var,...) - let indent = a:0?(a:1):0 - if type(a:var) == type({}) - return "\n".repeat(' ',indent)."{\n".repeat(' ',indent).join(map(copy(items(a:var)),'string(v:val[0]).": ".Dump(v:val[1],indent + 4)'), ',')."\n".repeat(' ',indent)."}\n" - elseif type(a:var) == type([]) - return "\n".repeat(' ',indent)."[\n".repeat(' ',indent).join(map(copy(a:var),'Dump(v:val,indent + 4)'),', ')."\n".repeat(' ',indent)."]\n" - else - return string(a:var) - endif - -endf -function! s:Sum(array) - return len(a:array)?eval(join(map(copy(a:array),'strlen(v:val.value)'),' + ')):0 -endf - -let s:PrintfNode = {'type': ''} -function! s:PrintfNode.Value() - if self.name == '' - return '' - elseif has_key(self,'expr') - return eval(self.expr) - endif - return '[unimplemented]' -endf -function! s:PrintfNode.Render(hi,lasttype,fillchar,invischar) - let res = self.Value() - if self.type == 'flag' && (res =~ '^,' && a:lasttype == 'plain' || res =~ '^ ' && a:lasttype == 'flag' || a:lasttype == 'start') - let res = strpart(res, 1) - endif - if strlen(self.minwid)&& strlen(res) < self.minwid - if self.left - let res .= repeat(a:fillchar, self.minwid - strlen(res)) - else - let res = repeat(self.type=='num'&&self.zeropad?'0': a:fillchar, self.minwid - strlen(res)).res - endif - elseif strlen(self.maxwid) && strlen(res) > self.maxwid - let res = strpart(a:invischar.strpart(res,strlen(res) - self.maxwid + strlen(a:invischar)),0, self.maxwid) - endif - return [{'value': res,'hi': a:hi,'lasttype': (strlen(res)?(self.type):(a:lasttype))}] -endf -function! CopyArgs(args,...) - return filter((a:0)?extend(copy(a:args),map(eval('{'.join(map(items(filter(deepcopy(a:),'has_key(a:args,v:key)&&type(v:val) == type("")')),'string(v:val[1]).":".string(v:val[0])'),',').'}'), 'a:args[v:val[0]]')):copy(a:args),'v:key !~ "\\v^(\\d+|firstline|lastline)$"') -endf -function! s:PrintfNode.New(name,left,zeropad,minwid,maxwid,...) - return map(extend(has_key(s:Nodes,a:name)?(deepcopy(s:Nodes[a:name])):deepcopy(self),CopyArgs(a:,'value','root')), "v:key == 'minwid'&& a:0 < 2 && v:val > 50?50:(v:val)") -endf -let s:StringNode = extend({'type': 'str'},s:PrintfNode,'keep') -let s:NumericNode = extend({'type': 'num'},s:PrintfNode,'keep') -let s:FlagNode = extend({'type': 'flag'},s:StringNode,'keep') - -unlet s:FlagNode.Value -function! s:FlagNode.Value() - if has_key(self,'expr') - let res = eval(self.expr) - if type(res) == type(1) - let res = res?(self.on):self.off - endif - return !strlen(res)?'':self.name =~ '\U'?' ['.res.']': ','.res - endif - return '[unimplemented]' -endf - -let s:Nodes = {'f': copy(s:StringNode), - \'F': copy(s:StringNode), - \'t': copy(s:StringNode), - \'m': extend({'name': 'm','expr': '&modified','on': '+','off': '-'} ,s:FlagNode), - \'M': extend({'name': 'M','expr': '&modified','on': '+','off': '-'} ,s:FlagNode), - \'r': extend({'name': 'r','expr': '&readonly','on': 'RO','off': ''} ,s:FlagNode), - \'R': extend({'name': 'R','expr': '&readonly','on': 'RO','off': ''} ,s:FlagNode), - \'h': extend({'name': 'h','expr': '&buftype == "help"','on': 'help','off': ''} ,s:FlagNode), - \'H': extend({'name': 'H','expr': '&buftype == "help"','on': 'HLP','off': ''} ,s:FlagNode), - \'w': extend({'name': 'w','expr': '&previewwindow','on': 'Preview','off': ''} ,s:FlagNode), - \'W': extend({'name': 'W','expr': '&previewwindow','on': 'PRV','off': ''} ,s:FlagNode), - \'y': extend({'name': 'y','expr': '&filetype' } ,s:FlagNode), - \'Y': extend({'name': 'Y','expr': 'toupper(&filetype)'} ,s:FlagNode), - \'k': extend({'expr': '""'}, s:StringNode ), - \'n': extend({'expr': 'bufnr("%")'}, s:NumericNode), - \'b': copy(s:NumericNode), - \'B': copy(s:NumericNode), - \'o': copy(s:NumericNode), - \'O': copy(s:NumericNode), - \'N': copy(s:NumericNode), - \'l': extend({'expr': "line('.')" }, s:NumericNode), - \'L': extend({'expr': "line('$')" }, s:NumericNode), - \'c': extend({'expr': "col('$') - 1?col('.'):0" }, s:NumericNode), - \'v': extend({'expr': "virtcol('.')" }, s:NumericNode), - \'V': copy(s:StringNode), - \'p': copy(s:NumericNode), - \'P': copy(s:StringNode), - \'a': copy(s:StringNode), - \'{': copy(s:StringNode), - \'(': copy(s:PrintfNode), - \')': copy(s:PrintfNode), - \'T': copy(s:PrintfNode), - \'X': copy(s:NumericNode), - \'<': copy(s:PrintfNode), - \'=': copy(s:PrintfNode), - \'#': extend(copy(s:PrintfNode),{'type': 'hi'}), - \'*': extend(copy(s:PrintfNode),{'type': 'hi'})} -unlet s:Nodes.T.Render -function! s:Nodes.T.Render(hi,lasttype,fillchar,invischar) - return [{'value': '', 'hi': a:hi,'lasttype': a:lasttype}] -endf -unlet s:Nodes.M.Value -function! s:Nodes.M.Value() - if !eval(self.expr) && !strlen(&buftype) - return '' - endif - return call(s:FlagNode.Value, [], self) -endf -let s:Nodes.m.Value = s:Nodes.M.Value -unlet s:Nodes.f.Value -function! s:Nodes.f.Value() " Path to the file in the buffer, relative to current directory. - return strlen(bufname('%'))?fnamemodify(bufname('%'),':.'): '[No Name]' -endf -unlet s:Nodes.F.Value -function! s:Nodes.F.Value() " Full path to the file in the buffer. - return strlen(bufname('%'))?fnamemodify(bufname('%'),':p'): '[No Name]' -endf -unlet s:Nodes.t.Value -function! s:Nodes.t.Value() " File name (tail) of file in the buffer. - return strlen(bufname('%'))?fnamemodify(bufname('%'),':t'): '[No Name]' -endf -unlet s:Nodes.k.Value -function! s:Nodes.k.Value() " Value of \"b:keymap_name\" or 'keymap' when |:lmap| mappings are being used: \"<keymap>\" - return -endf -unlet s:Nodes.n.Value -function! s:Nodes.n.Value() " Buffer number. - return bufnr('%') -endf -unlet s:Nodes.b.Value -function! s:Nodes.b.Value() " Value of byte under cursor. - return char2nr(strpart(getline('.'),col('.')-1,1)) -endf -unlet s:Nodes.B.Value -function! s:Nodes.B.Value() " As above, in hexadecimal. - return printf('%x',s:Nodes.b.Value()) -endf -unlet s:Nodes.o.Value -function! s:Nodes.o.Value() " Byte number in file of byte under cursor, first byte is 1. Mnemonic: Offset from start of file (with one added) {not available when compiled without |+byte_offset| feature} - return line2byte('.') + col('.') -endf -unlet s:Nodes.O.Value -function! s:Nodes.O.Value() " As above, in hexadecimal. - return printf('%x',s:Nodes.o.Value()) -endf -unlet s:Nodes.N.Value -function! s:Nodes.N.Value() " Printer page number. (Only works in the 'printheader' option.) - return -endf -unlet s:Nodes.V.Value -function! s:Nodes.V.Value() " Virtual column number as -{num}. Not displayed if equal to 'c'. - return col('.') == virtcol('.')?'': '-'.virtcol('.') -endf -unlet s:Nodes.p.Value -function! s:Nodes.p.Value() " Percentage through file in lines as in |CTRL-G|. - return line('.') * 100 / line('$') -endf -unlet s:Nodes.P.Value -function! s:Nodes.P.Value() " Percentage through file of displayed window. This is like the percentage described for 'ruler'. Always 3 in length. - return line('w0') == 1?(line('$') == line('w$')?'All': 'Top'):line('w$') == line('$')?'Bot': printf('%02s',line('w0')*100/(line('$') - line('w$') + line('w0'))).'%' -endf -unlet s:Nodes.a.Value -function! s:Nodes.a.Value() " Argument list status as in default title. ({current} of {max}) Empty if the argument file count is zero or one. - return -endf -unlet s:Nodes['{'].Value -function! s:Nodes['{'].Value() " F Evaluate expression between '%{' and '}' and substitute result. Note that there is no '%' before the closing '}'. - for s:var in keys(g:) - execute "let " . s:var . " = g:" . s:var - endfor - let s:res = eval(self.value) - if type(s:res) == type("") - return s:res - else - return string(s:res) - endif -endf -function! s:TruncateArray(array,maxwid,left,invischar) - let array = a:left?(a:array):reverse(a:array) - let i = len(array) - let w = 0 - while i > 0 - let i -= 1 - let w += strlen(array[i].value) - if w + strlen(a:invischar) >= a:maxwid - let array = array[(i):] - if a:left - let array[0].value = a:invischar.strpart(array[0].value,w - a:maxwid + strlen(a:invischar)) - return array - else - let array[0].value = strpart(array[0].value, 0, strlen(array[0].value) - w + a:maxwid - strlen(a:invischar)).a:invischar - return reverse(array) - endif - endif - - endwhile -endf -unlet s:Nodes['('].Render -function! s:Nodes['('].Render(hi,lasttype,fillchar,invischar) " Start of item group. Can be used for setting the width and alignment of a section. Must be followed by %) somewhere. - let [hi, lasttype] = [a:hi, a:lasttype] - let array = [] - let i = 0 - let lt = 0 - for node in self.value - if type(node) == type({}) - let res = node.Render(hi,lasttype,a:fillchar,'<') - if node.name == '=' - let eq = res[0] - elseif node.name == '<' - let lt = i - endif - else - let res = strlen(node)?[{'value': node, 'hi': hi, 'lasttype': 'plain'}]:[] - endif - let array += res - let hi = array[len(array) - 1].hi - let lasttype = array[len(array) - 1].lasttype - unlet node - let i += 1 - endfor - let width = s:Sum(array) - if strlen(self.minwid) && width < self.minwid - let space = repeat(a:fillchar, self.minwid - width) - if exists('eq') - call extend(eq, {'value': space}) - elseif self.left - let array += [{'value': space, 'hi': array[len(array) - 1].hi,'lasttype': lasttype}] - else - let array = [{'value': space, 'hi': a:hi,'lasttype': a:lasttype}] + array - endif - elseif strlen(self.maxwid) && width > self.maxwid - if !lt && get(array[0],'lasttype','') != 'plain' - let part1 = [] - else - let part1 = array[:lt] - endif - let maxwid = self.maxwid - s:Sum(part1) - if maxwid >= 0 - let array = part1 + s:TruncateArray(array,maxwid,1,a:invischar) - else - let array = s:TruncateArray(part1,self.maxwid,0,a:invischar) - endif - endif - return array -endf -unlet s:Nodes[')'].Value -function! s:Nodes[')'].Value() " End of item group. No width fields allowed. - return -endf -unlet s:Nodes.T.Value -function! s:Nodes.T.Value() " For 'tabline': start of tab page N label. Use %T after the last label. This information is used for mouse clicks. - return "" -endf -unlet s:Nodes.X.Value -function! s:Nodes.X.Value() " For 'tabline': start of close tab N label. Use %X after the label, e.g.: %3Xclose%X. Use %999X for a \"close current tab\" mark. This information is used for mouse clicks. - return "" -endf -unlet s:Nodes['<'].Value -function! s:Nodes['<'].Value() " Where to truncate line if too long. Default is at the start. No width fields allowed. - return "" -endf -unlet s:Nodes['='].Value -function! s:Nodes['='].Value() " Separation point between left and right aligned items. No width fields allowed. - return "" -endf -unlet s:Nodes['#'].Render -function! s:Nodes['#'].Render(hi,lasttype,fillchar,invischar) " Set highlight group. The name must follow and then a # again. Thus use %#HLname# for highlight group HLname. The same highlighting is used, also for the statusline of non-current windows. - return [{'value': '', 'hi': self.value,'lasttype': a:lasttype}] -endf -unlet s:Nodes['*'].Render -function! s:Nodes['*'].Render(hi,lasttype,fillchar,invischar) " Set highlight group to User{N}, where {N} is taken from the minwid field, e.g. %1*. Restore normal highlight with %* or %0*. The difference between User{N} and StatusLine will be applied to StatusLineNC for the statusline of non-current windows. The number N must be between 1 and 9. See |hl-User1..9| - if !strlen(self.minwid) || !self.minwid - return [{'value': '', 'hi': '','lasttype': a:lasttype}] - endif - return [{'value': '', 'hi': 'User'.self.minwid,'lasttype': a:lasttype}] -endf -function! s:StlPrintf(expr,width,fillchar,invischar,hi) - let expr = a:expr =~ '^%!'?eval(strpart(a:expr,2)):a:expr - - let str = 's:Nodes["("].New("(",1,0,'.a:width.','.a:width.',['.substitute(expr,'\([^%]*\)\%(%\(-\)\?\(0\)\?\([1-9]\d*\)\?\%(\.\(\d*\)\)\?\([a-zA-Z<=*()]\|{\([^}]*\)}\|#\([^#]*\)#\)\|$\)','\= - \(submatch(1) != ""?string(submatch(1)).",": ""). - \( - \ submatch(6) == ")"?"]),": " get(s:Nodes,".string(strpart(submatch(6),0,1)).", s:PrintfNode". - \ ").New(". - \ string(strpart(submatch(6),0,1)).", ".strlen(submatch(2)).", ".strlen(submatch(3)).", ".string(submatch(4)).", ".string(submatch(5)). - \ (submatch(6)=="("?", [": - \ strlen(submatch(7))?", ".string(submatch(7))."),": - \ strlen(submatch(8))?", ".string(submatch(8))."),": - \ ")," - \ ) - \)','g').'], 1)' - "echo str - let tree = eval(str) - "echo Dump(tree) - let array = tree.Render('','start',a:fillchar,a:invischar) - let res = s:SynIdStart(hlID(a:hi)) - let id = a:hi - let type = 'start' - "echo Dump(array) - for node in array - if node.hi == '' - let node.hi = a:hi - endif - if node.hi != id && node.hi != 'TabLineTitle666' - let res .= s:SynIdEnd(hlID(id=='TabLineTitle666'?'Title':id)).s:SynIdStart(hlID(node.hi=='TabLineTitle666'?'Title':node.hi)) - let id = node.hi - endif - if node.hi=='TabLineTitle666' " Dirty hack to provide non-standard tabline digit highlighting - let res .= '<font color='.s:GetColor(hlID('Title'),1).'>'.s:HtmlEscape(node.value).'</font>' - else - let res .= s:HtmlEscape(node.value) - endif - endfor - let res .= s:SynIdEnd(hlID(id)) - return res -endf -function! s:Bufname(nr) - let name = bufname(a:nr) - if name == '' - let name = '[No name]' - endif - if strlen(getbufvar(a:nr,'&buftype')) - let name = fnamemodify(name,':t') - endif - return name -endf -function! s:TabTitle(nr) - let maxLen = (&columns - 1)*9/(9*tabpagenr('$') + 1) - 4 - let title = substitute(s:Bufname(tabpagebuflist(a:nr)[tabpagewinnr(a:nr)-1]),'\([^\\]\)[^\\]*\\', '\1\\','g') - if strlen(title) > maxLen - return strpart(title, strlen(title) - maxLen) - endif - return title -endf -function! s:DefaultTabLine() - let sel = "v:val+1==tabpagenr()?'%#TabLineSel#':'%#TabLine#'" - let bufNum = 'len(tabpagebuflist(v:val+1))' - let isModified = "eval(join(map(tabpagebuflist(v:val+1),'getbufvar(v:'.'val,\"&modified\")'),'||'))" - return join(map(range(tabpagenr('$')),"eval(sel).(eval(bufNum) > 1 || eval(isModified)?' %#'.(v:val+1==tabpagenr()?'Title':'TabLineTitle666').'#'.(eval(bufNum) > 1?eval(bufNum):'').'%'.(v:val+1).'T'.eval(sel).repeat('+',eval(isModified)).'%*'.eval(sel).'\ ':'').s:TabTitle(v:val + 1).' '"),'').'%#TabLineFill#%T%=%#TabLine#%XX' -endf -function! GetTabLine() - if tabpagenr('$') > 1 && &showtabline == 1 || &showtabline == 2 && (!has('gui_running') || stridx(&guioptions,'e') == -1) - return s:StlPrintf(strlen(&tabline)?&tabline: s:DefaultTabLine(), &columns,' ','<','') - endif - return '' -endf -function! s:GetTitle() - if !&title - let title = 'VIM' - else - let VIM = get(v:,'servername','') - if VIM == '' - let VIM = has('gui_running')?'GVIM': 'VIM' - endif - let bufName = &buftype == 'help'?'help':fnamemodify(fnamemodify(fnamemodify(bufname("%"),":p"),":~"),":h") - if strlen(bufName) > 3 - let partLen = 3 - let bufName = strpart(bufName, 0, partLen).'%<'.strpart(bufName,partLen) - endif - if strlen(bufName) - let bufName = '('.bufName.')' - endif - let args = argc() <= 1?'': ' ('.(argv(argidx()) == bufname('%')?argidx() + 1: '('.(argidx() + 1).')').' of '.argc().')' - let titlestring = strlen(&titlestring)?&titlestring: '%t %M '.bufName.args.' - '.VIM - let title = substitute(s:StlPrintf(titlestring,(strlen(&titlestring)? &titlelen?&titlelen:&columns: 1000) - 1,' ','..',''),'\s*$','','') - if !strlen(&titlestring) && strlen(title) > &columns - 5 - let title = title[0:(&columns - 5)/2 - 1 ].'...'.title[strlen(title) - (&columns - 5)/2 + 1:strlen(title)] - endif - let title = substitute(title, ' ', '\ ', 'g') - endif - if g:ScreenShot.Icon - return '<table align=left style="color:white;background:blue"><tr><th>'.s:ParseXpm(s:VimLogoXpm).'</th><th>'.title.'</th></tr></table>' - else - return title - endif -endf -function! s:SplitWithSpan(hi,str) - return eval(join(map(split(a:str,' '),"'s:SynIdWrap(a:hi,\"'.v:val.'\")'"), ".' '.")) -endf -function! s:GetCredits() - return s:SynIdWrap('Question','Code syntax highlighting by ').'<a '.s:SynIdStyle(s:GetDefaultHlVect()).' href=http://www.vim.org><u>'.s:SynIdWrap('ModeMsg','VIM').'</u></a>'.s:SynIdWrap('Question',' captured with ').'<a '.s:SynIdStyle(s:GetDefaultHlVect()).' href=http://www.vim.org/scripts/script.php?script_id=1552><u>'.s:SynIdWrap('ModeMsg','ScreenShot').'</u></a>'.s:SynIdWrap('Question',' script ') -endf -"}}} -"{{{-----------Menus -function! s:GetMenu(mode,name) - redir => src - exec a:mode.'menu '.a:name - redir END - return src -endf - -"}}} -"{{{-----------Xpm -function! s:ParseXpm(src) - let [all,comment,name,content;rest] = matchlist(tr(a:src,"\n"," "),'/\*\([^*]*\|\*[^/]\)\*/\s*static\s\+char\s*\*\s*\(\w*\)\[\]\s*=\s*{\(.*\)}') - let lines = eval('['.content.']') - let [width, height, colors_count, charwid; rest] = split(lines[0], '\s\+') - "echo l: - let colors = {} - for id in range(colors_count+1)[1:] - let [all, chars, key, color; rest] = matchlist(lines[id],'^\(.\{'.charwid.'\}\)\s\+\(.\)\s\+\(.*\)') - let colors[chars] = {'color': color, 'key': key} - endfor - "echo colors - let doc = '<table width='.width.' height='.height.' cellspacing=0 cellpadding=0>' - for num in range(height + colors_count + 1)[colors_count + 1:] - let doc .= '<tr>' - for i in range(width) - let col =get(colors,strpart(lines[num],i*charwid, charwid),{}) - let doc .= '<td'.((has_key(col, 'color') && col.color !~? '^\(None\|\)$')?(' bgcolor='.col.color): '').'></td>' - endfor - let doc .= '</tr>' - endfor - return doc.'</table>' -endf -let s:VimLogoXpm = "/* XPM */ - \static char * vim16x16[] = { - \'16 16 8 1', - \' c None', - \'. c #000000', - \'+ c #000080', - \'@ c #008000', - \'# c #00FF00', - \'$ c #808080', - \'% c #C0C0C0', - \'& c #FFFFFF', - \' .....#. .... ', - \' .&&&&&.@.&&&&. ', - \' .%%%%%$..%%%%$.', - \' .%%%$.@.&%%$. ', - \' .%%%$..&%%$. ', - \' .%%%$.&%%$.. ', - \' #.%%%$&%%$.@@. ', - \'#@.%%%&%%$.@@@@.', - \'.@.%%%%%..@@@@+ ', - \' ..%%%%.%...@. ', - \' .%%%%...%%.%. ', - \' .%%%.%%.%%%%%.', - \' .%%$..%.%.%.%.', - \' .%$.@.%.%.%.%.', - \' .. .%%.%.%.%.', - \' .. . . . '};" - -"}}} -"{{{-----------Window's layout recognition functions -function! s:Window_New(window,num) - call extend(a:window,{'num':a:num,'size': [winwidth(a:num),winheight(a:num)]}) -endf -function! s:Window_TryMerge(self,new) - if has_key(a:self,'prev') - if a:self.size[!a:self.prevdir] == a:self.prev.size[!a:self.prevdir] - if !has_key(a:self.prev, 'dir') - let a:self.prev.dir = a:self.prevdir - endif - if a:self.prev.dir == a:self.prevdir && !has_key(a:self.prev, 'num') - call s:Container_Add(a:self.prev,a:self) - else - call s:Container_New(a:new,a:self.prev,a:self) - endif - return 1 - endif - endif - return 0 -endf -function! s:Window_DelParent(self) - if has_key(a:self,'parent') - call remove(a:self,'parent') - endif - if has_key(a:self,'prev') - call remove(a:self,'prev') - endif - for entry in items(a:self) - if type(entry[1]) == 2 - unlet a:self[entry[0]] - endif - endfor - if !has_key(a:self, 'childs') - return - endif - for C in a:self.childs - call s:Window_DelParent(C) - endfor - -endf -function! s:Window_IsTop(self,top) - let res = a:self - while has_key(res,'parent') - let res = res.parent - endwhile - return res is a:top -endf -function! s:Container_New(container,child1,child2) - call extend(a:container,{'dir':a:child2.prevdir,'childs':[], 'size': [0,0]}) - let a:container.size[!a:container.dir] = a:child2.size[!a:container.dir] - call s:Container_Add(a:container,a:child1, a:child2) - if has_key(a:child1, 'prev') - let a:container.prev = a:child1.prev - endif - if has_key(a:child1, 'prevdir') - let a:container.prevdir = a:child1.prevdir - endif -endf -function! s:Container_Add(self,...) - for child in a:000 - let a:self.size[a:self.dir] += child.size[a:self.dir] + (len(a:self.childs) != 0) - call add(a:self.childs,child) - let child.parent = a:self - endfor -endf -function! s:EnumWindows() - let ei_save = &ei - let winnr_save = winnr() - set ei=all - let windows=[] - let i = 1 - while winwidth(i) > 0 - let window = {'active': i == winnr_save} - call s:Window_New(window, i) - call add(windows, window) - let i += 1 - endwhile - 1wincmd w - let i = 1 - let cur = {} - - while i == winnr() - - - let window = windows[i - 1] - let window.pos = {'line':line('.'),'col':col('.'),'virtcol':virtcol('.'),'topline':line('w0'),'bottomline':line('w$'),'lastline':line('$')} - if i - 1 - let window.prev = cur - wincmd k - if !s:Window_IsTop(windows[winnr() - 1],cur) - exec i.'wincmd w' - wincmd h - if !s:Window_IsTop(windows[winnr() - 1],cur) - echoerr 'Can not enum window!' - return 0 - endif - let window.prevdir = 0 - else - let window.prevdir = 1 - endif - exec i.'wincmd w' - let new={} - while s:Window_TryMerge(window,new) && has_key(window,'prev') - if len(new) - let window = new - let new = {} - else - let window = window.prev - endif - endwhile - endif - let cur = window - let i += 1 - wincmd w - endwhile - " call s:Window_DelParent(cur) - let &ei = ei_save - exec winnr_save.'wincmd w' - return cur - -endf -"}}} -"{{{-----------Html generation functions -if has('gui_running') - function! s:GetColor(id,type) - return synIDattr(a:id,a:type?'fg#': 'bg#') - endf -else - if &t_Co == 8 - if has('win32') || has('dos32') || has('dos16') - let s:Colors = ['#000000', '#0000ff', '#00ff00', '#00ffff', '#ff0000', '#ff00ff', '#ffff00', '#ffffff'] - else - let s:Colors = ['#000000', '#ff0000', '#00ff00', '#ffff00', '#0000ff', '#ff00ff', '#00ffff', '#ffffff'] - endif - else - if has('win32') || has('dos32') || has('dos16') - let s:Colors = ['#000000', '#0000c0', '#008000', '#008080', '#c00000', '#c000c0', '#808000', '#c0c0c0', '#808080', '#6060ff', '#00ff00', '#00ffff', '#ff8080', '#ff40ff', '#ffff00', '#ffffff'] - else - let s:Colors = ['#000000', '#c00000', '#008000', '#808000', '#0000c0', '#c000c0', '#008080', '#c0c0c0', '#808080', '#ff6060', '#00ff00', '#ffff00', '#8080ff', '#ff40ff', '#00ffff', '#ffffff'] - endif - endif - let s:valuerange = [0x00, 0x5F, 0x87, 0xAF, 0xD7, 0xFF] - function! s:GetColor(id,type) - let c = synIDattr(a:id,a:type?'fg#': 'bg#') - if c == '-1' || c == '' - return '' - endif - let cc = eval(c) - if &t_Co != 256 || cc < 0x10 - return s:Colors[cc] - else - let cc = cc - 16 - return '#'.(cc <= 216?(printf('%.2x',s:valuerange[(cc/36)%6]).printf('%.2x',s:valuerange[(cc/6)%6]).printf('%.2x',s:valuerange[cc%6])):repeat(printf('%.2x',8 + (cc - 216)*0x0a),3)) - endif - endf -endif -function! s:GetHlVect(id) - if type(a:id) != type([]) - let id = synIDtrans((type(a:id) == type(1))?(a:id):hlID(a:id)) - let reverse = synIDattr(id,'reverse') == '1' "&& id != hlID('Normal') - if id == hlID('Normal') && !reverse - return ['','','','',''] -" return s:GetDefaultHlVect() - endif - let color = s:GetColor(id,!reverse) - let background = s:GetColor(id,reverse) - if (color == '' || background == '') && reverse - if reverse - let style = s:GetDefaultHlVect() - let [color, background] = [color != ''?color : style[1] != ''?style[1] : '#ffffff', background != ''?background : style[0] != ''? style[0] : '#000000'] - endif - endif - return [color, background, synIDattr(id, 'bold'), synIDattr(id, 'italic'), synIDattr(id, 'underline')] - else - let vec = s:GetHlVect(a:id[0]) - let vecDiff = s:GetHlVect(a:id[1]) - return [vec[0], vecDiff[1], vecDiff[2]||vec[2], vecDiff[3]||vec[3], vecDiff[4]||vec[4]] - endif -endf -function! s:GetDefaultHlVect() - let id = hlID('Normal') - let color = s:GetColor(id,1) - let background = s:GetColor(id,0) - let background = has_key(g:ScreenShot, 'force_background')?g:ScreenShot.force_background : background != ''? background : has('gui_running') ?'#ffffff' : '#000000' - let color = color != ''?color : has('gui_running') || has_key(g:ScreenShot, 'force_background')?'#000000' : '#ffffff' - return [color, background, synIDattr(id, 'bold'), synIDattr(id, 'italic'), synIDattr(id, 'underline')] -endf -function! s:DiffSynId(y,x,fl) - return [synID(a:y,a:x,a:fl), diff_hlID(a:y,a:x)] -endf -function! s:SynIdStyle(id) - return (a:id[0] == '' && a:id[1] == '')?'' : 'style="'.(strlen(a:id[0])?'color:'.a:id[0].';': '').(strlen(a:id[1])?'background:'.a:id[1] : '').'"' -endf -function! s:SynIdStart(id) - let vec = s:GetHlVect(a:id) - return (vec[1] != ''? '<span style="'.(strlen(vec[0])?'color:'.vec[0].';': '').(strlen(vec[1])?'background:'.vec[1] : '').'">' : vec[0] != ''? '<font color='.vec[0].'>': '').(vec[2]?'<b>': '').(vec[3]?'<i>': '').(vec[4]?'<u>': '') -endf -function! s:SynIdEnd(id) - let vec = s:GetHlVect(a:id) - return (vec[4]?'</u>': '').(vec[3]?'</i>': '').(vec[2]?'</b>': '').(vec[1] != ''?'</span>': vec[0] != ''? '</font>': '') -endf -function! s:SynIdWrap(id,text) - return s:SynIdStart(a:id).a:text.s:SynIdEnd(a:id) -endf - -function! s:GetLinePrefix(y,numWidth,width,wrapped) - let prefix = '' - let closed = foldclosed(a:y) != -1 - if &foldcolumn - let level = foldlevel(a:y) - closed - if level || closed - if &foldcolumn > 1 - if level < &foldcolumn - let prefix = repeat('|',level) - - else - let i = level - &foldcolumn + 2 - while i <= level - let prefix .= i < 10? i : '>' - let i += 1 - endw - endif - if closed - let prefix .= '+'.repeat(' ',&foldcolumn - level - 1) - elseif level > foldlevel(a:y - 1) - let prefix = strpart(prefix,0,strlen(prefix) - 1).'-' - endif - let prefix .= repeat(' ', &foldcolumn - strlen(prefix)) - else - if level == 1 - let prefix = '|' - else - let prefix = level < 10?level : '>' - endif - if closed - let prefix = '+' - elseif level > foldlevel(a:y - 1) - let prefix = '-' - endif - endif - else - let prefix = repeat(' ',&foldcolumn) - endif - let prefix = s:SynIdWrap('FoldColumn',strpart(prefix,0,a:width)) - endif - if &number && a:y <= line('$') - if a:wrapped - let prefix .= s:SynIdWrap(a:wrapped?'LineNr': 'NonText',strpart(repeat(' ',a:numWidth),0,a:width - &foldcolumn)) - else - let prefix .= s:SynIdWrap(closed?'Folded': 'LineNr',strpart(repeat(' ',a:numWidth - 1 - strlen(a:y)).a:y.' ',0,a:width - &foldcolumn)) - endif - endif - return prefix -endf -function! s:HtmlEscape(text) - return substitute(a:text,'[<>&]','\={"<": "<",">": ">","&": "&"}[submatch(0)]','g') -endf -function! s:HtmlDecode(text) - return substitute(a:text,'&\([^;]*\);','\={"lt":"<","gt":">","amp":"&"}[submatch(1)]','g') -endf -function! s:Opt2Dict(opt) - return eval('{'.substitute(a:opt,'\(\w\+\):\([^,]*\)\(,\|$\)',"'\\1':'\\2'\\3", 'g').'}') -endf -function! s:GetFillChars() - return extend({"fold": "-",'vert': '|','stl': ' ','stlnc': ' ','diff': '-'},s:Opt2Dict(&fillchars)) -endf -function! s:synIDSpec(y,x,normal) - return !&diff?(a:normal):diff_hlID(a:y,a:x)?(s:DiffSynId(a:y,a:x,0)): [a:normal, 0] -endf -function! s:GetColoredText(lines,start,finish,height,topfill,lineEnd) - let y = a:start - let s:synIDfn = &diff? function('s:DiffSynId'): function('synID') - let realWidth = winwidth(winnr()) - let foldWidth = &foldcolumn - let numWidth = &number?max([&numberwidth,strlen(line('$'))+1]):0 - let width = realWidth - numWidth - foldWidth - let fillChars = s:GetFillChars() - let listChars = s:Opt2Dict(&listchars) - let expandTab = !&list || has_key(listChars, 'tab') - if !&list - let listChars.tab = ' ' - endif - let fill_screen = strlen(a:lineEnd) || get(g:ScreenShot, 'fill_screen', 0) - let d_opts = split(&display,',') - let [uhex, lastline] = [0, 0] - for d_opt in d_opts - if d_opt == 'uhex' - let uhex = 1 - elseif d_opt == 'lastline' - let lastline = 1 - endif - endfor - let realX = 0 - let view = winsaveview() - let topfill = a:topfill == -1?view.topfill : a:topfill - if a:height&&topfill - let inc = a:height?min([topfill,a:height]):topfill - for dd in range(inc) - call add(a:lines,s:GetLinePrefix(y - 1,numWidth,realWidth,0).s:SynIdWrap('DiffDelete',s:HtmlEscape(repeat(fillChars.diff,width))).a:lineEnd) - endfor - endif - let yReal = topfill - let skip = view.leftcol + (view.skipcol?(view.skipcol + strlen(&showbreak)):0) - let maxRealX = width + view.leftcol + view.skipcol - if width <= 0 - let [width , maxRealX] = [0, 0] - endif - let cond = ((!a:height || !lastline))?((a:start == a:finish && a:height)?'yReal < a:height && y == a:start || y < a:finish': 'y <= a:finish'): 'yReal < a:height' - while eval(cond) && y <= line('$') - let x = 1 - let xx = 0 - let str = getline(y) - let chunk = '' - let xmax = len(str) + &list - let prefix = s:GetLinePrefix(y,numWidth,realWidth,0) - let realX = 0 - let [oldId, oldId1] = &diff?[[0,0],[0, 0]] :[0, 0] - let folded = foldclosed(y) - if x > xmax - call add(a:lines, s:SynIdWrap(diff_hlID(y,x),prefix.(fill_screen || diff_hlID(y, x)?repeat(' ', width): '')).a:lineEnd) - elseif folded != -1 - let text = matchstr(foldtextresult(y), '.'.'\{,'.width.'\}', 0) - call add(a:lines,prefix.s:SynIdWrap('Folded',s:HtmlEscape(text).repeat(fillChars.fold,width - strlen(substitute(text, ".", "x", "g"))).a:lineEnd)) - let y = foldclosedend(y) - else - let tab = '' - let realX = 0 - let eol = 0 - if view.skipcol - let [oldId, oldId1, tab] = [&diff?[hlID('NonText'), 0] :hlID('NonText'), 0, s:SynIdStart(hlID('NonText')).s:HtmlEscape(&showbreak)] - endif - while x <= xmax && eval(cond) - let newLine = ((xx<maxRealX)?(prefix):s:GetLinePrefix(y,numWidth,realWidth,1)).tab - while realX < maxRealX - let [whole, char, str; dummy] = matchlist(str, '^\(.\=\)\(.*\)$') - let diffX = len(char)?len(char):1 - if char == '' - if eol || !&list || !has_key(listChars,'eol') - let diff = maxRealX - realX - let char = fill_screen || diff_hlID(y, x)?repeat(' ',diff): ' ' - let id = s:synIDSpec(y,x,0) - else - let id = s:synIDSpec(y,x,hlID('NonText')) - let diff = 1 - let char = listChars.eol - let eol = 1 - endif - elseif (char < ' ' || char > '~') && char !~ '\p' - if char == "\t" && expandTab - let id = s:synIDSpec(y,x,&list?hlID('SpecialKey'):synIDtrans(synID(y, x, 0))) - let diff = &tabstop - xx%&tabstop - let char = strpart(listChars.tab,0,1).repeat(strpart(listChars.tab,1),diff-1) - else - let id = s:synIDSpec(y,x,hlID('SpecialKey')) - if char2nr(char) < 0x100 - if uhex - let diff = 4 - let char = char == "\n"?'<00>':printf('<%02x>',char2nr(char)) - else - let diff = 2 - let charnr = char2nr(char) - if charnr == 10 - let char = '^@' - elseif charnr < 32 - let char = '^'.nr2char(64 + charnr) - elseif charnr == 127 - let char = '^?' - elseif charnr < 160 - let char = '~'.nr2char(64 + charnr - 128) - elseif charnr == 255 - let char = '~?' - else - let char = '|'.nr2char(32 + charnr - 160) - endif - endif - else - let diff = 6 - let char = printf('<%04x>',char2nr(char)) - endif - endif - else - let diff = 1 - let id = s:synIDfn(y,x,0) - endif - if id != oldId - if chunk != '' - let newLine .= s:SynIdEnd(oldId1).s:SynIdStart(oldId).s:HtmlEscape(chunk) - endif - let [chunk, oldId, oldId1] = ['', id, oldId] - endif - if realX >= skip - let chunk .= char - elseif realX + strlen(substitute(char, ".", "x", "g")) >= skip - let chunk .= matchstr(char,'.*',skip - realX) - endif - let realX += diff - let xx += diff - let x += diffX - endwhile - if chunk != '' - let newLine .= s:SynIdEnd(oldId1).s:SynIdStart(oldId).s:HtmlEscape(chunk) - let [chunk, oldId, oldId1] = ['', id, oldId] - endif - let save_id = oldId - if realX > maxRealX - let realX = realX - maxRealX - let [all, newLine, chunk; rest] = matchlist(newLine,'\(.*\)\(\%([^<>&;]\|&[^;]*;\)\{'.realX.'\}\)$') - let chunk = s:HtmlDecode(chunk) - else - let [chunk, realX] = ['', 0] - endif - let oldId1 = &diff?[0,0]: 0 - if &showbreak != '' - let xx += strlen(&showbreak) - let tab = s:SynIdWrap('NonText',s:HtmlEscape(&showbreak)) - let realX += strlen(&showbreak) - else - let tab = '' - endif - call add(a:lines, newLine.s:SynIdEnd(save_id).a:lineEnd) - if chunk == '' - let oldId = &diff?[0,0]: 0 - endif - let yReal += 1 - if !&wrap - break - endif - if view.skipcol - let maxRealX -= view.skipcol - let view.skipcol = 0 - let skip = 0 - endif - endw - let yReal -= 1 - endif - let yReal += 1 - let y += 1 - if diff_filler(y) - let inc = a:height?min([diff_filler(y),a:height - yReal]):diff_filler(y) - for dd in range(inc) - call add(a:lines,prefix.s:SynIdWrap('DiffDelete',s:HtmlEscape(repeat(fillChars.diff,width))).a:lineEnd) - endfor - let yReal += inc - endif - endw - while yReal < a:height - let prefix = s:GetLinePrefix(y,numWidth,realWidth,0) - let fill_screen = fill_screen || s:GetHlVect('NonText')[1] != '' - - if y > line('$') - call add(a:lines, prefix.s:SynIdStart(hlID('NonText')).'~'.(fill_screen?repeat(' ', width + numWidth - 1): '').s:SynIdEnd(hlID('NonText')).a:lineEnd) - else - call add(a:lines, s:GetLinePrefix(y,0,realWidth,1).s:SynIdStart(hlID('NonText')).'@'.(fill_screen?repeat(' ', width + numWidth - 1): '').s:SynIdEnd(hlID('NonText')).a:lineEnd) - endif - let yReal += 1 - endw - let style = s:GetDefaultHlVect() - if len(a:lines) && style[0] != '' - let a:lines[0] = '<font color='.style[0].'>'.a:lines[0] - let a:lines[len(a:lines) - 1] .= '</font>' - endif -endf -function! s:GetColoredWindowText(window,lines,last) - exec a:window.num.'wincmd w' - let fillChars = s:GetFillChars() - call s:GetColoredText(a:lines, line('w0'),line('w$'),winheight(a:window.num),-1,a:last[0]?'':s:SynIdWrap('VertSplit', fillChars.vert)) - let [fill_stl, synId] = (a:window.active)?[(fillChars.stl), 'StatusLine'] :[fillChars.stlnc, 'StatusLineNC'] - if strlen(&statusline) - let StatusLine = s:StlPrintf(&statusline,winwidth('.'),fill_stl,'<',synId) - else - let name = s:Bufname('%') - if &modified - let name .= fillChars.stlnc.'[+]' - endif - if &readonly - let name .= (&modified?'':fillChars.stlnc).'[RO]' - endif - if a:window.pos.topline == 1 - if a:window.pos.bottomline == a:window.pos.lastline - let percents = 'All' - else - let percents = 'Top' - endif - elseif a:window.pos.bottomline == a:window.pos.lastline - let percents = 'Bot' - else - let percents = (a:window.pos.topline*100/(a:window.pos.lastline + a:window.pos.topline - a:window.pos.bottomline )).'%' - if strlen(percents) == 2 - let percents = ' '.percents - endif - endif - let posInfo = a:window.pos.line.','.a:window.pos.col.((a:window.pos.col != a:window.pos.virtcol)?('-'.a:window.pos.virtcol): '') - let width = winwidth('.') - let magicLen = 18 - let lack = strlen(name) + magicLen + 1 - width - if lack < 0 - let StatusLine = name.repeat(fillChars.stlnc, width - strlen(name) - magicLen).posInfo.repeat(fillChars.stlnc,magicLen - 3 - strlen(posInfo)).percents - else - let free = strlen(name) + magicLen - 1 - strlen(posInfo) - let widthFree = width - 2 - strlen(posInfo) - let newNameLen = (strlen(name) - 1)*widthFree/free - let newInfoLen = (magicLen - strlen(posInfo))*widthFree/free - let newNameLen += widthFree - newNameLen - newInfoLen - let StatusLine = s:HtmlEscape('<'.strpart(name, strlen(name) - newNameLen)).' '.posInfo - let percents = ' '.percents - if (newInfoLen>4) - let StatusLine .= repeat(fillChars.stlnc,newInfoLen - 4).percents - elseif newInfoLen >= 0 - let StatusLine .= repeat(fillChars.stlnc,newInfoLen) - else - let StatusLine = strpart(StatusLine, 0, strlen(StatusLine) + newInfoLen) - endif - - - endif - let StatusLine = s:SynIdWrap(synId,StatusLine) - endif - call add(a:lines,StatusLine.s:SynIdWrap(synId, a:last[0]?'':fill_stl)) -endf - -function! s:InternalToHtml(self,lines,last) - if has_key(a:self, 'childs') - let lines = [] - let last = [0,0] - let b = 0 - for C in range(len(a:self.childs)) - let last[a:self.dir] = a:last[a:self.dir] && C == len(a:self.childs) - 1 - let last[1 - a:self.dir] = a:last[1 - a:self.dir] - if b - let childLines = [] - call s:InternalToHtml(a:self.childs[C],childLines,last) - if !a:self.dir - - let i = 0 - while i < len(childLines) - let lines[i] .= childLines[i] - let i += 1 - endw - else - - let lines += childLines - endif - else - call s:InternalToHtml(a:self.childs[C],lines,last) - let b = 1 - endif - - endfor - call extend(a:lines, lines) - elseif has_key(a:self, 'num') - call s:GetColoredWindowText(a:self, a:lines, a:last) - endif - -endf -function! s:SaveEvents() - let saved = [&winwidth,&winheight,&winminheight,&winminwidth,&ei] - let [&winwidth,&winheight,&winminheight,&winminwidth,&ei] = [1, 1, 1, 1, 'all'] - return saved -endf -function! s:RestoreEvents(saved) - let [&winwidth,&winheight,&winminheight,&winminwidth,&ei] = a:saved -endf -"}}} -"{{{-----------Top-level functions and commands -if !exists('ScreenShot') - let ScreenShot = {} -endif -call extend(ScreenShot,{'Title': 1,'Icon': 1,'Credits': 1},'keep') -function! ToHtml() - let tabline = GetTabLine() - if g:ScreenShot.Title - let title = s:GetTitle() - endif - let saved = s:SaveEvents() - let win = s:EnumWindows() - let lines = [] - call s:InternalToHtml(win, lines, [1,1]) - call s:RestoreEvents(saved) - if tabline != '' - call insert(lines,tabline) - endif - let lines[0] = '<table cellspacing=0 cellpadding=0 '.s:SynIdStyle(s:GetDefaultHlVect()).' '.(exists('title')?' border=2><tr><th align=left style="color:white;background:blue">'.title.'</th></tr>': '>').'<tr><td><pre>'.lines[0] - let lines[len(lines) - 1] .= '</pre></td></tr>'.(g:ScreenShot.Credits?'<tr><td><table align=right><tr><td width=20%></td><td width=80%><small><i>'.s:GetCredits().'</i></small></td></tr></table></td></tr>': '').'</table>' - return lines -endf -function! Text2Html(line1,line2) - let lines = [] - call s:GetColoredText(lines,a:line1,a:line2,0,0,'') - exec 'new '.bufname('%').'.html' - let lines[0] = '<table cellspacing=0 cellpadding=0 '.s:SynIdStyle(s:GetDefaultHlVect()).'><tr><td colspan><pre>'.lines[0] - call append(0,lines + ['</pre></td></tr>'.(g:ScreenShot.Credits?'<tr><td><table align=right><tr><td width=20%></td><td width=80%><small><i>'.s:GetCredits().'</i></small></td></tr></table></td></tr>': '').'</table>']) -endf - -function! ScreenShot() - let a = ToHtml() - let shots = eval('['.substitute(glob('screenshot-*.html'),'\%(screenshot-\(\d*\).html\|.*\)\%(\n\|$\)','\=((submatch(1)!="")?submatch(1):0).","','g').']') - exec 'new screenshot-'.(max(shots) + 1).'.html' - call append(0,a) -endf -function! Diff2Html(line1,line2) - let buffs = map(filter(tabpagebuflist(tabpagenr()),'getwinvar(bufwinnr(v:val),''&diff'')'),'bufwinnr(v:val)') - if len(buffs) < 2 - echoerr 'Window in diff mode not found' - return 0 - endif - if buffs[0] == winnr() - let num = 0 - else - let num = index(buffs, winnr()) - if num == -1 - echoerr 'Can''t find current buffer!' - return - endif - let buffs[1] = buffs[num] - let num = 1 - endif - let lineTop = eval(join(map(range(1,a:line1),'diff_filler(v:val) - (foldclosed(v:val)>0) + (v:val == foldclosedend(v:val) ) + 1'),'+')) - let height = eval(join(map(range(a:line1,a:line2),'diff_filler(v:val) - (foldclosed(v:val)>0) + (v:val == foldclosedend(v:val)) + 1'),'+')) - exec buffs[1-num].'wincmd w' - let i = 0 - let val = 0 - while val < lineTop && i < line('$') - let i += 1 - let val += diff_filler(i) - (foldclosed(i)>0) + (i == foldclosedend(i) ) + 1 - endw - let [topfill{num+1}, topfill{2-num}] = [0, val - lineTop] - let [startY{num+1}, startY{2-num}] = [a:line1, i] - while val < lineTop + height && i < line('$') - let i += 1 - let val += diff_filler(i) - (foldclosed(i)>0) + (i == foldclosedend(i) ) + 1 - endw - let [endY{num+1}, endY{2-num}] = [a:line2, i-1] - exec buffs[0].'wincmd w' - let lines1 = [] - call s:GetColoredText(lines1,startY1,endY1,height,topfill1,s:SynIdWrap('VertSplit', s:GetFillChars().vert)) - exec buffs[1].'wincmd w' - let lines2 = [] - call s:GetColoredText(lines2,startY2,endY2,height,topfill2,'') - for i in range(len(lines1)) - let lines1[i] .= lines2[i] - endfor - exec 'new '.fnamemodify(bufname(winbufnr(buffs[0])),':t').'\ -\ '.fnamemodify(bufname(winbufnr(buffs[0])),':t').'.diff.html' - let lines1[0] = '<table cellspacing=0 cellpadding=0 '.s:SynIdStyle(s:GetDefaultHlVect()).'><tr><td colspan><pre>'.lines1[0] - call append(0,lines1 + ['</pre></td></tr>'.(g:ScreenShot.Credits?'<tr><td><table align=right><tr><td width=20%></td><td width=80%><small><i>'.s:GetCredits().'</i></small></td></tr></table></td></tr>': '').'</table>']) - -endf -command! -range=% Text2Html :call Text2Html(<line1>,<line2>) -command! ScreenShot :call ScreenShot() -command! -range=% Diff2Html :call Diff2Html(<line1>,<line2>) -"}}} vim:foldmethod=marker foldlevel=0 diff --git a/home/.vim/plugin/buftabline.vim b/home/.vim/plugin/buftabline.vim new file mode 100644 index 0000000..091a5f7 --- /dev/null +++ b/home/.vim/plugin/buftabline.vim @@ -0,0 +1,195 @@ +" Vim global plugin for rendering the buffer list in the tabline +" Licence: The MIT License (MIT) +" Commit: $Format:%H$ +" {{{ Copyright (c) 2015 Aristotle Pagaltzis <pagaltzis@gmx.de> +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to deal +" in the Software without restriction, including without limitation the rights +" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +" copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in +" all copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +" THE SOFTWARE. +" }}} + +if v:version < 700 + echoerr printf('Vim 7 is required for buftabline (this is only %d.%d)',v:version/100,v:version%100) + finish +endif + +scriptencoding utf-8 + +hi default link BufTabLineCurrent TabLineSel +hi default link BufTabLineActive PmenuSel +hi default link BufTabLineHidden TabLine +hi default link BufTabLineFill TabLineFill + +let g:buftabline_numbers = get(g:, 'buftabline_numbers', 0) +let g:buftabline_indicators = get(g:, 'buftabline_indicators', 0) +let g:buftabline_separators = get(g:, 'buftabline_separators', 0) +let g:buftabline_show = get(g:, 'buftabline_show', 2) +let g:buftabline_plug_max = get(g:, 'buftabline_plug_max', 10) + +function! buftabline#user_buffers() " help buffers are always unlisted, but quickfix buffers are not + return filter(range(1,bufnr('$')),'buflisted(v:val) && "quickfix" !=? getbufvar(v:val, "&buftype")') +endfunction + +let s:dirsep = fnamemodify(getcwd(),':p')[-1:] +let s:centerbuf = winbufnr(0) +function! buftabline#render() + let show_num = g:buftabline_numbers == 1 + let show_ord = g:buftabline_numbers == 2 + let show_mod = g:buftabline_indicators + let lpad = g:buftabline_separators ? nr2char(0x23B8) : ' ' + + let bufnums = buftabline#user_buffers() + let centerbuf = s:centerbuf " prevent tabline jumping around when non-user buffer current (e.g. help) + + " pick up data on all the buffers + let tabs = [] + let path_tabs = [] + let tabs_per_tail = {} + let currentbuf = winbufnr(0) + let screen_num = 0 + for bufnum in bufnums + let screen_num = show_num ? bufnum : show_ord ? screen_num + 1 : '' + let tab = { 'num': bufnum } + let tab.hilite = currentbuf == bufnum ? 'Current' : bufwinnr(bufnum) > 0 ? 'Active' : 'Hidden' + if currentbuf == bufnum | let [centerbuf, s:centerbuf] = [bufnum, bufnum] | endif + let bufpath = bufname(bufnum) + if strlen(bufpath) + let tab.path = fnamemodify(bufpath, ':p:~:.') + let tab.sep = strridx(tab.path, s:dirsep, strlen(tab.path) - 2) " keep trailing dirsep + let tab.label = tab.path[tab.sep + 1:] + let pre = ( show_mod && getbufvar(bufnum, '&mod') ? '+' : '' ) . screen_num + let tab.pre = strlen(pre) ? pre . ' ' : '' + let tabs_per_tail[tab.label] = get(tabs_per_tail, tab.label, 0) + 1 + let path_tabs += [tab] + elseif -1 < index(['nofile','acwrite'], getbufvar(bufnum, '&buftype')) " scratch buffer + let tab.label = ( show_mod ? '!' . screen_num : screen_num ? screen_num . ' !' : '!' ) + else " unnamed file + let tab.label = ( show_mod && getbufvar(bufnum, '&mod') ? '+' : '' ) + \ . ( screen_num ? screen_num : '*' ) + endif + let tabs += [tab] + endfor + + " disambiguate same-basename files by adding trailing path segments + while len(filter(tabs_per_tail, 'v:val > 1')) + let [ambiguous, tabs_per_tail] = [tabs_per_tail, {}] + for tab in path_tabs + if -1 < tab.sep && has_key(ambiguous, tab.label) + let tab.sep = strridx(tab.path, s:dirsep, tab.sep - 1) + let tab.label = tab.path[tab.sep + 1:] + endif + let tabs_per_tail[tab.label] = get(tabs_per_tail, tab.label, 0) + 1 + endfor + endwhile + + " now keep the current buffer center-screen as much as possible: + + " 1. setup + let lft = { 'lasttab': 0, 'cut': '.', 'indicator': '<', 'width': 0, 'half': &columns / 2 } + let rgt = { 'lasttab': -1, 'cut': '.$', 'indicator': '>', 'width': 0, 'half': &columns - lft.half } + + " 2. sum the string lengths for the left and right halves + let currentside = lft + for tab in tabs + let tab.label = lpad . get(tab, 'pre', '') . tab.label . ' ' + let tab.width = strwidth(strtrans(tab.label)) + if centerbuf == tab.num + let halfwidth = tab.width / 2 + let lft.width += halfwidth + let rgt.width += tab.width - halfwidth + let currentside = rgt + continue + endif + let currentside.width += tab.width + endfor + if currentside is lft " centered buffer not seen? + " then blame any overflow on the right side, to protect the left + let [lft.width, rgt.width] = [0, lft.width] + endif + + " 3. toss away tabs and pieces until all fits: + if ( lft.width + rgt.width ) > &columns + let oversized + \ = lft.width < lft.half ? [ [ rgt, &columns - lft.width ] ] + \ : rgt.width < rgt.half ? [ [ lft, &columns - rgt.width ] ] + \ : [ [ lft, lft.half ], [ rgt, rgt.half ] ] + for [side, budget] in oversized + let delta = side.width - budget + " toss entire tabs to close the distance + while delta >= tabs[side.lasttab].width + let delta -= remove(tabs, side.lasttab).width + endwhile + " then snip at the last one to make it fit + let endtab = tabs[side.lasttab] + while delta > ( endtab.width - strwidth(strtrans(endtab.label)) ) + let endtab.label = substitute(endtab.label, side.cut, '', '') + endwhile + let endtab.label = substitute(endtab.label, side.cut, side.indicator, '') + endfor + endif + + if len(tabs) | let tabs[0].label = substitute(tabs[0].label, lpad, ' ', '') | endif + + let swallowclicks = '%'.(1 + tabpagenr('$')).'X' + return swallowclicks . join(map(tabs,'printf("%%#BufTabLine%s#%s",v:val.hilite,strtrans(v:val.label))'),'') . '%#BufTabLineFill#' +endfunction + +function! buftabline#update(zombie) + set tabline= + if tabpagenr('$') > 1 | set guioptions+=e showtabline=2 | return | endif + set guioptions-=e + if 0 == g:buftabline_show + set showtabline=1 + return + elseif 1 == g:buftabline_show + " account for BufDelete triggering before buffer is actually deleted + let bufnums = filter(buftabline#user_buffers(), 'v:val != a:zombie') + let &g:showtabline = 1 + ( len(bufnums) > 1 ) + elseif 2 == g:buftabline_show + set showtabline=2 + endif + set tabline=%!buftabline#render() +endfunction + +augroup BufTabLine +autocmd! +autocmd VimEnter * call buftabline#update(0) +autocmd TabEnter * call buftabline#update(0) +autocmd BufAdd * call buftabline#update(0) +autocmd BufDelete * call buftabline#update(str2nr(expand('<abuf>'))) +augroup END + +for s:n in range(1, g:buftabline_plug_max) + ( g:buftabline_plug_max > 0 ? [-1] : [] ) + let s:b = s:n == -1 ? -1 : s:n - 1 + execute printf("noremap <silent> <Plug>BufTabLine.Go(%d) :<C-U>exe 'b'.get(buftabline#user_buffers(),%d,'')<cr>", s:n, s:b) +endfor +unlet! s:n s:b + +if v:version < 703 + function s:transpile() + let [ savelist, &list ] = [ &list, 0 ] + redir => src + silent function buftabline#render + redir END + let &list = savelist + let src = substitute(src, '\n\zs[0-9 ]*', '', 'g') + let src = substitute(src, 'strwidth(strtrans(\([^)]\+\)))', 'strlen(substitute(\1, ''\p\|\(.\)'', ''x\1'', ''g''))', 'g') + return src + endfunction + exe "delfunction buftabline#render\n" . s:transpile() + delfunction s:transpile +endif diff --git a/home/.vim/plugin/buftabs.vim b/home/.vim/plugin/buftabs.vim deleted file mode 100644 index ec9e6c6..0000000 --- a/home/.vim/plugin/buftabs.vim +++ /dev/null @@ -1,247 +0,0 @@ -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" buftabs (C) 2006 Ico Doornekamp -" -" This program is free software; you can redistribute it and/or modify it -" under the terms of the GNU General Public License as published by the Free -" Software Foundation; either version 2 of the License, or (at your option) -" any later version. -" -" This program is distributed in the hope that it will be useful, but WITHOUT -" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -" more details. -" -" Introduction -" ------------ -" -" This is a simple script that shows a tabs-like list of buffers in the bottom -" of the window. The biggest advantage of this script over various others is -" that it does not take any lines away from your terminal, leaving more space -" for the document you're editing. The tabs are only visible when you need -" them - when you are switchin between buffers. -" -" Usage -" ----- -" -" This script draws buffer tabs on vim startup, when a new buffer is created -" and when switching between buffers. -" -" It might be handy to create a few maps for easy switching of buffers in your -" .vimrc file. For example, using F1 and F2 keys: -" -" noremap <f1> :bprev<CR> -" noremap <f2> :bnext<CR> -" -" or using control-left and control-right keys: -" -" :noremap <C-left> :bprev<CR> -" :noremap <C-right> :bnext<CR> -" -" -" The following extra configuration variables are availabe: -" -" * g:buftabs_only_basename -" -" Define this variable to make buftabs only print the filename of each buffer, -" omitting the preceding directory name. Add to your .vimrc: -" -" :let g:buftabs_only_basename=1 -" -" -" * g:buftabs_in_statusline -" -" Define this variable to make the plugin show the buftabs in the statusline -" instead of the command line. It is a good idea to configure vim to show -" the statusline as well when only one window is open. Add to your .vimrc: -" -" set laststatus=2 -" :let g:buftabs_in_statusline=1 -" -" -" * g:buftabs_active_highlight_group -" -" The name of a highlight group (:help highligh-groups) which is used to -" show the name of the current active buffer. If this variable is not -" defined, no highlighting is used. (Highlighting is only functional when -" g:buftabs_in_statusline is enabled) -" -" :let g:buftabs_active_highlight_group="Visual" -" -" -" Bugs -" ---- -" -" Vim's 'set hidden' option is known to break this plugin - for some reason -" vim will overwrite the buftabs when this option is enabled. -" -" -" Changelog -" --------- -" -" 0.1 2006-09-22 Initial version -" -" 0.2 2006-09-22 Better handling when the list of buffers is longer then the -" window width. -" -" 0.3 2006-09-27 Some cleanups, set 'hidden' mode by default -" -" 0.4 2007-02-26 Don't draw buftabs until VimEnter event to avoid clutter at -" startup in some circumstances -" -" 0.5 2007-02-26 Added option for showing only filenames without directories -" in tabs -" -" 0.6 2007-03-04 'only_basename' changed to a global variable. Removed -" functions and add event handlers instead. 'hidden' mode -" broke some things, so is disabled now. Fixed documentation -" -" 0.7 2007-03-07 Added configuration option to show tabs in statusline -" instead of cmdline -" -" 0.8 2007-04-02 Update buftabs when leaving insertmode -" -" 0.9 2007-08-22 Now compatible with older Vim versions < 7.0 -" -" 0.10 2008-01-26 Added GPL license -" -" 0.11 2008-02-29 Added optional syntax highlighting to active buffer name -" -" 0.12 2009-03-18 Fixed support for split windows -" -" 0.13 2009-05-07 Store and reuse right-aligned part of original statusline -" -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - -" -" Called on VimEnter event -" - -let s:buftabs_enabled = 0 -let s:original_statusline = matchstr(&statusline, "%=.*") - -function! Buftabs_enable() - let s:buftabs_enabled = 1 -endfunction - - -" -" Draw the buftabs -" - -function! Buftabs_show() - - let l:i = 1 - let l:list = '' - let l:start = 0 - let l:end = 0 - if ! exists("s:from") - let s:from = 0 - endif - - if s:buftabs_enabled != 1 - return - endif - - " Walk the list of buffers - - while(l:i <= bufnr('$')) - - " Only show buffers in the list, and omit help screens - - if buflisted(l:i) && getbufvar(l:i, "&modifiable") - - " Get the name of the current buffer, and escape characters that might - " mess up the statusline - - if exists("g:buftabs_only_basename") - let l:name = fnamemodify(bufname(l:i), ":t") - else - let l:name = bufname(l:i) - endif - let l:name = substitute(l:name, "%", "%%", "g") - - " Append the current buffer number and name to the list. If the buffer - " is the active buffer, enclose it in some magick characters which will - " be replaced by markers later. If it is modified, it is appended with - " an exclaimation mark - - if winbufnr(winnr()) == l:i - let l:start = strlen(l:list) - let l:list = l:list . "\x01" - else - let l:list = l:list . ' ' - endif - - let l:list = l:list . l:i . "-" - let l:list = l:list . l:name - - if getbufvar(l:i, "&modified") == 1 - let l:list = l:list . "!" - endif - - if winbufnr(winnr()) == l:i - let l:list = l:list . "\x02" - let l:end = strlen(l:list) - else - let l:list = l:list . ' ' - endif - end - - let l:i = l:i + 1 - endwhile - - " If the resulting list is too long to fit on the screen, chop - " out the appropriate part - - let l:width = winwidth(0) - 12 - - if(l:start < s:from) - let s:from = l:start - 1 - endif - if l:end > s:from + l:width - let s:from = l:end - l:width - endif - - let l:list = strpart(l:list, s:from, l:width) - - " Replace the magic characters by visible markers for highlighting the - " current buffer. The markers can be simple characters like square brackets, - " but can also be special codes with highlight groups - - let l:buftabs_marker_start = "[" - let l:buftabs_marker_end = "]" - if exists("g:buftabs_active_highlight_group") - if exists("g:buftabs_in_statusline") - let l:buftabs_marker_start = "%#" . g:buftabs_active_highlight_group . "#" . l:buftabs_marker_start - let l:buftabs_marker_end = l:buftabs_marker_end . "%##" - end - end - - let l:list = substitute(l:list, "\x01", l:buftabs_marker_start, 'g') - let l:list = substitute(l:list, "\x02", l:buftabs_marker_end, 'g') - - " Show the list. The buftabs_in_statusline variable determines of the list - " is displayed in the command line (volatile) or in the statusline - " (persistent) - - if exists("g:buftabs_in_statusline") - let &l:statusline = l:list . s:original_statusline - else - redraw - echon l:list - end - -endfunction - - -" Hook to events to show buftabs at startup, when creating and when switching -" buffers - -autocmd VimEnter * call Buftabs_enable() -autocmd VimEnter,BufNew,BufEnter,BufWritePost * call Buftabs_show() -if version >= 700 - autocmd InsertLeave,VimResized * call Buftabs_show() -end - -" vi: ts=2 sw=2 - diff --git a/home/.vim/plugin/buildwin.vim b/home/.vim/plugin/buildwin.vim index 22282ff..22282ff 100755..100644 --- a/home/.vim/plugin/buildwin.vim +++ b/home/.vim/plugin/buildwin.vim diff --git a/home/.vim/scripts.vim b/home/.vim/scripts.vim index 29fdae9..29fdae9 100755..100644 --- a/home/.vim/scripts.vim +++ b/home/.vim/scripts.vim diff --git a/home/.vim/src/CSParser.cs b/home/.vim/src/CSParser.cs deleted file mode 100644 index 690b42a..0000000 --- a/home/.vim/src/CSParser.cs +++ /dev/null @@ -1,165 +0,0 @@ -namespace Wangfc { - using System; - using System.Reflection; - public class CSParser { - static string tn = null; - static string[] libs ; - static string[] nss ; - static string bas=null; - // mono CSParaser typename libs namespace - // mono CSParaser Assembly d:/mono-1.1.13.4/lib/mono/2.0/mscorlib.dll "System;System.Reflection" - public static void Main(string[] argv) { - if ( argv.Length < 2 ) { - return; - } - if ( argv.Length >3 ) { - bas = argv[3]; - } - tn = argv[0]; - - libs = argv[1].Split(';'); - if ( argv.Length < 3 ) { - nss = new string[1]; - nss[0]=""; - } - else { - nss = argv[2].Split(';'); - for ( int i = 0 ; i < nss.Length ; i++ ) { - if (nss[i].Trim().Length==0) - nss[i] = ""; - else - nss[i] = nss[i].Trim()+"."; - } - } - findType(); - } - private static void findType() { - foreach ( string lib in libs ) { - Assembly assem = Assembly.LoadFrom(lib); - if ( assem == null ) { - continue; - } - Module[] module = assem.GetModules(); - if (module != null ) { - foreach (Module m in module) { - if (genModule(m)) { - return; - } - } - } - Type[] typeInfo = assem.GetTypes(); - int find = 0; - string fchar = " " ; - foreach ( string ns in nss) { - string tof = ns+tn; - int len = tof.Length; - if ( bas != null ) { - tof = tof+"."+bas ; - } - foreach ( Type t in typeInfo) { - if ( t.FullName.StartsWith(tof) && - t.FullName.IndexOf('.',len+1,t.FullName.Length-len-1)<0) { - if (find==0) { - Console.WriteLine("["); - Console.WriteLine("\""+ns+tn+"\","); - Console.WriteLine("["); - find = 2; - } - Console.WriteLine( fchar +"[\""+ t.FullName.Substring(len+1) + "\",\""+t.FullName+"\"]"); - fchar = ","; - find += 1; - if ( find>=50) { - break; - } - } - } - if ( find > 0 ) { - Console.WriteLine("],"); - //constructor - Console.WriteLine("["); - Console.WriteLine("],"); - //methods - Console.WriteLine("["); - Console.WriteLine("],"); - // inner class - Console.WriteLine("["); - Console.WriteLine("],"); - Console.WriteLine("0"); - Console.WriteLine("]"); - return; - } - } - } - } - private static bool genModule(Module m) { - foreach ( string ns in nss) { - Type t = m.GetType(ns+ tn); - if ( t != null ) { - genType(t); - return true; - } - } - /* - Type[] infos = m.GetTypes(); - foreach ( Type t in infos) { - } - */ - return false; - } - private static void genType(Type t ) { - Console.WriteLine("["); - Console.WriteLine("\""+t.FullName+"\","); - string fchar = " " ; - // properties - PropertyInfo[] infos = t.GetProperties(); - Console.WriteLine("["); - foreach (PropertyInfo i in infos ) { - Console.WriteLine( fchar +"[\""+ i.Name + "\",\""+i.PropertyType+"\"]"); - fchar = ","; - } - Console.WriteLine("],"); - - //constructor - Console.WriteLine("["); - Console.WriteLine("],"); - // methods - Console.WriteLine("["); - fchar=" "; - MethodInfo[] methods = t.GetMethods(); - foreach ( MethodInfo m in methods ) { - Console.Write( fchar +"[\""+ m.Name + "\",\""+m.ReturnType+"\","); - ParameterInfo[] paras = m.GetParameters(); - string mchar=""; - foreach ( ParameterInfo pi in paras ) { - Console.Write(mchar+"\""+pi.ParameterType+ " " + pi.Name + "\""); - mchar=","; - } - Console.WriteLine(mchar+"[ ],0]"); - fchar=","; - } - Console.WriteLine("],"); - // inner class - Console.WriteLine("["); - Console.WriteLine("],"); - Console.WriteLine("0"); - Console.WriteLine("]"); - - /* - FieldInfo[] infos = t.GetFields(); - foreach ( FieldInfo i in infos ) { - Console.WriteLine(fchar + i.Name); - fchar = ","; - } - */ - /* - MemberInfo[] infos = t.GetMembers(); - foreach ( MemberInfo i in infos ) { - Console.WriteLine(fchar + i.Name); - fchar = ","; - } - */ - } - } -} - -// vim: ts=4 sws=4 diff --git a/home/.vim/syntax/hgannotate.vim b/home/.vim/syntax/hgannotate.vim index cee9a23..cee9a23 100755..100644 --- a/home/.vim/syntax/hgannotate.vim +++ b/home/.vim/syntax/hgannotate.vim diff --git a/home/.vim/syntax/perl.vim b/home/.vim/syntax/perl.vim deleted file mode 100644 index 840e33d..0000000 --- a/home/.vim/syntax/perl.vim +++ /dev/null @@ -1,536 +0,0 @@ -" Vim syntax file -" Language: Perl -" Maintainer: Lukas Mai <l.mai@web.de> -" Last Change: 2008-08-08 -" -" Standard perl syntax file for vim by Nick Hibma <nick@van-laarhoven.org> -" Modified by Lukas Mai -" -" Original version: Sonia Heimann <niania@netsurf.org> -" Thanks to many people for their contribution. - -" The following parameters are available for tuning the -" perl syntax highlighting, with defaults given: -" -" unlet perl_include_pod -" unlet perl_no_scope_in_variables -" unlet perl_no_extended_vars -" unlet perl_string_as_statement -" unlet perl_no_sync_on_sub -" unlet perl_no_sync_on_global_var -" let perl_sync_dist = 100 -" unlet perl_fold -" unlet perl_fold_blocks -" let perl_nofold_packages = 1 -" let perl_nofold_subs = 1 - -if version < 600 - echoerr ">=vim-6.0 is required to run perl-mauke.vim" - finish -elseif exists("b:current_syntax") - finish -endif - -" POD starts with ^=<word> and ends with ^=cut - -if exists("perl_include_pod") - " Include a while extra syntax file - syn include @Pod syntax/pod.vim - unlet b:current_syntax - if exists("perl_fold") - syn region perlPOD start="^=[a-z]" end="^=cut" contains=@Pod,@Spell,perlTodo keepend fold - syn region perlPOD start="^=cut" end="^=cut" contains=perlTodo keepend fold - else - syn region perlPOD start="^=[a-z]" end="^=cut" contains=@Pod,@Spell,perlTodo keepend - syn region perlPOD start="^=cut" end="^=cut" contains=perlTodo keepend - endif -else - " Use only the bare minimum of rules - if exists("perl_fold") - syn region perlPOD start="^=[a-z]" end="^=cut" fold - else - syn region perlPOD start="^=[a-z]" end="^=cut" - endif -endif - - -syn cluster perlTop contains=TOP -syn region perlGenericBlock matchgroup=perlGenericBlock start="{" end="}" contained transparent - - -" All keywords -" -syn match perlConditional "\<\%(if\|elsif\|unless\|given\|when\|default\)\>" -syn match perlConditional "\<else\>" nextgroup=perlElseIfError skipwhite skipnl skipempty -syn match perlRepeat "\<\%(while\|for\%(each\)\=\|do\|until\|continue\)\>" -syn match perlOperator "\<\%(defined\|undef\|eq\|ne\|[gl][et]\|cmp\|not\|and\|or\|xor\|not\|bless\|ref\|do\)\>" -syn match perlControl "\<\%(BEGIN\|CHECK\|INIT\|END\|UNITCHECK\)\>" - -syn match perlStatementStorage "\<\%(my\|our\|local\|state\)\>" -syn match perlStatementControl "\<\%(return\|last\|next\|redo\|goto\|break\)\>" -syn match perlStatementScalar "\<\%(chom\=p\|chr\|crypt\|r\=index\|lc\%(first\)\=\|length\|ord\|pack\|sprintf\|substr\|uc\%(first\)\=\)\>" -syn match perlStatementRegexp "\<\%(pos\|quotemeta\|split\|study\)\>" -syn match perlStatementNumeric "\<\%(abs\|atan2\|cos\|exp\|hex\|int\|log\|oct\|rand\|sin\|sqrt\|srand\)\>" -syn match perlStatementList "\<\%(splice\|unshift\|shift\|push\|pop\|join\|reverse\|grep\|map\|sort\|unpack\)\>" -syn match perlStatementHash "\<\%(delete\|each\|exists\|keys\|values\)\>" -syn match perlStatementIOfunc "\<\%(syscall\|dbmopen\|dbmclose\)\>" -syn match perlStatementFiledesc "\<\%(binmode\|close\%(dir\)\=\|eof\|fileno\|getc\|lstat\|printf\=\|read\%(dir\|line\|pipe\)\|rewinddir\|say\|select\|stat\|tell\%(dir\)\=\|write\)\>" nextgroup=perlFiledescStatementNocomma skipwhite -syn match perlStatementFiledesc "\<\%(fcntl\|flock\|ioctl\|open\%(dir\)\=\|read\|seek\%(dir\)\=\|sys\%(open\|read\|seek\|write\)\|truncate\)\>" nextgroup=perlFiledescStatementComma skipwhite -syn match perlStatementVector "\<vec\>" -syn match perlStatementFiles "\<\%(ch\%(dir\|mod\|own\|root\)\|glob\|link\|mkdir\|readlink\|rename\|rmdir\|symlink\|umask\|unlink\|utime\)\>" -syn match perlStatementFiles "-[rwxoRWXOezsfdlpSbctugkTBMAC]\>" -syn match perlStatementFlow "\<\%(caller\|die\|dump\|eval\|exit\|wantarray\)\>" -syn match perlStatementInclude "\<require\>" -syn match perlStatementInclude "\<\%(use\|no\)\s\+\%(\%(attributes\|attrs\|autouse\|base\|big\%(int\|num\|rat\)\|blib\|bytes\|charnames\|constant\|diagnostics\|encoding\%(::warnings\)\=\|feature\|fields\|filetest\|if\|integer\|less\|lib\|locale\|mro\|open\|ops\|overload\|re\|sigtrap\|sort\|strict\|subs\|threads\%(::shared\)\=\|utf8\|vars\|version\|vmsish\|warnings\%(::register\)\=\)\>\)\=" -syn match perlStatementProc "\<\%(alarm\|exec\|fork\|get\%(pgrp\|ppid\|priority\)\|kill\|pipe\|set\%(pgrp\|priority\)\|sleep\|system\|times\|wait\%(pid\)\=\)\>" -syn match perlStatementSocket "\<\%(acept\|bind\|connect\|get\%(peername\|sock\%(name\|opt\)\)\|listen\|recv\|send\|setsockopt\|shutdown\|socket\%(pair\)\=\)\>" -syn match perlStatementIPC "\<\%(msg\%(ctl\|get\|rcv\|snd\)\|sem\%(ctl\|get\|op\)\|shm\%(ctl\|get\|read\|write\)\)\>" -syn match perlStatementNetwork "\<\%(\%(end\|[gs]et\)\%(host\|net\|proto\|serv\)ent\|get\%(\%(host\|net\)by\%(addr\|name\)\|protoby\%(name\|number\)\|servby\%(name\|port\)\)\)\>" -syn match perlStatementPword "\<\%(get\%(pw\%(uid\|nam\)\|gr\%(gid\|nam\)\|login\)\)\|\%(end\|[gs]et\)\%(pw\|gr\)ent\>" -syn match perlStatementTime "\<\%(gmtime\|localtime\|time\)\>" - -syn match perlStatementMisc "\<\%(warn\|formline\|reset\|scalar\|prototype\|lock\|tied\=\|untie\)\>" - -syn keyword perlTodo TODO TBD FIXME XXX contained - -syn region perlStatementIndirObjWrap matchgroup=perlStatementIndirObj start="\<\%(map\|grep\|sort\|print\|system\|exec\)\>\s*{" end="}" contains=@perlTop,perlGenericBlock - -syn match perlLabel "^\s*\h\w*\s*::\@!\%(\<v\d\+\s*:\)\@<!" - -" Perl Identifiers. -" -" Should be cleaned up to better handle identifiers in particular situations -" (in hash keys for example) -" -" Plain identifiers: $foo, @foo, $#foo, %foo, &foo and dereferences $$foo, @$foo, etc. -" We do not process complex things such as @{${"foo"}}. Too complicated, and -" too slow. And what is after the -> is *not* considered as part of the -" variable - there again, too complicated and too slow. - -" Special variables first ($^A, ...) and ($|, $', ...) -syn match perlVarPlain "$^[ACDEFHILMNOPRSTVWX]\=" -syn match perlVarPlain "$[\\\"\[\]'&`+*.,;=%~!?@#$<>(-]" -syn match perlVarPlain "$\%(0\|[1-9]\d*\)" -" Same as above, but avoids confusion in $::foo (equivalent to $main::foo) -syn match perlVarPlain "$::\@!" -" These variables are not recognized within matches. -syn match perlVarNotInMatches "$[|)]" -" This variable is not recognized within matches delimited by m//. -syn match perlVarSlash "$/" - -" And plain identifiers -syn match perlPackageRef "[$@#%*&]\%(\%(::\|'\)\=\I\i*\%(\%(::\|'\)\I\i*\)*\)\=\%(::\|'\)\I"ms=s+1,me=e-1 contained - -" To not highlight packages in variables as a scope reference - i.e. in -" $pack::var, pack:: is a scope, just set "perl_no_scope_in_variables" -" If you don't want complex things like @{${"foo"}} to be processed, -" just set the variable "perl_no_extended_vars"... - -if !exists("perl_no_scope_in_variables") - syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod - syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef - syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod -else - syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod - syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" - syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod -endif - -if !exists("perl_no_extended_vars") - syn cluster perlExpr contains=perlStatementIndirObjWrap,perlStatementScalar,perlStatementRegexp,perlStatementNumeric,perlStatementList,perlStatementHash,perlStatementFiles,perlStatementTime,perlStatementMisc,perlVarPlain,perlVarPlain2,perlVarNotInMatches,perlVarSlash,perlVarBlock,perlVarBlock2,perlShellCommand,perlFloat,perlNumber,perlStringUnexpanded,perlString,perlQQ,perlArrow,perlGenericBlock - syn region perlArrow matchgroup=perlArrow start="->\s*(" end=")" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained - syn region perlArrow matchgroup=perlArrow start="->\s*\[" end="\]" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained - syn region perlArrow matchgroup=perlArrow start="->\s*{" end="}" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained - syn match perlArrow "->\s*{\s*\I\i*\s*}" contains=perlVarSimpleMemberName nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained - syn region perlArrow matchgroup=perlArrow start="->\s*\$*\I\i*\s*(" end=")" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained - syn region perlVarBlock matchgroup=perlVarPlain start="\%($#\|[$@]\)\$*{" skip="\\}" end="}" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod - syn region perlVarBlock2 matchgroup=perlVarPlain start="[%&*]\$*{" skip="\\}" end="}" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod - syn match perlVarPlain2 "[%&*]\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod - syn match perlVarPlain "\%(\$#\|[@$]\)\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod - syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\={" skip="\\}" end="}" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod - syn match perlVarSimpleMember "\%(->\)\={\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contains=perlVarSimpleMemberName contained - syn match perlVarSimpleMemberName "\I\i*" contained - syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\=\[" skip="\\]" end="]" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod - syn match perlMethod "->\$*\I\i*" contained nextgroup=perlVarSimpleMember,perlVarMember,perlMethod -endif - -" File Descriptors -syn match perlFiledescRead "<\h\w*>" - -syn match perlFiledescStatementComma "(\=\s*\u\w*\s*,"me=e-1 transparent contained contains=perlFiledescStatement -syn match perlFiledescStatementNocomma "(\=\s*\u\w*\s*[^, \t]"me=e-1 transparent contained contains=perlFiledescStatement - -syn match perlFiledescStatement "\u\w*" contained - -" Special characters in strings and matches -syn match perlSpecialString "\\\%(\o\{1,3}\|x\%({\x\+}\|\x\{1,2}\)\|c.\|[^cx]\)" contained extend -syn match perlSpecialStringU2 "\\." extend contained transparent contains=NONE -syn match perlSpecialStringU "\\\\" contained -syn match perlSpecialMatch "\\[1-9]" contained extend -syn match perlSpecialMatch "\\g\%(\d\+\|{\%(-\=\d\+\|\h\w*\)}\)" contained -syn match perlSpecialMatch "\\k\%(<\h\w*>\|'\h\w*'\)" contained -syn match perlSpecialMatch "{\d\+\%(,\%(\d\+\)\=\)\=}" contained -syn match perlSpecialMatch "\[[]-]\=[^\[\]]*[]-]\=\]" contained -syn match perlSpecialMatch "[+*()?.]" contained -syn match perlSpecialMatch "(?[#:=!]" contained -syn match perlSpecialMatch "(?[impsx]*\%(-[imsx]\+\)\=)" contained -syn match perlSpecialMatch "(?\%([-+]\=\d\+\|R\))" contained -syn match perlSpecialMatch "(?\%(&\|P[>=]\)\h\w*)" contained -syn match perlSpecialMatch "(\*\%(\%(PRUNE\|SKIP\|THEN\)\%(:[^)]*\)\=\|\%(MARK\|\):[^)]*\|COMMIT\|F\%(AIL\)\=\|ACCEPT\))" contained - -" Possible errors -" -" Highlight lines with only whitespace (only in blank delimited here documents) as errors -syn match perlNotEmptyLine "^\s\+$" contained -" Highlight '} else if (...) {', it should be '} else { if (...) { ' or -" '} elsif (...) {'. -syn match perlElseIfError "[^[:space:]{]\+" contained - -" Variable interpolation -" -" These items are interpolated inside "" strings and similar constructs. -syn cluster perlInterpDQ contains=perlSpecialString,perlVarPlain,perlVarNotInMatches,perlVarSlash,perlVarBlock -" These items are interpolated inside '' strings and similar constructs. -syn cluster perlInterpSQ contains=perlSpecialStringU,perlSpecialStringU2 -" These items are interpolated inside m// matches and s/// substitutions. -syn cluster perlInterpSlash contains=perlSpecialString,perlSpecialMatch,perlVarPlain,perlVarBlock -" These items are interpolated inside m## matches and s### substitutions. -syn cluster perlInterpMatch contains=@perlInterpSlash,perlVarSlash - -" Shell commands -syn region perlShellCommand matchgroup=perlMatchStartEnd start="`" end="`" contains=@perlInterpDQ keepend - -" Constants -" -" Numbers -syn match perlNumber "\<\%(0\%(x\x[[:xdigit:]_]*\|b[01][01_]*\|\o[0-7_]*\|\)\|[1-9][[:digit:]_]*\)\>" -syn match perlFloat "\<\d[[:digit:]_]*[eE][\-+]\=\d\+" -syn match perlFloat "\<\d[[:digit:]_]*\.[[:digit:]_]*\%([eE][\-+]\=\d\+\)\=" -syn match perlFloat "\.[[:digit:]_]\+\%([eE][\-+]\=\d\+\)\=" - -syn match perlString "\<\%(v\d\+\%(\.\d\+\)*\|\d\+\%(\.\d\+\)\{2,}\)\>" contains=perlVStringV -syn match perlVStringV "\<v" contained - - -syn region perlParensSQ start=+(+ end=+)+ extend contained transparent contains=perlParensSQ,@perlInterpSQ keepend -syn region perlBracketsSQ start=+\[+ end=+\]+ extend contained transparent contains=perlBracketsSQ,@perlInterpSQ keepend -syn region perlBracesSQ start=+{+ end=+}+ extend contained transparent contains=perlBracesSQ,@perlInterpSQ keepend -syn region perlAnglesSQ start=+<+ end=+>+ extend contained transparent contains=perlAnglesSQ,@perlInterpSQ keepend - -syn region perlParensDQ start=+(+ end=+)+ extend contained transparent contains=perlParensDQ,@perlInterpDQ keepend -syn region perlBracketsDQ start=+\[+ end=+\]+ extend contained transparent contains=perlBracketsDQ,@perlInterpDQ keepend -syn region perlBracesDQ start=+{+ end=+}+ extend contained transparent contains=perlBracesDQ,@perlInterpDQ keepend -syn region perlAnglesDQ start=+<+ end=+>+ extend contained transparent contains=perlAnglesDQ,@perlInterpDQ keepend - - -" Simple version of searches and matches -syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\>\s*\z([^[:space:]'([{<#]\)+ end=+\z1[cgimopsx]*+ contains=@perlInterpMatch keepend -syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m#+ end=+#[cgimopsx]*+ contains=@perlInterpMatch keepend -syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*'+ end=+'[cgimopsx]*+ contains=@perlInterpSQ keepend -syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*/+ end=+/[cgimopsx]*+ contains=@perlInterpSlash keepend -syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*(+ end=+)[cgimopsx]*+ contains=@perlInterpMatch,perlParensDQ keepend - -" A special case for m{}, m<> and m[] which allows for comments and extra whitespace in the pattern -syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*{+ end=+}[cgimopsx]*+ contains=@perlInterpMatch,perlComment,perlBracesDQ keepend -syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*<+ end=+>[cgimopsx]*+ contains=@perlInterpMatch,perlAnglesDQ keepend -syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*\[+ end=+\][cgimopsx]*+ contains=@perlInterpMatch,perlComment,perlBracketsDQ keepend - -" Below some hacks to recognise the // variant. This is virtually impossible to catch in all -" cases as the / is used in so many other ways, but these should be the most obvious ones. -syn region perlMatch matchgroup=perlMatchStartEnd start="\%([$@%&*]\@<!\%(\<split\|\<while\|\<if\|\<unless\|\.\.\|[-+*!~(\[{=]\)\s*\)\@<=/" start=+^/+ start=+\s\@<=/[^[:space:][:digit:]$@%=]\@=\%(/\_s*\%([([{$@%&*[:digit:]"'`]\|\_s\w\|[[:upper:]_abd-fhjklnqrt-wyz]\)\)\@!+ skip=+\\/+ end=+/[cgimopsx]*+ contains=@perlInterpSlash - - -" Substitutions -" perlMatch is the first part, perlSubstitution* is the substitution part -syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\>\s*\z([^[:space:]'([{<#]\)+ end=+\z1+me=e-1 contains=@perlInterpMatch nextgroup=perlSubstitutionGQQ keepend -syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*'+ end=+'+me=e-1 contains=@perlInterpSQ nextgroup=perlSubstitutionSQ keepend -syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*/+ end=+/+me=e-1 contains=@perlInterpSlash nextgroup=perlSubstitutionGQQ keepend -syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s#+ end=+#+me=e-1 contains=@perlInterpMatch nextgroup=perlSubstitutionGQQ keepend -syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*(+ end=+)+ contains=@perlInterpMatch,perlParensDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend -syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*<+ end=+>+ contains=@perlInterpMatch,perlAnglesDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend -syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*\[+ end=+\]+ contains=@perlInterpMatch,perlBracketsDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend -syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*{+ end=+}+ contains=@perlInterpMatch,perlBracesDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend -syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\z([^[:space:]'([{<]\)+ end=+\z1[ecgimopsx]*+ keepend contained contains=@perlInterpDQ -syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+(+ end=+)[ecgimopsx]*+ contained contains=@perlInterpDQ,perlParensDQ keepend -syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\[+ end=+\][ecgimopsx]*+ contained contains=@perlInterpDQ,perlBracketsDQ keepend -syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+{+ end=+}[ecgimopsx]*+ contained contains=@perlInterpDQ,perlBracesDQ keepend -syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+<+ end=+>[ecgimopsx]*+ contained contains=@perlInterpDQ,perlAnglesDQ keepend -syn region perlSubstitutionSQ matchgroup=perlMatchStartEnd start=+'+ end=+'[ecgimopsx]*+ contained contains=@perlInterpSQ keepend - -" Translations -" perlMatch is the first part, perlTranslation* is the second, translator part. -syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!\%(tr\|y\)\>\s*\z([^[:space:]([{<#]\)+ end=+\z1+me=e-1 contains=@perlInterpSQ nextgroup=perlTranslationGQ -syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!\%(tr\|y\)#+ end=+#+me=e-1 contains=@perlInterpSQ nextgroup=perlTranslationGQ -syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!\%(tr\|y\)\s*\[+ end=+\]+ contains=@perlInterpSQ,perlBracketsSQ nextgroup=perlTranslationGQ skipwhite skipempty skipnl -syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!\%(tr\|y\)\s*(+ end=+)+ contains=@perlInterpSQ,perlParensSQ nextgroup=perlTranslationGQ skipwhite skipempty skipnl -syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!\%(tr\|y\)\s*<+ end=+>+ contains=@perlInterpSQ,perlAnglesSQ nextgroup=perlTranslationGQ skipwhite skipempty skipnl -syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!\%(tr\|y\)\s*{+ end=+}+ contains=@perlInterpSQ,perlBracesSQ nextgroup=perlTranslationGQ skipwhite skipempty skipnl -syn region perlTranslationGQ matchgroup=perlMatchStartEnd start=+\z([^[:space:]([{<]\)+ end=+\z1[cds]*+ contained -syn region perlTranslationGQ matchgroup=perlMatchStartEnd start=+(+ end=+)[cds]*+ contains=perlParensSQ contained -syn region perlTranslationGQ matchgroup=perlMatchStartEnd start=+\[+ end=+\][cds]*+ contains=perlBracketsSQ contained -syn region perlTranslationGQ matchgroup=perlMatchStartEnd start=+{+ end=+}[cds]*+ contains=perlBracesSQ contained -syn region perlTranslationGQ matchgroup=perlMatchStartEnd start=+<+ end=+>[cds]*+ contains=perlAnglesSQ contained - - -" Strings and q, qq, qw and qr expressions - -syn region perlStringUnexpanded matchgroup=perlStringStartEnd start="'" end="'" contains=@perlInterpSQ keepend -syn region perlString matchgroup=perlStringStartEnd start=+"+ end=+"+ contains=@perlInterpDQ keepend -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q\>\s*\z([^[:space:]#([{<]\)+ end=+\z1+ contains=@perlInterpSQ keepend -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q#+ end=+#+ contains=@perlInterpSQ keepend -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q\s*(+ end=+)+ contains=@perlInterpSQ,perlParensSQ keepend -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q\s*\[+ end=+\]+ contains=@perlInterpSQ,perlBracketsSQ keepend -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q\s*{+ end=+}+ contains=@perlInterpSQ,perlBracesSQ keepend -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q\s*<+ end=+>+ contains=@perlInterpSQ,perlAnglesSQ keepend - -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q[qx]\>\s*\z([^[:space:]#([{<]\)+ end=+\z1+ contains=@perlInterpDQ keepend -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q[qx]#+ end=+#+ contains=@perlInterpDQ keepend -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q[qx]\s*(+ end=+)+ contains=@perlInterpDQ,perlParensDQ keepend -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q[qx]\s*\[+ end=+\]+ contains=@perlInterpDQ,perlBracketsDQ keepend -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q[qx]\s*{+ end=+}+ contains=@perlInterpDQ,perlBracesDQ keepend -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q[qx]\s*<+ end=+>+ contains=@perlInterpDQ,perlAnglesDQ keepend - -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*\z([^[:space:]#([{<]\)+ end=+\z1+ contains=@perlInterpSQ keepend -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw#+ end=+#+ contains=@perlInterpSQ keepend -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*(+ end=+)+ contains=@perlInterpSQ,perlParensSQ keepend -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*\[+ end=+\]+ contains=@perlInterpSQ,perlBracketsSQ keepend -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*{+ end=+}+ contains=@perlInterpSQ,perlBracesSQ keepend -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*<+ end=+>+ contains=@perlInterpSQ,perlAnglesSQ keepend - -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\>\s*\z([^[:space:]#([{<'/]\)+ end=+\z1[imosx]*+ contains=@perlInterpMatch keepend -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*/+ end=+/[imosx]*+ contains=@perlInterpSlash keepend -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr#+ end=+#[imosx]*+ contains=@perlInterpMatch keepend -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*'+ end=+'[imosx]*+ contains=@perlInterpSQ keepend -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*(+ end=+)[imosx]*+ contains=@perlInterpMatch,perlParensDQ keepend - -" A special case for qr{}, qr<> and qr[] which allows for comments and extra whitespace in the pattern -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*{+ end=+}[imosx]*+ contains=@perlInterpMatch,perlBracesDQ,perlComment keepend -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*<+ end=+>[imosx]*+ contains=@perlInterpMatch,perlAnglesDQ,perlComment keepend -syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*\[+ end=+\][imosx]*+ contains=@perlInterpMatch,perlBracketsDQ,perlComment keepend - -" Constructs such as print <<EOF [...] EOF, 'here' documents -" -" XXX Any statements after the identifier are in perlString colour (i.e. -" 'if $a' in 'print <<EOF if $a'). This is almost impossible to get right it -" seems due to the 'auto-extending nature' of regions. -if exists("perl_fold") - syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\z(\I\i*\).*+ end=+^\z1$+ contains=@perlInterpDQ fold - syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ end=+^\z1$+ contains=@perlInterpDQ fold - syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ end=+^\z1$+ contains=@perlInterpSQ fold - syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*""+ end=+^$+ contains=@perlInterpDQ,perlNotEmptyLine fold - syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*''+ end=+^$+ contains=@perlInterpSQ,perlNotEmptyLine fold - syn region perlAutoload matchgroup=perlStringStartEnd start=+<<\s*\(['"]\=\)\z(END_\%(SUB\|OF_FUNC\|OF_AUTOLOAD\)\)\1+ end=+^\z1$+ contains=ALL fold -else - syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\z(\I\i*\)+ end=+^\z1$+ contains=@perlInterpDQ - syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ end=+^\z1$+ contains=@perlInterpDQ - syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ end=+^\z1$+ contains=@perlInterpSQ - syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*""+ end=+^$+ contains=@perlInterpDQ,perlNotEmptyLine - syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*''+ end=+^$+ contains=@perlInterpSQ,perlNotEmptyLine - syn region perlAutoload matchgroup=perlStringStartEnd start=+<<\s*\(['"]\=\)\z(END_\%(SUB\|OF_FUNC\|OF_AUTOLOAD\)\)\1+ end=+^\z1$+ contains=ALL -endif - - -" Class declarations -" -syn match perlPackageDecl "\<package\s\+\%(\h\|::\)\%(\w\|::\)*" contains=perlStatementPackage -syn keyword perlStatementPackage package contained - -" Functions -" -syn match perlSubError "[^[:space:];{#]" contained -if v:version == 701 && !has('patch221') " XXX I hope that's the right one - syn match perlSubAttributes ":" contained -else - syn match perlSubAttributesCont "\h\w*\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained - syn region perlSubAttributesCont matchgroup=perlSubAttributesCont start="\h\w*(" end=")\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained contains=@perlInterpSQ,perlParensSQ - syn cluster perlSubAttrMaybe contains=perlSubAttributesCont,perlSubError - syn match perlSubAttributes "" contained nextgroup=perlSubError - syn match perlSubAttributes ":\_s*" contained nextgroup=@perlSubAttrMaybe -endif -syn match perlSubPrototypeError "(\%(\_s*\%(\%(\\\%([$@%&*]\|\[[$@%&*]\+\]\)\|[$&*]\|[@%]\%(\_s*)\)\@=\|;\%(\_s*[)$@%&*\\]\)\@=\|_\%(\_s*[);]\)\@=\)\_s*\)*\)\@>\zs\_[^)]\+" contained -syn match perlSubPrototype +(\_[^)]*)\_s*\|+ nextgroup=perlSubAttributes contained contains=perlSubPrototypeError -syn match perlSubName +\%(\h\|::\|'\w\)\%(\w\|::\|'\w\)*\_s*\|+ contained nextgroup=perlSubPrototype - -syn match perlFunction +\<sub\>\_s*+ nextgroup=perlSubName - -if !exists("perl_no_scope_in_variables") - syn match perlFunctionPRef "\h\w*::" contained - syn match perlFunctionName "\h\w*[^:]" contained -else - syn match perlFunctionName "\h[[:alnum:]_:]*" contained -endif - -" The => operator forces a bareword to the left of it to be interpreted as -" a string -syn match perlString "\<\I\i*\%(\s*=>\)\@=" - -" All other # are comments, except ^#! -syn match perlComment "#.*" contains=perlTodo -syn match perlSharpBang "^#!.*" - -" Formats -syn region perlFormat matchgroup=perlStatementIOFunc start="^\s*\<format\s\+\k\+\s*=\s*$"rs=s+6 end="^\s*\.\s*$" contains=perlFormatName,perlFormatField,perlVarPlain,perlVarPlain2 -syn match perlFormatName "format\s\+\k\+\s*="lc=7,me=e-1 contained -syn match perlFormatField "[@^][|<>~]\+\%(\.\.\.\)\=" contained -syn match perlFormatField "[@^]#[#.]*" contained -syn match perlFormatField "@\*" contained -syn match perlFormatField "@[^A-Za-z_|<>~#*]"me=e-1 contained -syn match perlFormatField "@$" contained - -" __END__ and __DATA__ clauses -if exists("perl_fold") - syntax region perlDATA start="^__\%(DATA\|END\)__$" skip="." end="." contains=perlPOD,@perlDATA fold -else - syntax region perlDATA start="^__\%(DATA\|END\)__$" skip="." end="." contains=perlPOD,@perlDATA -endif - - -" -" Folding - -if exists("perl_fold") - if !exists("perl_nofold_packages") - syn region perlPackageFold start="^package \S\+;\s*\%(#.*\)\=$" end="^1;\=\s*\%(#.*\)\=$" end="\n\+package"me=s-1 transparent fold keepend - endif - if !exists("perl_nofold_subs") - syn region perlSubFold start="^\z(\s*\)\<sub\>.*[^};]$" end="^\z1}\s*\%(#.*\)\=$" transparent fold keepend - syn region perlSubFold start="^\z(\s*\)\<\%(BEGIN\|END\|CHECK\|INIT\|UNITCHECK\)\>.*[^};]$" end="^\z1}\s*$" transparent fold keepend - endif - - if exists("perl_fold_blocks") - syn region perlBlockFold start="^\z(\s*\)\%(if\|elsif\|unless\|for\|while\|until\|given\)\s*(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" start="^\z(\s*\)foreach\s*\%(\%(my\|our\)\=\s*\S\+\s*\)\=(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend - syn region perlBlockFold start="^\z(\s*\)\%(do\|else\)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*while" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend - endif - - setlocal foldmethod=syntax - syn sync fromstart -else - " fromstart above seems to set minlines even if perl_fold is not set. - syn sync minlines=0 -endif - - -command -nargs=+ HiLink hi def link <args> - -" The default highlighting. -HiLink perlSharpBang PreProc -HiLink perlControl PreProc -HiLink perlInclude Include -HiLink perlSpecial Special -HiLink perlString String -HiLink perlCharacter Character -HiLink perlNumber Number -HiLink perlFloat Float -HiLink perlType Type -HiLink perlIdentifier Identifier -HiLink perlLabel Label -HiLink perlStatement Statement -HiLink perlConditional Conditional -HiLink perlRepeat Repeat -HiLink perlOperator Operator -HiLink perlFunction Keyword -HiLink perlSubName Function -HiLink perlSubPrototype Type -HiLink perlSubAttributes PreProc -HiLink perlSubAttributesCont perlSubAttributes -HiLink perlComment Comment -HiLink perlTodo Todo -if exists("perl_string_as_statement") - HiLink perlStringStartEnd perlStatement -else - HiLink perlStringStartEnd perlString -endif -HiLink perlVStringV perlStringStartEnd -HiLink perlList perlStatement -HiLink perlMisc perlStatement -HiLink perlVarPlain perlIdentifier -HiLink perlVarPlain2 perlIdentifier -HiLink perlArrow perlIdentifier -HiLink perlFiledescRead perlIdentifier -HiLink perlFiledescStatement perlIdentifier -HiLink perlVarSimpleMember perlIdentifier -HiLink perlVarSimpleMemberName perlString -HiLink perlVarNotInMatches perlIdentifier -HiLink perlVarSlash perlIdentifier -HiLink perlQQ perlString -HiLink perlHereDoc perlString -HiLink perlStringUnexpanded perlString -HiLink perlSubstitutionSQ perlString -HiLink perlSubstitutionGQQ perlString -HiLink perlTranslationGQ perlString -HiLink perlMatch perlString -HiLink perlMatchStartEnd perlStatement -HiLink perlFormatName perlIdentifier -HiLink perlFormatField perlString -HiLink perlPackageDecl perlType -HiLink perlStorageClass perlType -HiLink perlPackageRef perlType -HiLink perlStatementPackage perlStatement -HiLink perlStatementStorage perlStatement -HiLink perlStatementControl perlStatement -HiLink perlStatementScalar perlStatement -HiLink perlStatementRegexp perlStatement -HiLink perlStatementNumeric perlStatement -HiLink perlStatementList perlStatement -HiLink perlStatementHash perlStatement -HiLink perlStatementIOfunc perlStatement -HiLink perlStatementFiledesc perlStatement -HiLink perlStatementVector perlStatement -HiLink perlStatementFiles perlStatement -HiLink perlStatementFlow perlStatement -HiLink perlStatementInclude perlStatement -HiLink perlStatementProc perlStatement -HiLink perlStatementSocket perlStatement -HiLink perlStatementIPC perlStatement -HiLink perlStatementNetwork perlStatement -HiLink perlStatementPword perlStatement -HiLink perlStatementTime perlStatement -HiLink perlStatementMisc perlStatement -HiLink perlStatementIndirObj perlStatement -HiLink perlFunctionName perlIdentifier -HiLink perlMethod perlIdentifier -HiLink perlFunctionPRef perlType -HiLink perlPOD perlComment -HiLink perlShellCommand perlString -HiLink perlSpecialAscii perlSpecial -HiLink perlSpecialDollar perlSpecial -HiLink perlSpecialString perlSpecial -HiLink perlSpecialStringU perlSpecial -HiLink perlSpecialMatch perlSpecial -HiLink perlDATA perlComment - -" Possible errors -HiLink perlNotEmptyLine Error -HiLink perlElseIfError Error -HiLink perlSubPrototypeError Error -HiLink perlSubError Error - -delcommand HiLink - -" Syncing to speed up processing -" -if !exists("perl_no_sync_on_sub") - syn sync match perlSync grouphere NONE "^\s*\<package\s" - syn sync match perlSync grouphere NONE "^\s*\<sub\>" - syn sync match perlSync grouphere NONE "^}" -endif - -if !exists("perl_no_sync_on_global_var") - syn sync match perlSync grouphere NONE "^$\I[[:alnum:]_:]+\s*=\s*{" - syn sync match perlSync grouphere NONE "^[@%]\I[[:alnum:]_:]+\s*=\s*(" -endif - -if exists("perl_sync_dist") - execute "syn sync maxlines=" . perl_sync_dist -else - syn sync maxlines=100 -endif - -syn sync match perlSyncPOD grouphere perlPOD "^=pod" -syn sync match perlSyncPOD grouphere perlPOD "^=head" -syn sync match perlSyncPOD grouphere perlPOD "^=item" -syn sync match perlSyncPOD grouphere NONE "^=cut" - -let b:current_syntax = "perl" - -" vim: ts=8 diff --git a/home/.vim/syntax/prolog.vim b/home/.vim/syntax/prolog.vim deleted file mode 100644 index ce86d25..0000000 --- a/home/.vim/syntax/prolog.vim +++ /dev/null @@ -1,155 +0,0 @@ -" Vim Syntax File -" -" Language: Prolog -" Maintainers: Aleksandar Dimitrov <aleks.dimitrov@googlemail.com> -" Created: Jul 31st, 2008 -" Changed: Fri Aug 1 2008 -" Remark: This file mostly follows -" http://www.sics.se/sicstus/docs/3.7.1/html/sicstus_45.html -" but also features some SWI-specific enhancements. -" The BNF cannot be followed strictly, but I tried to do my best. -" -" TODO: - Difference Lists -" - Constraint logic programming - -if version < 600 - syn clear -elseif exists("b:current_syntax") - finish -endif - -syntax case match - -syntax keyword prologISOBuiltIn var nonvar integer float number atom string - \atomic compound unify_with_occurs_check fail false true repeat call once - \catch throw abolish retract asserta assertz current_predicate clause open - \close stream_property set_stream_position set_input set_output current_ouput - \nl put_byte put_char put_code flush_output get_byte get_code get_char - \peek_byte peek_code peek_char at_end_of_stream write_term write_canonical - \write writeq read read_term functor arg copy_term atom_codes atom_chars - \char_code number_chars number_codes atom_length sub_atom op current_op - \char_conversion current_char_conversion is mod rem div round float - \float_fractional_part float_integer_part truncate floor ceiling sqrt sin cos - \atan log findall bagof setof sub_atom - -syntax keyword prologSWIBuiltIn rational callable ground cyclic_term subsumes subsumes_chk - \unifiable use_module compare apply not ignore call_with_depth_limit call_cleanup - \print_message print_message_lines message_hook on_signal current_signal block exit - \term_hash redefine_system_predicate retractall assert recorda recordz recorded - \erase flag compile_predicates index current_atom - \current_blob current_functor current_flag current_key dwim_predicate nth_clause - \predicate_property open_null_stream current_stream is_stream stream_position_data - \seek set_stream see tell append seeing telling seen set_prolog_IO told - \wait_for_input byte_count character_count line_count line_position read_clause - \put tab ttyflush get0 get skip get_single_char copy_stream_data print portray - \read_history prompt setarg nb_setarg nb_linkarg duplicate_term numbervars - \term_variables atom_number name term_to_atom atom_to_term atom_concat - \concat_atom atom_prefix normalize_space collation_key char_type string_to_list - \code_type downcase_atom upcase_atom collation_key locale_sort string_to_atom - \string_length string_concat sub_string between succ plus rdiv max min random - \integer rationalize ceil xor tan asin acos pi e cputime eval msb lsb popcount - \powm arithmetic_function current_arithmetic_function is_list memberchk length - \sort msort keysort predsort merge merge_set maplist forall writeln writef - \swritef format format_predicate current_format_predicate tty_get_capability - \tty_goto tty_put set_tty tty_size shell win_exec win_shell win_folder - \win_registry_get_value getenv setenv unsetenv setlocale unix date time - \get_time stamp_date_time date_time_stamp date_time_value format_time - \parse_time window_title win_window_pos win_has_menu win_insert_menu - \win_insert_menu_item access_file exists_file file_directory_name file_base_name - \same_file exists_directory delete_file rename_file size_file time_file - \absolute_file_name is_absolute_file_name file_name_extension expand_file_name - \prolog_to_os_filename read_link tmp_file make_directory working_directory chdir - \garbage_collect garbage_collect_atoms trim_stacks stack_parameter dwim_match - \wildcard_match sleep qcompile portray_clause acyclic_term clause_property - \setup_and_call_cleanup message_to_string phrase hash with_output_to fileerrors - \read_pending_input prompt1 same_term sub_string merge_set - -syntax cluster prologBuiltIn contains=prologSWIBuiltIn,prologISOBuiltIn - -syntax match prologArithmetic /\*\*\?\|+\|\/\/\?\|\/\\\|<<\|>>\|\\\/\?\|\^/ - \contained containedin=prologBody - -syntax match prologRelations /=\.\.\|!\|=:=\|=\?<\|=@=\|=\\=\|>=\?\|@=\?<\|@>=\?\|\\+\|\\\?=\?=\|\\\?=@=\|=/ - \contained containedin=prologBody - -syntax region prologCComment fold start=/\/\*/ end=/\*\// contains=prologTODO,@Spell -syntax match prologComment /%.*/ contains=prologTODO,@Spell -syntax keyword prologTODO FIXME TODO fixme todo Fixme FixMe Todo ToDo XXX xxx contained -syntax cluster prologComments contains=prologCComment,prologComment - -syntax region prologBody fold start=/\(:-\|?-\)/ end=/\./ - \contains=@prologAll,prologPredicateWithArity -syntax region prologDCGBody fold start=/-->/ end=/\./ - \contains=@prologAll,prologDCGSpecials - -syntax match prologNumber /\<\d\+\>/ contained -syntax match prologNumber /\<\d\+\.\d\+\>/ contained -syntax match prologAtom /\<\l\w*\>\ze\([^(]\|$\)/ contained -syntax match prologVariable /\<\(_\|\u\)\w*\>/ contained - -syntax match prologHead /\<\l\w*\>/ nextgroup=prologBody,prologDCGBody skipwhite -syntax region prologHeadWithArgs start=/\<\l\w*\>(/ end=/)/ nextgroup=prologBody,prologDCGBody contains=@prologAll - -syntax match prologOpStatement /indexed\|discontiguous\|dynamic\|module_transparent\|multifile\|volatile\|initialization/ - \containedin=prologBody contained - -syntax region prologDCGSpecials start=/{/ end=/}/ contained contains=@prologAll - -syntax region prologTuple fold start=/\W\zs(/ end=/)/ contained containedin=prologPredicate,prologBody contains=@prologAll -syntax region prologPredicate start=/\<\l\w*\>\ze(/ end=/)/ contains=@prologAll -syntax match prologPredicateWithArity /\<\l\w*\>\/\d\+/ contains=@prologBuiltIn,prologArity -syntax match prologArity contained /\/\d\+/ -syntax cluster prologPredicates contains=prologPredicate,prologPredicateWithArity - -syntax region prologList start=/\[/ end=/\]/ contains=prologListDelimiters,@prologAll,prologPredicateWithArity contained -syntax match prologListDelimiters /[,|]/ contained - -syntax cluster prologAll contains=prologList,prologPredicate,prologTuple,@prologTerms,@prologComments,prologQuoted,@prologBuiltIn,prologRelations,prologArithmetic,prologDiffList -syntax cluster prologTerms contains=prologVariable,prologAtom,prologList, - \prologNumber,prologErrorTerm - -syntax match prologQuotedFormat /\~\(\d*[acd\~DeEgfGiknNpqrR@st\|+wW]\|`.t\)/ contained -syntax region prologQuoted start=/'/ end=/'/ contains=prologQuotedFormat,@Spell - -syntax match prologErrorVariable /\<\(_\|\u\)\w*\>/ -syntax region prologErrorTerm start=/\<\(_\|\u\)\w*\>(/ end=/)/ - -"""" Highlights - -highlight link prologErrorVariable Error -highlight link prologErrorTerm Error - -highlight link prologOpStatement Preproc -highlight link prologComment Comment -highlight link prologCComment Comment -highlight link prologTODO TODO - -highlight link prologAtom Constant -highlight link prologVariable Identifier -highlight link prologNumber Number - -highlight link prologISOBuiltIn Keyword -highlight link prologSWIBuiltIn Keyword - -highlight link prologRelations Statement - -highlight link prologQuotedFormat Special -highlight link prologQuoted String - -highlight link prologPredicate Normal -highlight link prologPredicateWithArity Normal -highlight link prologHead Constant -highlight link prologHeadWithArgs Normal - -highlight link prologBody Statement -highlight link prologDCGBody Statement - -highlight link prologList Type -highlight link prologArity Type -highlight link prologDCGSpecials Type -highlight link prologTuple Type -highlight link prologDiffList Type - -syn sync minlines=20 maxlines=50 - -let b:current_syntax = "prolog" diff --git a/home/.vim/syntax/python.vim b/home/.vim/syntax/python.vim deleted file mode 100644 index d841fa0..0000000 --- a/home/.vim/syntax/python.vim +++ /dev/null @@ -1,195 +0,0 @@ -" Vim syntax file -" Language: Python -" Maintainer: Samuel Hoffstaetter <samuel@hoffstaetter.com> -" Updated: 2006-10-15 -" Added Python 2.4 features 2006 May 4 (Dmitry Vasiliev) -" -" Derived from python.vim by Neil Schemenauer <nas@python.ca> -" -" Options to control Python syntax highlighting: -" -" For highlighted numbers: -" -" let python_highlight_numbers = 1 -" -" For highlighted builtin functions: -" -" let python_highlight_builtins = 1 -" -" For highlighted standard exceptions: -" -" let python_highlight_exceptions = 1 -" -" Highlight erroneous whitespace: -" -" let python_highlight_space_errors = 1 -" -" If you want all possible Python highlighting (the same as setting the -" preceding options): -" -" let python_highlight_all = 1 -" - -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") - finish -endif - -setlocal foldmethod=syntax - -syn keyword pythonStatement break continue del -syn keyword pythonStatement except exec finally -syn keyword pythonStatement pass print raise -syn keyword pythonStatement return try with -syn keyword pythonStatement global assert -syn keyword pythonStatement lambda yield - -syn match pythonDefStatement /^\s*\%(def\|class\)/ - \ nextgroup=pythonFunction skipwhite -syn region pythonFunctionFold start="^\z(\s*\)\%(def\|class\)\>" - \ end="\ze\%(\s*\n\)\+\%(\z1\s\)\@!." fold transparent -syn match pythonFunction "[a-zA-Z_][a-zA-Z0-9_]*" contained - -syn match pythonComment /#\%(.\%({{{\|}}}\)\@!\)*$/ - \ contains=pythonTodo,@Spell -syn region pythonFold matchgroup=pythonComment - \ start='#.*{{{.*$' end='#.*}}}.*$' fold transparent - -syn keyword pythonRepeat for while -syn keyword pythonConditional if elif else -syn keyword pythonOperator and in is not or -" AS will be a keyword in Python 3 -syn keyword pythonPreCondit import from as -syn keyword pythonTodo TODO FIXME XXX contained - -" Decorators (new in Python 2.4) -syn match pythonDecorator "@" display nextgroup=pythonFunction skipwhite - -" strings -syn region pythonString start=+[uU]\='+ end=+'+ skip=+\\\\\|\\'+ contains=pythonEscape,@Spell -syn region pythonString start=+[uU]\="+ end=+"+ skip=+\\\\\|\\"+ contains=pythonEscape,@Spell -syn region pythonString start=+[uU]\="""+ end=+"""+ contains=pythonEscape,@Spell -syn region pythonString start=+[uU]\='''+ end=+'''+ contains=pythonEscape,@Spell -syn region pythonRawString start=+[uU]\=[rR]'+ end=+'+ skip=+\\\\\|\\'+ contains=@Spell -syn region pythonRawString start=+[uU]\=[rR]"+ end=+"+ skip=+\\\\\|\\"+ contains=@Spell -syn region pythonRawString start=+[uU]\=[rR]"""+ end=+"""+ contains=@Spell -syn region pythonRawString start=+[uU]\=[rR]'''+ end=+'''+ contains=@Spell -syn match pythonEscape +\\[abfnrtv'"\\]+ contained -syn match pythonEscape "\\\o\{1,3}" contained -syn match pythonEscape "\\x\x\{2}" contained -syn match pythonEscape "\(\\u\x\{4}\|\\U\x\{8}\)" contained -syn match pythonEscape "\\$" - -if exists("python_highlight_all") - let python_highlight_numbers = 1 - let python_highlight_builtins = 1 - let python_highlight_exceptions = 1 - let python_highlight_space_errors = 1 -endif - -if exists("python_highlight_numbers") - " numbers (including longs and complex) - syn match pythonNumber "\<0x\x\+[Ll]\=\>" - syn match pythonNumber "\<\d\+[LljJ]\=\>" - syn match pythonNumber "\.\d\+\([eE][+-]\=\d\+\)\=[jJ]\=\>" - syn match pythonNumber "\<\d\+\.\([eE][+-]\=\d\+\)\=[jJ]\=\>" - syn match pythonNumber "\<\d\+\.\d\+\([eE][+-]\=\d\+\)\=[jJ]\=\>" -endif - -if exists("python_highlight_builtins") - " builtin functions, types and objects, not really part of the syntax - syn keyword pythonBuiltin True False bool enumerate set frozenset help - syn keyword pythonBuiltin reversed sorted sum - syn keyword pythonBuiltin Ellipsis None NotImplemented __import__ abs - syn keyword pythonBuiltin apply buffer callable chr classmethod cmp - syn keyword pythonBuiltin coerce compile complex delattr dict dir divmod - syn keyword pythonBuiltin eval execfile file filter float getattr globals - syn keyword pythonBuiltin hasattr hash hex id input int intern isinstance - syn keyword pythonBuiltin issubclass iter len list locals long map max - syn keyword pythonBuiltin min object oct open ord pow property range - syn keyword pythonBuiltin raw_input reduce reload repr round setattr - syn keyword pythonBuiltin slice staticmethod str super tuple type unichr - syn keyword pythonBuiltin unicode vars xrange zip -endif - -if exists("python_highlight_exceptions") - " builtin exceptions and warnings - syn keyword pythonException ArithmeticError AssertionError AttributeError - syn keyword pythonException DeprecationWarning EOFError EnvironmentError - syn keyword pythonException Exception FloatingPointError IOError - syn keyword pythonException ImportError IndentationError IndexError - syn keyword pythonException KeyError KeyboardInterrupt LookupError - syn keyword pythonException MemoryError NameError NotImplementedError - syn keyword pythonException OSError OverflowError OverflowWarning - syn keyword pythonException ReferenceError RuntimeError RuntimeWarning - syn keyword pythonException StandardError StopIteration SyntaxError - syn keyword pythonException SyntaxWarning SystemError SystemExit TabError - syn keyword pythonException TypeError UnboundLocalError UnicodeError - syn keyword pythonException UnicodeEncodeError UnicodeDecodeError - syn keyword pythonException UnicodeTranslateError - syn keyword pythonException UserWarning ValueError Warning WindowsError - syn keyword pythonException ZeroDivisionError -endif - -if exists("python_highlight_space_errors") - " trailing whitespace - syn match pythonSpaceError display excludenl "\S\s\+$"ms=s+1 - " mixed tabs and spaces - syn match pythonSpaceError display " \+\t" - syn match pythonSpaceError display "\t\+ " -endif - -" This is fast but code inside triple quoted strings screws it up. It -" is impossible to fix because the only way to know if you are inside a -" triple quoted string is to start from the beginning of the file. If -" you have a fast machine you can try uncommenting the "sync minlines" -" and commenting out the rest. -"syn sync match pythonSync grouphere NONE "):$" -"syn sync maxlines=200 -syn sync minlines=2000 -syn sync linebreaks=1 - -if version >= 508 || !exists("did_python_syn_inits") - if version <= 508 - let did_python_syn_inits = 1 - command -nargs=+ HiLink hi link <args> - else - command -nargs=+ HiLink hi def link <args> - endif - - " The default methods for highlighting. Can be overridden later - HiLink pythonStatement Statement - HiLink pythonDefStatement Statement - HiLink pythonFunction Function - HiLink pythonConditional Conditional - HiLink pythonRepeat Repeat - HiLink pythonString String - HiLink pythonRawString String - HiLink pythonEscape Special - HiLink pythonOperator Operator - HiLink pythonPreCondit PreCondit - HiLink pythonComment Comment - HiLink pythonTodo Todo - HiLink pythonDecorator Define - if exists("python_highlight_numbers") - HiLink pythonNumber Number - endif - if exists("python_highlight_builtins") - HiLink pythonBuiltin Function - endif - if exists("python_highlight_exceptions") - HiLink pythonException Exception - endif - if exists("python_highlight_space_errors") - HiLink pythonSpaceError Error - endif - - delcommand HiLink -endif - -let b:current_syntax = "python" - -" vim: ts=8 diff --git a/home/.vim/syntax/sqloracle.vim b/home/.vim/syntax/sqloracle.vim deleted file mode 100644 index f401b54..0000000 --- a/home/.vim/syntax/sqloracle.vim +++ /dev/null @@ -1,149 +0,0 @@ -" Vim syntax file -" Language: SQL, PL/SQL (Oracle 11g) -" Maintainer: Alvin Steele <steelea AT acm.org> -" Last Change: 2008 Sep 04 - -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -" prior version Maintainer: Paul Moore <pf_moore AT yahoo.co.uk> -" prior version Last Change: 2005 Dec 23 -if version < 600 - syntax clear -elseif exists("b:current_syntax") - finish -endif - -syn case ignore - -" The SQL reserved words, defined as keywords. - -syn keyword sqlSpecial false null true - -syn keyword sqlKeyword access add as asc begin by case check cluster column -syn keyword sqlKeyword compress connect connect_by_iscycle connect_by_isleaf -syn keyword sqlKeyword current cursor decimal default desc -syn keyword sqlKeyword else elsif end exception exclusive file for from -syn keyword sqlKeyword function group having identified if immediate increment -syn keyword sqlKeyword index initial into is level loop maxextents mode modify -syn keyword sqlKeyword nocompress nowait of offline on online order over partition -syn keyword sqlKeyword start successful synonym table then to trigger uid -syn keyword sqlKeyword unique user validate values view when whenever -syn keyword sqlKeyword where with option order pctfree privileges procedure -syn keyword sqlKeyword public resource return row rowlabel rownum rows -syn keyword sqlKeyword session share size smallint type using -syn keyword sqlKeyword column_value object_id object_value ora_rowscn rowid -syn keyword sqlKeyword xmldata currval nextval versions_starttime versions_startscn -syn keyword sqlKeyword versions_endtime versions_endscn versions_xid versions_operation - - -syn keyword sqlOperator not and or -syn keyword sqlOperator in any some all between exists -syn keyword sqlOperator like escape -syn keyword sqlOperator union intersect minus -syn keyword sqlOperator prior distinct nocycle -syn keyword sqlOperator sysdate out connect_by_root multiset except -syn keyword sqlOperator submultiset regexp_like equals_path under_path -syn keyword sqlOperator present empty member - -syn keyword sqlStatement alter analyze audit comment commit create -syn keyword sqlStatement delete drop execute explain grant insert lock merge noaudit -syn keyword sqlStatement rename revoke rollback savepoint select set -syn keyword sqlStatement truncate update - -syn keyword sqlType boolean char character date float integer long -syn keyword sqlType mlslabel number raw rowid varchar varchar2 varray - -syn keyword sqlFunction abs acos add_months appendchildxml asciistr -syn keyword sqlFunction ascii asin atan atan2 avg -syn keyword sqlFunction bfilename bin_to_num bitand cardinality cast -syn keyword sqlFunction ceil chartorowid chr cluster_id cluster_probability -syn keyword sqlFunction cluster_set coalesce collect compose concat -syn keyword sqlFunction convert corr corr_s corr_k cos -syn keyword sqlFunction cosh count covar_pop covar_samp cube_table -syn keyword sqlFunction cume_dist current_date current_timestamp cv dataobj_to_partition -syn keyword sqlFunction dbtimezone decode decompose deletexml dense_rank -syn keyword sqlFunction depth deref dump empty_blob empty_clob -syn keyword sqlFunction existsnode exp extract extractvalue feature_id -syn keyword sqlFunction feature_set feature_value first first_value floor -syn keyword sqlFunction from_tz greatest group_id grouping grouping_id -syn keyword sqlFunction hextoraw initcap insertchildxml insertxmlbefore instr -syn keyword sqlFunction iteration_number lag last last_day last_value -syn keyword sqlFunction lead least length ln lnnvl -syn keyword sqlFunction localtimestamp log lower lpad ltrim -syn keyword sqlFunction make_ref max median min mod -syn keyword sqlFunction months_between nanvl nchr new_time next_day -syn keyword sqlFunction nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower -syn keyword sqlFunction nlssort nls_upper ntile nullif numtodsinterval -syn keyword sqlFunction numtoyminterval nvl nvl2 ora_hash path -syn keyword sqlFunction percent_rank percentile_cont percentile_disc power powermultiset -syn keyword sqlFunction powermultiset_by_cardinality prediction prediction_bounds prediction_cost prediction_details -syn keyword sqlFunction prediction_probability prediction_set presentnnv presentv previous -syn keyword sqlFunction rank ratio_to_report rawtohex rawtonhex ref -syn keyword sqlFunction reftohex regexp_count regexp_instr regexp_replace regexp_substr -syn keyword sqlFunction regr_slope regr_intercept regr_count regr_r2 regr_avgx -syn keyword sqlFunction regr_avgy regr_sxx regr_syy regr_sxy remainder -syn keyword sqlFunction replace round row_number rowidtochar rowidtonchar -syn keyword sqlFunction rpad rtrim scn_to_timestamp sessiontimezone set -syn keyword sqlFunction sign sin sinh soundex sqrt -syn keyword sqlFunction stats_binomial_test stats_crosstab stats_f_test stats_ks_test stats_mode -syn keyword sqlFunction stats_mw_test stats_one_way_anova stats_t_test_one stats_t_test_paired stats_t_test_indep stats_t_test_indepu -syn keyword sqlFunction stats_wsr_test stddev stddev_pop stddev_samp substr -syn keyword sqlFunction sum sys_connect_by_path sys_context sys_dburigen sys_extract_utc -syn keyword sqlFunction sys_guid sys_typeid sys_xmlagg sys_xmlgen sysdate -syn keyword sqlFunction systimestamp tan tanh timestamp_to_scn to_binary_double -syn keyword sqlFunction to_binary_float to_char to_clob to_date to_dsinterval -syn keyword sqlFunction to_lob to_multi_byte to_nchar to_nclob to_number -syn keyword sqlFunction to_single_byte to_timestamp to_timestamp_tz to_yminterval translate -syn keyword sqlFunction treat trim trunc tz_offset -syn keyword sqlFunction uid unistr updatexml upper user -syn keyword sqlFunction userenv value var_pop var_samp variance -syn keyword sqlFunction vsize width_bucket xmlagg xmlcast xmlcdata -syn keyword sqlFunction xmlcolattval xmlcomment xmlconcat xmldiff xmlelement -syn keyword sqlFunction xmlexists xmlforest xmlparse xmlpatch xmlpi -syn keyword sqlFunction xmlquery xmlroot xmlsequence xmlserialize xmltable -syn keyword sqlFunction xmltransform - -" Strings and characters: -syn region sqlString start=+"+ skip=+\\\\\|\\"+ end=+"+ -syn region sqlString start=+'+ skip=+\\\\\|\\'+ end=+'+ - -" Numbers: -syn match sqlNumber "-\=\<\d*\.\=[0-9_]\>" - -" Comments: -syn region sqlComment start="/\*" end="\*/" contains=sqlTodo -syn match sqlComment "--.*$" contains=sqlTodo - -syn sync ccomment sqlComment - -" Todo. -syn keyword sqlTodo contained TODO FIXME XXX DEBUG NOTE - -" Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_sql_syn_inits") - if version < 508 - let did_sql_syn_inits = 1 - command -nargs=+ HiLink hi link <args> - else - command -nargs=+ HiLink hi def link <args> - endif - - HiLink sqlComment Comment - HiLink sqlKeyword sqlSpecial - HiLink sqlNumber Number - HiLink sqlOperator sqlStatement - HiLink sqlSpecial Special - HiLink sqlStatement Statement - HiLink sqlString String - HiLink sqlType Type - HiLink sqlTodo Todo - HiLink sqlFunction Function - - delcommand HiLink -endif - -let b:current_syntax = "sql" - -" vim: ts=8 diff --git a/home/.vim/vimrc b/home/.vim/vimrc index c1579f9..d5aea81 100644 --- a/home/.vim/vimrc +++ b/home/.vim/vimrc @@ -11,7 +11,7 @@ nmap <silent> <F1> <Plug>DiffChangesPatchToggle " F2: - nmap <silent> <F3> :NERDTreeToggle<CR> " F4: - -" F5: - +" F5: switchbuf nmap <silent> <F6> :foldclose<CR> nmap <silent> <F7> :foldopen<CR> " F8: ctags @@ -35,7 +35,6 @@ filetype indent on " Automatisch einruecken (Ausrichtung an voriger Zeile) " (STRG-T rueckt um 1 Stufe ein, STRG-D rueckt um 1 Stufe aus) set autoindent -set smartindent set nocopyindent set nopreserveindent @@ -121,25 +120,32 @@ set t_Co=256 " Syntaxcoloring-Farb-Schema (stehen in $VIMRUNTIME/colors) " http://www.cs.cmu.edu/~maverick/VimColorSchemeTest/ -colorscheme candycode "" candycode desert green earendel rdark synic two2tango "" vanzan_color torte github slate default +colorscheme tango +"" asu1dark eclipse inkpot leo lettuce matrix moria murphy +"" nightwish no_quarter tango + " Tabs und Tabnavigation set showtabline=2 set laststatus=2 -nmap t :tabnew<Space> +"set switchbuf=usetab,newtab +"nnoremap <F5> :sbnext<CR> +"nnoremap <S-F5> :sbprevious<CR> + +nmap t :edit<Space> nmap s :w<CR> nmap w :w<CR> -nmap q :q<CR> +nmap q :bd<CR> -:nnoremap <S-Tab> :tabprevious<cr> +:nnoremap <S-Tab> :bprevious<cr> ":nnoremap <C-Y> :tabprevious<cr> ":noremap <C-Y> :tabprevious<cr> ":inoremap <C-Y> <ESC>:tabprevious<cr>i -:nnoremap <Tab> :tabnext<cr> +:nnoremap <Tab> :bnext<cr> ":nnoremap <C-X> :tabnext<cr> ":noremap <C-X> :tabnext<cr> ":inoremap <C-X> <ESC>:tabnext<cr>i @@ -149,6 +155,24 @@ nmap q :q<CR> :inoremap <C-x> :wincmd w<cr> :vnoremap <C-x> :wincmd w<cr> +function! CountListedBuffers() + let cnt = 0 + for nr in range(1,bufnr("$")) + if buflisted(nr) && ! empty(bufname(nr)) || getbufvar(nr, '&buftype') ==# 'help' + let cnt += 1 + endif + endfor + return cnt +endfunction + +function! QuitIfLastBuffer() + if CountListedBuffers() == 1 + :q + endif +endfunction + +autocmd BufDelete * :call QuitIfLastBuffer() + "allow backspacing over everything in insert mode set bs=2 " keep 50 lines of command line history @@ -170,6 +194,7 @@ set wildignore=.svn,CVS,.git,*.o,*.a,*.class,*.mo,*.la,*.so,*.obj,*.swp,*.jpg,*. set tabpagemax=30 "au BufAdd,BufNewFile,BufRead * nested tab sball +"au VimEnter * if !&diff | tab all | tabfirst | endif if !exists(":DiffOrig") command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis | wincmd p | diffthis @@ -226,6 +251,13 @@ autocmd BufNewFile,BufRead *.rb set shiftwidth=2 softtabstop=2 expandtab autocmd BufNewFile,BufRead *.py set shiftwidth=4 softtabstop=4 expandtab autocmd BufNewFile,BufRead *.yml set shiftwidth=2 softtabstop=2 expandtab +autocmd BufNewFile,BufRead *.r set ft=r +autocmd BufNewFile,BufRead *.R set ft=r +autocmd BufNewFile,BufRead *.s set ft=r +autocmd BufNewFile,BufRead *.S set ft=r +autocmd BufRead *.Rout set ft=r +autocmd BufRead *.Rhistory set ft=r + autocmd BufNewFile,BufRead snd.\d\+,.letter,.letter.\d\+,.followup,.article,.article.\d\+,pico.\d\+,{neo,}mutt{ng,}-*-\w\+,mutt[[:alnum:]_-]\\\{6\},ae\d\+.txt,/tmp/SLRN[0-9A-Z.]\+,*.eml setfiletype mail map <F8> :!/usr/bin/ctags -R --c++-kinds=+p --fields=+iaS --extra=+q -f ~/.vim/tags/c.tags .<CR> @@ -299,6 +331,7 @@ endif nmap ,cl /%changelog<CR>:r!date +'\%a \%b \%d \%Y'<CR>0i* <ESC>$a David Kaufmann <astra@ionic.at> - let g:Powerline_symbols = 'fancy' +let g:Powerline_cache_enabled = 0 set guifont=Menlo\ For\ Powerline\ Medium\ 8 let g:EclimHome = '/usr/share/vim/vimfiles/eclim' diff --git a/home/.zshrc b/home/.zshrc index 2803579..4fe6d37 100644 --- a/home/.zshrc +++ b/home/.zshrc @@ -144,12 +144,17 @@ if ! [[ $PATH =~ "${HOME}/bin" ]]; then PATH="${PATH}:${HOME}/bin" fi +# add ~/.carco/bin to path +if ! [[ $PATH =~ "${HOME}/.cargo/bin" ]]; then + PATH="${PATH}:${HOME}/.cargo/bin" +fi + exec_exists() { type -p $1 &>/dev/null } exec_exists hostname && HOSTNAME=`hostname` main_node() { [[ "$HOSTNAME" == "anduin" ]] } # Vars used later on by Zsh -export EDITOR="vim -p" +export EDITOR="vim" export PAGER="less" export LESS="-FRX" @@ -169,11 +174,6 @@ else export BATTERY=0 fi -alias vim="vim -p" -alias gvim="gvim -p" -alias e="gvim -p" -alias v="gvim -p" -alias g="git" exec_exists colordiff && alias diff="colordiff -u" alias vimdiff="vimdiff -c 'map q :qa!<CR>'" alias grep="grep -i" @@ -231,7 +231,10 @@ if main_node; then fi mping(){ ping $@|awk -F'[=\ ]' '/time=/{t=$(NF-1);f=2000-14*log(t^18);c="play -q -n synth 1 pl "f"&";print $0;system(c)}';} # mping yahoo\.com -bat(){ calc \(`cat /sys/class/power_supply/BAT0/energy_now`+`cat /sys/class/power_supply/BAT1/energy_now`\)/\(`cat /sys/class/power_supply/BAT0/energy_full`+`cat /sys/class/power_supply/BAT1/energy_full`\); } # show battery state +bat(){ + BAT0="/sys/class/power_supply/BAT0"; + BAT1="/sys/class/power_supply/BAT1"; + calc -p \(`cat ${BAT0}/energy_now`+`cat ${BAT1}/energy_now`\)/\(`cat ${BAT0}/energy_full`+`cat ${BAT1}/energy_full`\); } # show battery state #pdfgrep(){ # OLDWORKDIR=`pwd` @@ -264,5 +267,15 @@ bat(){ calc \(`cat /sys/class/power_supply/BAT0/energy_now`+`cat /sys/class/powe # twitter.com/climagic todo(){ cd ~/.todo||return 1&& l=$(ls -1t|head -n1)&&t=$(date +%Y%m%d);[[ "$1" == "last" ]]&&cp $l $t; vim $t;cd -;} +# open file at position +funcation vim() { + IFS=':' read file line position <<< "$1" + if ! [ -z "${line}" ]; then + command vim "${file}" +0"${line}" + else + command vim $* + fi +} + # temp patch cd $HOME |
