" SQL filetype plugin file " Language: SQL " Maintainer: Caleb Cushing " Contributions: " Michael Brailsford " original author " Hari Krishna Dara " Zak Beck " Last Change: Sun Oct 19 08:04:12 EDT 2008 " Revision: 2.0.0 " Download From: " http://vim.sourceforge.net/script.php?script_id=305 " 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 abort =SqlIab_ReplaceConditionally('abort', 'ABORT') inoreabbr abstime =SqlIab_ReplaceConditionally('abstime', 'ABSTIME') inoreabbr access =SqlIab_ReplaceConditionally('access', 'ACCESS') inoreabbr aclitem =SqlIab_ReplaceConditionally('aclitem', 'ACLITEM') inoreabbr add =SqlIab_ReplaceConditionally('add', 'ADD') inoreabbr aggregate =SqlIab_ReplaceConditionally('aggregate', 'AGGREGATE') inoreabbr all =SqlIab_ReplaceConditionally('all', 'ALL') inoreabbr alter =SqlIab_ReplaceConditionally('alter', 'ALTER') inoreabbr analyze =SqlIab_ReplaceConditionally('analyze', 'ANALYZE') inoreabbr and =SqlIab_ReplaceConditionally('and', 'AND') inoreabbr any =SqlIab_ReplaceConditionally('any', 'ANY') inoreabbr as =SqlIab_ReplaceConditionally('as', 'AS') inoreabbr as =SqlIab_ReplaceConditionally('as', 'AS') inoreabbr asc =SqlIab_ReplaceConditionally('asc', 'ASC') inoreabbr audit =SqlIab_ReplaceConditionally('audit', 'AUDIT') inoreabbr authorization =SqlIab_ReplaceConditionally('authorization', 'AUTHORIZATION') inoreabbr begin =SqlIab_ReplaceConditionally('begin', 'BEGIN') inoreabbr between =SqlIab_ReplaceConditionally('between', 'BETWEEN') inoreabbr bigint =SqlIab_ReplaceConditionally('bigint', 'BIGINT') inoreabbr bit =SqlIab_ReplaceConditionally('bit', 'BIT') inoreabbr boolean =SqlIab_ReplaceConditionally('boolean', 'BOOLEAN') inoreabbr box =SqlIab_ReplaceConditionally('box', 'BOX') inoreabbr by =SqlIab_ReplaceConditionally('by', 'BY') inoreabbr bytea =SqlIab_ReplaceConditionally('bytea', 'BYTEA') inoreabbr cascade =SqlIab_ReplaceConditionally('cascade', 'CASCADE') inoreabbr char =SqlIab_ReplaceConditionally('char', 'CHAR') inoreabbr character =SqlIab_ReplaceConditionally('character', 'CHARACTER') inoreabbr check =SqlIab_ReplaceConditionally('check', 'CHECK') inoreabbr checkpoint =SqlIab_ReplaceConditionally('checkpoint', 'CHECKPOINT') inoreabbr cid =SqlIab_ReplaceConditionally('cid', 'CID') inoreabbr cidr =SqlIab_ReplaceConditionally('cidr', 'CIDR') inoreabbr circle =SqlIab_ReplaceConditionally('circle', 'CIRCLE') inoreabbr close =SqlIab_ReplaceConditionally('close', 'CLOSE') inoreabbr cluster =SqlIab_ReplaceConditionally('cluster', 'CLUSTER') inoreabbr column =SqlIab_ReplaceConditionally('column', 'COLUMN') inoreabbr count =SqlIab_ReplaceConditionally('count', 'COUNT') inoreabbr comment =SqlIab_ReplaceConditionally('comment', 'COMMENT') inoreabbr commit =SqlIab_ReplaceConditionally('commit', 'COMMIT') inoreabbr compress =SqlIab_ReplaceConditionally('compress', 'COMPRESS') inoreabbr connect =SqlIab_ReplaceConditionally('connect', 'CONNECT') inoreabbr constraints =SqlIab_ReplaceConditionally('constraints', 'CONSTRAINTS') inoreabbr copy =SqlIab_ReplaceConditionally('copy', 'COPY') inoreabbr cre =SqlIab_ReplaceConditionally('cre', 'CREATE') inoreabbr create =SqlIab_ReplaceConditionally('create', 'CREATE') inoreabbr current =SqlIab_ReplaceConditionally('current', 'CURRENT') inoreabbr cursor =SqlIab_ReplaceConditionally('cursor', 'CURSOR') inoreabbr database =SqlIab_ReplaceConditionally('database', 'DATABASE') inoreabbr date =SqlIab_ReplaceConditionally('date', 'DATE') inoreabbr decimal =SqlIab_ReplaceConditionally('decimal', 'DECIMAL') inoreabbr declare =SqlIab_ReplaceConditionally('declare', 'DECLARE') inoreabbr default =SqlIab_ReplaceConditionally('default', 'DEFAULT') inoreabbr delete =SqlIab_ReplaceConditionally('delete', 'DELETE') inoreabbr desc =SqlIab_ReplaceConditionally('desc', 'DESC') inoreabbr distinct =SqlIab_ReplaceConditionally('distinct', 'DISTINCT') inoreabbr drop =SqlIab_ReplaceConditionally('drop', 'DROP') inoreabbr else =SqlIab_ReplaceConditionally('else', 'ELSE') inoreabbr elsif =SqlIab_ReplaceConditionally('elsif', 'ELSIF') inoreabbr end =SqlIab_ReplaceConditionally('end', 'END') inoreabbr escape =SqlIab_ReplaceConditionally('escape', 'ESCAPE') inoreabbr exception =SqlIab_ReplaceConditionally('exception', 'EXCEPTION') inoreabbr exclusive =SqlIab_ReplaceConditionally('exclusive', 'EXCLUSIVE') inoreabbr execute =SqlIab_ReplaceConditionally('execute', 'EXECUTE') inoreabbr exists =SqlIab_ReplaceConditionally('exists', 'EXISTS') inoreabbr explain =SqlIab_ReplaceConditionally('explain', 'EXPLAIN') inoreabbr false =SqlIab_ReplaceConditionally('false', 'FALSE') inoreabbr fetch =SqlIab_ReplaceConditionally('fetch', 'FETCH') inoreabbr file =SqlIab_ReplaceConditionally('file', 'FILE') inoreabbr float =SqlIab_ReplaceConditionally('float', 'FLOAT') inoreabbr for =SqlIab_ReplaceConditionally('for', 'FOR') inoreabbr foreign =SqlIab_ReplaceConditionally('foreign', 'FOREIGN') inoreabbr foriegn =SqlIab_ReplaceConditionally('foriegn', 'FOREIGN') inoreabbr from =SqlIab_ReplaceConditionally('from', 'FROM') inoreabbr function =SqlIab_ReplaceConditionally('function', 'FUNCTION') inoreabbr grant =SqlIab_ReplaceConditionally('grant', 'GRANT') inoreabbr group =SqlIab_ReplaceConditionally('group', 'GROUP') inoreabbr having =SqlIab_ReplaceConditionally('having', 'HAVING') inoreabbr identified =SqlIab_ReplaceConditionally('identified', 'IDENTIFIED') inoreabbr if =SqlIab_ReplaceConditionally('if', 'IF') inoreabbr immediate =SqlIab_ReplaceConditionally('immediate', 'IMMEDIATE') inoreabbr in =SqlIab_ReplaceConditionally('in', 'IN') inoreabbr increment =SqlIab_ReplaceConditionally('increment', 'INCREMENT') inoreabbr index =SqlIab_ReplaceConditionally('index', 'INDEX') inoreabbr inet =SqlIab_ReplaceConditionally('inet', 'INET') inoreabbr initial =SqlIab_ReplaceConditionally('initial', 'INITIAL') inoreabbr inner =SqlIab_ReplaceConditionally('inner', 'INNER') inoreabbr ins =SqlIab_ReplaceConditionally('ins', 'INSERT') inoreabbr insert =SqlIab_ReplaceConditionally('insert', 'INSERT') inoreabbr int =SqlIab_ReplaceConditionally('int', 'INTEGER') inoreabbr int2vector =SqlIab_ReplaceConditionally('int2vector', 'INT2VECTOR') inoreabbr integer =SqlIab_ReplaceConditionally('integer', 'INTEGER') inoreabbr intersect =SqlIab_ReplaceConditionally('intersect', 'INTERSECT') inoreabbr interval =SqlIab_ReplaceConditionally('interval', 'INTERVAL') inoreabbr into =SqlIab_ReplaceConditionally('into', 'INTO') inoreabbr is =SqlIab_ReplaceConditionally('is', 'IS') inoreabbr join =SqlIab_ReplaceConditionally('join', 'JOIN') inoreabbr key =SqlIab_ReplaceConditionally('key', 'KEY') inoreabbr language =SqlIab_ReplaceConditionally('language', 'LANGUAGE') inoreabbr level =SqlIab_ReplaceConditionally('level', 'LEVEL') inoreabbr line =SqlIab_ReplaceConditionally('line', 'LINE') inoreabbr listen =SqlIab_ReplaceConditionally('listen', 'LISTEN') inoreabbr load =SqlIab_ReplaceConditionally('load', 'LOAD') inoreabbr lock =SqlIab_ReplaceConditionally('lock', 'LOCK') inoreabbr long =SqlIab_ReplaceConditionally('long', 'LONG') inoreabbr loop =SqlIab_ReplaceConditionally('loop', 'LOOP') inoreabbr lseg =SqlIab_ReplaceConditionally('lseg', 'LSEG') inoreabbr macaddr =SqlIab_ReplaceConditionally('macaddr', 'MACADDR') inoreabbr maxextents =SqlIab_ReplaceConditionally('maxextents', 'MAXEXTENTS') inoreabbr minus =SqlIab_ReplaceConditionally('minus', 'MINUS') inoreabbr mlslabel =SqlIab_ReplaceConditionally('mlslabel', 'MLSLABEL') inoreabbr mode =SqlIab_ReplaceConditionally('mode', 'MODE') inoreabbr modify =SqlIab_ReplaceConditionally('modify', 'MODIFY') inoreabbr money =SqlIab_ReplaceConditionally('money', 'MONEY') inoreabbr move =SqlIab_ReplaceConditionally('move', 'MOVE') inoreabbr name =SqlIab_ReplaceConditionally('name', 'NAME') inoreabbr noaudit =SqlIab_ReplaceConditionally('noaudit', 'NOAUDIT') inoreabbr nocompress =SqlIab_ReplaceConditionally('nocompress', 'NOCOMPRESS') inoreabbr not =SqlIab_ReplaceConditionally('not', 'NOT') inoreabbr notify =SqlIab_ReplaceConditionally('notify', 'NOTIFY') inoreabbr nowait =SqlIab_ReplaceConditionally('nowait', 'NOWAIT') inoreabbr null =SqlIab_ReplaceConditionally('null', 'NULL') inoreabbr number =SqlIab_ReplaceConditionally('number', 'NUMBER') inoreabbr numeric =SqlIab_ReplaceConditionally('numeric', 'NUMERIC') inoreabbr of =SqlIab_ReplaceConditionally('of', 'OF') inoreabbr offline =SqlIab_ReplaceConditionally('offline', 'OFFLINE') inoreabbr oid =SqlIab_ReplaceConditionally('oid', 'OID') inoreabbr oidvector =SqlIab_ReplaceConditionally('oidvector', 'OIDVECTOR') inoreabbr on =SqlIab_ReplaceConditionally('on', 'ON') inoreabbr online =SqlIab_ReplaceConditionally('online', 'ONLINE') inoreabbr operator =SqlIab_ReplaceConditionally('operator', 'OPERATOR') inoreabbr option =SqlIab_ReplaceConditionally('option', 'OPTION') inoreabbr or =SqlIab_ReplaceConditionally('or', 'OR') inoreabbr order =SqlIab_ReplaceConditionally('order', 'ORDER') inoreabbr out =SqlIab_ReplaceConditionally('out', 'OUT') inoreabbr path =SqlIab_ReplaceConditionally('path', 'PATH') inoreabbr pctfree =SqlIab_ReplaceConditionally('pctfree', 'PCTFREE') inoreabbr point =SqlIab_ReplaceConditionally('point', 'POINT') inoreabbr polygon =SqlIab_ReplaceConditionally('polygon', 'POLYGON') inoreabbr primary =SqlIab_ReplaceConditionally('primary', 'PRIMARY') inoreabbr prior =SqlIab_ReplaceConditionally('prior', 'PRIOR') inoreabbr privileges =SqlIab_ReplaceConditionally('privileges', 'PRIVILEGES') inoreabbr procedure =SqlIab_ReplaceConditionally('procedure', 'PROCEDURE') inoreabbr public =SqlIab_ReplaceConditionally('public', 'PUBLIC') inoreabbr raw =SqlIab_ReplaceConditionally('raw', 'RAW') inoreabbr real =SqlIab_ReplaceConditionally('real', 'REAL') inoreabbr refcursor =SqlIab_ReplaceConditionally('refcursor', 'REFCURSOR') inoreabbr references =SqlIab_ReplaceConditionally('references', 'REFERENCES') inoreabbr refs =SqlIab_ReplaceConditionally('refs', 'REFERENCES') inoreabbr regproc =SqlIab_ReplaceConditionally('regproc', 'REGPROC') inoreabbr reindex =SqlIab_ReplaceConditionally('reindex', 'REINDEX') inoreabbr reltime =SqlIab_ReplaceConditionally('reltime', 'RELTIME') inoreabbr rename =SqlIab_ReplaceConditionally('rename', 'RENAME') inoreabbr reset =SqlIab_ReplaceConditionally('reset', 'RESET') inoreabbr resource =SqlIab_ReplaceConditionally('resource', 'RESOURCE') inoreabbr return =SqlIab_ReplaceConditionally('return', 'RETURN') inoreabbr returns =SqlIab_ReplaceConditionally('returns', 'RETURNS') inoreabbr revoke =SqlIab_ReplaceConditionally('revoke', 'REVOKE') inoreabbr rollback =SqlIab_ReplaceConditionally('rollback', 'ROLLBACK') inoreabbr row =SqlIab_ReplaceConditionally('row', 'ROW') inoreabbr rowid =SqlIab_ReplaceConditionally('rowid', 'ROWID') inoreabbr rowlabel =SqlIab_ReplaceConditionally('rowlabel', 'ROWLABEL') inoreabbr rownum =SqlIab_ReplaceConditionally('rownum', 'ROWNUM') inoreabbr rows =SqlIab_ReplaceConditionally('rows', 'ROWS') inoreabbr rule =SqlIab_ReplaceConditionally('rule', 'RULE') inoreabbr savepoint =SqlIab_ReplaceConditionally('savepoint', 'SAVEPOINT') inoreabbr schema =SqlIab_ReplaceConditionally('schema', 'SCHEMA') inoreabbr select =SqlIab_ReplaceConditionally('select', 'SELECT') inoreabbr sequence =SqlIab_ReplaceConditionally('sequence', 'SEQUENCE') inoreabbr serial =SqlIab_ReplaceConditionally('serial', 'SERIAL') inoreabbr session =SqlIab_ReplaceConditionally('session', 'SESSION') inoreabbr set =SqlIab_ReplaceConditionally('set', 'SET') inoreabbr share =SqlIab_ReplaceConditionally('share', 'SHARE') inoreabbr show =SqlIab_ReplaceConditionally('show', 'SHOW') inoreabbr size =SqlIab_ReplaceConditionally('size', 'SIZE') inoreabbr smallint =SqlIab_ReplaceConditionally('smallint', 'SMALLINT') inoreabbr smgr =SqlIab_ReplaceConditionally('smgr', 'SMGR') inoreabbr some =SqlIab_ReplaceConditionally('some', 'SOME') inoreabbr start =SqlIab_ReplaceConditionally('start', 'START') inoreabbr successful =SqlIab_ReplaceConditionally('successful', 'SUCCESSFUL') inoreabbr synonym =SqlIab_ReplaceConditionally('synonym', 'SYNONYM') inoreabbr sysdate =SqlIab_ReplaceConditionally('sysdate', 'SYSDATE') inoreabbr table =SqlIab_ReplaceConditionally('table', 'TABLE') inoreabbr text =SqlIab_ReplaceConditionally('text', 'TEXT') inoreabbr then =SqlIab_ReplaceConditionally('then', 'THEN') inoreabbr tid =SqlIab_ReplaceConditionally('tid', 'TID') inoreabbr timestamp =SqlIab_ReplaceConditionally('timestamp', 'TIMESTAMP') inoreabbr tinterval =SqlIab_ReplaceConditionally('tinterval', 'TINTERVAL') inoreabbr to =SqlIab_ReplaceConditionally('to', 'TO') inoreabbr trans =SqlIab_ReplaceConditionally('trans', 'TRANSACTION') inoreabbr transaction =SqlIab_ReplaceConditionally('transaction', 'TRANSACTION') inoreabbr trigger =SqlIab_ReplaceConditionally('trigger', 'TRIGGER') inoreabbr true =SqlIab_ReplaceConditionally('true', 'TRUE') inoreabbr truncate =SqlIab_ReplaceConditionally('truncate', 'TRUNCATE') inoreabbr type =SqlIab_ReplaceConditionally('type', 'TYPE') inoreabbr type =SqlIab_ReplaceConditionally('type', 'TYPE') inoreabbr uid =SqlIab_ReplaceConditionally('uid', 'UID') inoreabbr union =SqlIab_ReplaceConditionally('union', 'UNION') inoreabbr unique =SqlIab_ReplaceConditionally('unique', 'UNIQUE') inoreabbr unknown =SqlIab_ReplaceConditionally('unknown', 'UNKNOWN') inoreabbr unlisten =SqlIab_ReplaceConditionally('unlisten', 'UNLISTEN') inoreabbr update =SqlIab_ReplaceConditionally('update', 'UPDATE') inoreabbr user =SqlIab_ReplaceConditionally('user', 'USER') inoreabbr using =SqlIab_ReplaceConditionally('using', 'USING') inoreabbr vacuum =SqlIab_ReplaceConditionally('vacuum', 'VACUUM') inoreabbr validate =SqlIab_ReplaceConditionally('validate', 'VALIDATE') inoreabbr value =SqlIab_ReplaceConditionally('value', 'VALUE') inoreabbr values =SqlIab_ReplaceConditionally('values', 'VALUES') inoreabbr varchar =SqlIab_ReplaceConditionally('varchar', 'VARCHAR') inoreabbr varchar2 =SqlIab_ReplaceConditionally('varchar2', 'VARCHAR2') inoreabbr varray =SqlIab_ReplaceConditionally('varray', 'VARRAY') inoreabbr view =SqlIab_ReplaceConditionally('view', 'VIEW') inoreabbr whenever =SqlIab_ReplaceConditionally('whenever', 'WHENEVER') inoreabbr where =SqlIab_ReplaceConditionally('where', 'WHERE') inoreabbr with =SqlIab_ReplaceConditionally('with', 'WITH') inoreabbr xid =SqlIab_ReplaceConditionally('xid', 'XID') inoreabbr replace =SqlIab_ReplaceConditionally('replace', 'REPLACE') inoreabbr error =SqlIab_ReplaceConditionally('error', 'ERROR') inoreabbr output =SqlIab_ReplaceConditionally('output', 'OUTPUT') inoreabbr datetime =SqlIab_ReplaceConditionally('datetime', 'DATETIME') 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 u =g:UndoBuffer