Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updated for version 7.2a

  • Loading branch information...
commit d87f8c5f493b6e6759024a0c2ef68719b5b5d28f 1 parent 2d9f253
vimboss authored
Showing with 5,931 additions and 446 deletions.
  1. +1 −1  runtime/autoload/rubycomplete.vim
  2. +0 −1  runtime/autoload/xml/html401f.vim
  3. +0 −1  runtime/autoload/xml/xhtml10f.vim
  4. +1 −0  runtime/colors/slate.vim
  5. +13 −13 runtime/doc/Makefile
  6. +763 −0 runtime/doc/ft_sql.txt
  7. +9 −3 runtime/doc/gui.txt
  8. +1 −1  runtime/doc/hangulin.txt
  9. +26 −13 runtime/doc/map.txt
  10. +4 −1 runtime/doc/mlang.txt
  11. +1 −1  runtime/doc/os_qnx.txt
  12. +1 −1  runtime/doc/os_vms.txt
  13. +1 −1  runtime/doc/pi_gzip.txt
  14. +6 −2 runtime/doc/print.txt
  15. +1 −1  runtime/doc/usr_03.txt
  16. +1 −1  runtime/doc/usr_43.txt
  17. +1 −1  runtime/doc/version5.txt
  18. +1 −1  runtime/doc/visual.txt
  19. +68 −0 runtime/ftplugin/gitcommit.vim
  20. +43 −51 runtime/ftplugin/html.vim
  21. +3 −3 runtime/indent/php.vim
  22. +1 −1  runtime/indent/sql.vim
  23. +15 −14 runtime/indent/sqlanywhere.vim
  24. +16 −15 runtime/indent/vhdl.vim
  25. +21 −21 runtime/keymap/sinhala-phonetic_utf-8.vim
  26. +3 −1 runtime/keymap/ukrainian-jcuken.vim
  27. +12 −3 runtime/macros/less.sh
  28. +7 −7 runtime/plugin/vimballPlugin.vim
  29. +10 −3 runtime/spell/cleanadd.vim
  30. +2 −2 runtime/syntax/cmusrc.vim
  31. +3 −3 runtime/syntax/gp.vim
  32. +6 −3 runtime/syntax/manual.vim
  33. +135 −0 runtime/syntax/msmessages.vim
  34. +49 −17 runtime/syntax/netrw.vim
  35. +73 −0 runtime/syntax/pdf.vim
  36. +1 −1  runtime/syntax/ruby.vim
  37. +4 −1 runtime/syntax/scheme.vim
  38. +137 −82 runtime/syntax/tcsh.vim
  39. +32 −0 runtime/tutor/README_ami.txt
  40. +25 −0 runtime/tutor/runtime/delmenu.vim
  41. +75 −0 runtime/tutor/runtime/macmap.vim
  42. BIN  runtime/tutor/runtime/macros.info
  43. +1,312 −0 runtime/tutor/runtime/optwin.vim
  44. BIN  runtime/tutor/runtime/tools.info
  45. +43 −0 runtime/tutor/runtime/vim32x32.xpm
  46. +59 −0 runtime/tutor/runtime/vim48x48.xpm
  47. +791 −0 runtime/tutor/runtime/vimlogo.eps
  48. +830 −0 runtime/tutor/tutor.sv.utf-8
  49. +812 −0 runtime/tutor/tutor.vi.utf-8
  50. BIN  runtime/tutor/vimdir.info
  51. +67 −0 runtime/tutor/vimtutor.bat
  52. +7 −11 src/INSTALLpc.txt
  53. +2 −2 src/INSTALLvms.txt
  54. +1 −1  src/Make_mint.mak
  55. +3 −0  src/Make_mvc.mak
  56. +6 −12 src/ex_docmd.c
  57. +0 −1  src/if_sniff.c
  58. +0 −1  src/integration.c
  59. +191 −4 src/message.c
  60. +2 −0  src/normal.c
  61. +2 −4 src/os_mac.h
  62. +79 −79 src/po/de.po
  63. +104 −33 src/po/fr.po
  64. +4 −4 src/po/zh_TW.po
  65. +4 −3 src/proto/os_mac_conv.pro
  66. +29 −17 src/spell.c
  67. +1 −1  src/testdir/Make_os2.mak
  68. +9 −1 src/vim.h
  69. +1 −1  src/vim16.def
2  runtime/autoload/rubycomplete.vim
View
@@ -36,7 +36,7 @@ if !exists("g:rubycomplete_classes_in_global")
endif
if !exists("g:rubycomplete_buffer_loading")
- let g:rubycomplete_classes_in_global = 0
+ let g:rubycomplete_buffer_loading = 0
endif
if !exists("g:rubycomplete_include_object")
1  runtime/autoload/xml/html401f.vim
View
@@ -466,4 +466,3 @@ let g:xmldata_html401t = {
\ 'param': ['/>', ''],
\ }
\ }
-" vim:ft=vim:ff=unix
1  runtime/autoload/xml/xhtml10f.vim
View
@@ -467,4 +467,3 @@ let g:xmldata_xhtml10f = {
\ 'param': ['/>', ''],
\ }
\ }
-" vim:ft=vim:ff=unix
1  runtime/colors/slate.vim
View
@@ -9,6 +9,7 @@ if version > 580
syntax reset
endif
endif
+let colors_name = "slate"
:hi Normal guifg=White guibg=grey15
:hi Cursor guibg=khaki guifg=slategrey
:hi VertSplit guibg=#c2bfa5 guifg=grey40 gui=none cterm=reverse
26 runtime/doc/Makefile
View
@@ -14,13 +14,12 @@ VIMEXE = vim
include ../../src/auto/config.mk
DOCS = \
- ada.txt \
arabic.txt \
autocmd.txt \
change.txt \
cmdline.txt \
- debugger.txt \
debug.txt \
+ debugger.txt \
develop.txt \
diff.txt \
digraph.txt \
@@ -29,6 +28,8 @@ DOCS = \
farsi.txt \
filetype.txt \
fold.txt \
+ ft_ada.txt \
+ ft_sql.txt \
gui.txt \
gui_w16.txt \
gui_w32.txt \
@@ -50,10 +51,10 @@ DOCS = \
insert.txt \
intro.txt \
map.txt \
- message.txt \
- motion.txt \
mbyte.txt \
+ message.txt \
mlang.txt \
+ motion.txt \
netbeans.txt \
options.txt \
os_390.txt \
@@ -89,10 +90,9 @@ DOCS = \
russian.txt \
scroll.txt \
sign.txt \
+ spell.txt \
sponsor.txt \
starting.txt \
- spell.txt \
- sql.txt \
syntax.txt \
tabpage.txt \
tagsrch.txt \
@@ -145,7 +145,6 @@ DOCS = \
workshop.txt
HTMLS = \
- ada.html \
arabic.html \
autocmd.html \
change.html \
@@ -160,6 +159,8 @@ HTMLS = \
farsi.html \
filetype.html \
fold.html \
+ ft_ada.html \
+ ft_sql.html \
gui.html \
gui_w16.html \
gui_w32.html \
@@ -177,14 +178,13 @@ HTMLS = \
if_tcl.html \
indent.html \
index.html \
- vimindex.html \
insert.html \
intro.html \
map.html \
- message.html \
- motion.html \
mbyte.html \
+ message.html \
mlang.html \
+ motion.html \
netbeans.html \
options.html \
os_390.html \
@@ -220,10 +220,9 @@ HTMLS = \
russian.html \
scroll.html \
sign.html \
+ spell.html \
sponsor.html \
starting.html \
- spell.html \
- sql.html \
syntax.html \
tabpage.html \
tags.html \
@@ -272,6 +271,7 @@ HTMLS = \
version6.html \
version7.html \
vi_diff.html \
+ vimindex.html \
visual.html \
windows.html \
workshop.html
@@ -291,7 +291,7 @@ CONVERTED = \
evim-ru.UTF-8.1 \
vimdiff-ru.UTF-8.1 \
vimtutor-ru.UTF-8.1 \
- xxd-ru.UTF-8.1 \
+ xxd-ru.UTF-8.1
.SUFFIXES:
.SUFFIXES: .c .o .txt .html
763 runtime/doc/ft_sql.txt
View
@@ -0,0 +1,763 @@
+*ft_sql.txt* For Vim version 7.2a. Last change: Wed Apr 26 2006 3:05:33 PM
+
+by David Fishburn
+
+This is a filetype plugin to work with SQL files.
+
+The Structured Query Language (SQL) is a standard which specifies statements
+that allow a user to interact with a relational database. Vim includes
+features for navigation, indentation and syntax highlighting.
+
+1. Navigation |sql-navigation|
+ 1.1 Matchit |sql-matchit|
+ 1.2 Text Object Motions |sql-object-motions|
+ 1.3 Predefined Object Motions |sql-predefined-objects|
+ 1.4 Macros |sql-macros|
+2. SQL Dialects |sql-dialects|
+ 2.1 SQLSetType |SQLSetType|
+ 2.2 SQL Dialect Default |sql-type-default|
+3. Adding new SQL Dialects |sql-adding-dialects|
+4. OMNI SQL Completion |sql-completion|
+ 4.1 Static mode |sql-completion-static|
+ 4.2 Dynamic mode |sql-completion-dynamic|
+ 4.3 Tutorial |sql-completion-tutorial|
+ 4.3.1 Complete Tables |sql-completion-tables|
+ 4.3.2 Complete Columns |sql-completion-columns|
+ 4.3.3 Complete Procedures |sql-completion-procedures|
+ 4.3.4 Complete Views |sql-completion-views|
+ 4.4 Completion Customization |sql-completion-customization|
+ 4.5 SQL Maps |sql-completion-maps|
+ 4.6 Using with other filetypes |sql-completion-filetypes|
+
+==============================================================================
+1. Navigation *sql-navigation*
+
+The SQL ftplugin provides a number of options to assist with file
+navigation.
+
+
+1.1 Matchit *sql-matchit*
+-----------
+The matchit plugin (http://www.vim.org/scripts/script.php?script_id=39)
+provides many additional features and can be customized for different
+languages. The matchit plugin is configured by defining a local
+buffer variable, b:match_words. Pressing the % key while on various
+keywords will move the cursor to its match. For example, if the cursor
+is on an "if", pressing % will cycle between the "else", "elseif" and
+"end if" keywords.
+
+The following keywords are supported: >
+ if
+ elseif | elsif
+ else [if]
+ end if
+
+ [while condition] loop
+ leave
+ break
+ continue
+ exit
+ end loop
+
+ for
+ leave
+ break
+ continue
+ exit
+ end loop
+
+ do
+ statements
+ doend
+
+ case
+ when
+ when
+ default
+ end case
+
+ merge
+ when not matched
+ when matched
+
+ create[ or replace] procedure|function|event
+ returns
+
+
+1.2 Text Object Motions *sql-object-motions*
+-----------------------
+Vim has a number of predefined keys for working with text |object-motions|.
+This filetype plugin attempts to translate these keys to maps which make sense
+for the SQL language.
+
+The following |Normal| mode and |Visual| mode maps exist (when you edit a SQL
+file): >
+ ]] move forward to the next 'begin'
+ [[ move backwards to the previous 'begin'
+ ][ move forward to the next 'end'
+ [] move backwards to the previous 'end'
+
+
+1.3 Predefined Object Motions *sql-predefined-objects*
+-----------------------------
+Most relational databases support various standard features, tables, indices,
+triggers and stored procedures. Each vendor also has a variety of proprietary
+objects. The next set of maps have been created to help move between these
+objects. Depends on which database vendor you are using, the list of objects
+must be configurable. The filetype plugin attempts to define many of the
+standard objects, plus many additional ones. In order to make this as
+flexible as possible, you can override the list of objects from within your
+|vimrc| with the following: >
+ let g:ftplugin_sql_objects = 'function,procedure,event,table,trigger' .
+ \ ',schema,service,publication,database,datatype,domain' .
+ \ ',index,subscription,synchronization,view,variable'
+
+The following |Normal| mode and |Visual| mode maps have been created which use
+the above list: >
+ ]} move forward to the next 'create <object name>'
+ [{ move backward to the previous 'create <object name>'
+
+Repeatedly pressing ]} will cycle through each of these create statements: >
+ create table t1 (
+ ...
+ );
+
+ create procedure p1
+ begin
+ ...
+ end;
+
+ create index i1 on t1 (c1);
+
+The default setting for g:ftplugin_sql_objects is: >
+ let g:ftplugin_sql_objects = 'function,procedure,event,' .
+ \ '\\(existing\\\\|global\\s\\+temporary\\s\\+\\)\\\{,1}' .
+ \ 'table,trigger' .
+ \ ',schema,service,publication,database,datatype,domain' .
+ \ ',index,subscription,synchronization,view,variable'
+
+The above will also handle these cases: >
+ create table t1 (
+ ...
+ );
+ create existing table t2 (
+ ...
+ );
+ create global temporary table t3 (
+ ...
+ );
+
+By default, the ftplugin only searches for CREATE statements. You can also
+override this via your |vimrc| with the following: >
+ let g:ftplugin_sql_statements = 'create,alter'
+
+The filetype plugin defines three types of comments: >
+ 1. --
+ 2. //
+ 3. /*
+ *
+ */
+
+The following |Normal| mode and |Visual| mode maps have been created to work
+with comments: >
+ ]" move forward to the beginning of a comment
+ [" move forward to the end of a comment
+
+
+
+1.4 Macros *sql-macros*
+----------
+Vim's feature to find macro definitions, |'define'|, is supported using this
+regular expression: >
+ \c\<\(VARIABLE\|DECLARE\|IN\|OUT\|INOUT\)\>
+
+This addresses the following code: >
+ CREATE VARIABLE myVar1 INTEGER;
+
+ CREATE PROCEDURE sp_test(
+ IN myVar2 INTEGER,
+ OUT myVar3 CHAR(30),
+ INOUT myVar4 NUMERIC(20,0)
+ )
+ BEGIN
+ DECLARE myVar5 INTEGER;
+
+ SELECT c1, c2, c3
+ INTO myVar2, myVar3, myVar4
+ FROM T1
+ WHERE c4 = myVar1;
+ END;
+
+Place your cursor on "myVar1" on this line: >
+ WHERE c4 = myVar1;
+ ^
+
+Press any of the following keys: >
+ [d
+ [D
+ [CTRL-D
+
+
+==============================================================================
+2. SQL Dialects *sql-dialects* *sql-types*
+ *sybase* *TSQL* *Transact-SQL*
+ *sqlanywhere*
+ *oracle* *plsql* *sqlj*
+ *sqlserver*
+ *mysql* *postgres* *psql*
+ *informix*
+
+All relational databases support SQL. There is a portion of SQL that is
+portable across vendors (ex. CREATE TABLE, CREATE INDEX), but there is a
+great deal of vendor specific extensions to SQL. Oracle supports the
+"CREATE OR REPLACE" syntax, column defaults specified in the CREATE TABLE
+statement and the procedural language (for stored procedures and triggers).
+
+The default Vim distribution ships with syntax highlighting based on Oracle's
+PL/SQL. The default SQL indent script works for Oracle and SQL Anywhere.
+The default filetype plugin works for all vendors and should remain vendor
+neutral, but extendable.
+
+Vim currently has support for a variety of different vendors, currently this
+is via syntax scripts. Unfortunately, to flip between different syntax rules
+you must either create:
+ 1. New filetypes
+ 2. Custom autocmds
+ 3. Manual steps / commands
+
+The majority of people work with only one vendor's database product, it would
+be nice to specify a default in your |vimrc|.
+
+
+2.1 SQLSetType *sqlsettype* *SQLSetType*
+--------------
+For the people that work with many different databases, it would be nice to be
+able to flip between the various vendors rules (indent, syntax) on a per
+buffer basis, at any time. The ftplugin/sql.vim file defines this function: >
+ SQLSetType
+
+Executing this function without any parameters will set the indent and syntax
+scripts back to their defaults, see |sql-type-default|. If you have turned
+off Vi's compatibility mode, |'compatible'|, you can use the <Tab> key to
+complete the optional parameter.
+
+After typing the function name and a space, you can use the completion to
+supply a parameter. The function takes the name of the Vim script you want to
+source. Using the |cmdline-completion| feature, the SQLSetType function will
+search the |'runtimepath'| for all Vim scripts with a name containing 'sql'.
+This takes the guess work out of the spelling of the names. The following are
+examples: >
+ :SQLSetType
+ :SQLSetType sqloracle
+ :SQLSetType sqlanywhere
+ :SQLSetType sqlinformix
+ :SQLSetType mysql
+
+The easiest approach is to the use <Tab> character which will first complete
+the command name (SQLSetType), after a space and another <Tab>, display a list
+of available Vim script names: >
+ :SQL<Tab><space><Tab>
+
+
+2.2 SQL Dialect Default *sql-type-default*
+-----------------------
+As mentioned earlier, the default syntax rules for Vim is based on Oracle
+(PL/SQL). You can override this default by placing one of the following in
+your |vimrc|: >
+ let g:sql_type_default = 'sqlanywhere'
+ let g:sql_type_default = 'sqlinformix'
+ let g:sql_type_default = 'mysql'
+
+If you added the following to your |vimrc|: >
+ let g:sql_type_default = 'sqlinformix'
+
+The next time edit a SQL file the following scripts will be automatically
+loaded by Vim: >
+ ftplugin/sql.vim
+ syntax/sqlinformix.vim
+ indent/sql.vim
+>
+Notice indent/sqlinformix.sql was not loaded. There is no indent file
+for Informix, Vim loads the default files if the specified files does not
+exist.
+
+
+==============================================================================
+3. Adding new SQL Dialects *sql-adding-dialects*
+
+If you begin working with a SQL dialect which does not have any customizations
+available with the default Vim distribution you can check http://www.vim.org
+to see if any customization currently exist. If not, you can begin by cloning
+an existing script. Read |filetype-plugins| for more details.
+
+To help identify these scripts, try to create the files with a "sql" prefix.
+If you decide you wish to create customizations for the SQLite database, you
+can create any of the following: >
+ Unix
+ ~/.vim/syntax/sqlite.vim
+ ~/.vim/indent/sqlite.vim
+ Windows
+ $VIM/vimfiles/syntax/sqlite.vim
+ $VIM/vimfiles/indent/sqlite.vim
+
+No changes are necessary to the SQLSetType function. It will automatically
+pickup the new SQL files and load them when you issue the SQLSetType command.
+
+
+==============================================================================
+4. OMNI SQL Completion *sql-completion*
+ *omni-sql-completion*
+
+Vim 7 includes a code completion interface and functions which allows plugin
+developers to build in code completion for any language. Vim 7 includes
+code completion for the SQL language.
+
+There are two modes to the SQL completion plugin, static and dynamic. The
+static mode populates the popups with the data generated from current syntax
+highlight rules. The dynamic mode populates the popups with data retrieved
+directly from a database. This includes, table lists, column lists,
+procedures names and more.
+
+4.1 Static Mode *sql-completion-static*
+---------------
+The static popups created contain items defined by the active syntax rules
+while editing a file with a filetype of SQL. The plugin defines (by default)
+various maps to help the user refine the list of items to be displayed.
+The defaults static maps are: >
+ imap <buffer> <C-C>a <C-\><C-O>:call sqlcomplete#Map('syntax')<CR><C-X><C-O>
+ imap <buffer> <C-C>k <C-\><C-O>:call sqlcomplete#Map('sqlKeyword')<CR><C-X><C-O>
+ imap <buffer> <C-C>f <C-\><C-O>:call sqlcomplete#Map('sqlFunction')<CR><C-X><C-O>
+ imap <buffer> <C-C>o <C-\><C-O>:call sqlcomplete#Map('sqlOption')<CR><C-X><C-O>
+ imap <buffer> <C-C>T <C-\><C-O>:call sqlcomplete#Map('sqlType')<CR><C-X><C-O>
+ imap <buffer> <C-C>s <C-\><C-O>:call sqlcomplete#Map('sqlStatement')<CR><C-X><C-O>
+
+The static maps (which are based on the syntax highlight groups) follow this
+format: >
+ imap <buffer> <C-C>k <C-\><C-O>:call sqlcomplete#Map('sqlKeyword')<CR><C-X><C-O>
+
+This command breaks down as: >
+ imap - Create an insert map
+ <buffer> - Only for this buffer
+ <C-C>k - Your choice of key map
+ <C-\><C-O> - Execute one command, return to Insert mode
+ :call sqlcomplete#Map( - Allows the SQL completion plugin to perform some
+ housekeeping functions to allow it to be used in
+ conjunction with other completion plugins.
+ Indicate which item you want the SQL completion
+ plugin to complete.
+ In this case we are asking the plugin to display
+ items from the syntax highlight group
+ 'sqlKeyword'.
+ You can view a list of highlight group names to
+ choose from by executing the
+ :syntax list
+ command while editing a SQL file.
+ 'sqlKeyword' - Display the items for the sqlKeyword highlight
+ group
+ )<CR> - Execute the :let command
+ <C-X><C-O> - Trigger the standard omni completion key stroke.
+ Passing in 'sqlKeyword' instructs the SQL
+ completion plugin to populate the popup with
+ items from the sqlKeyword highlight group. The
+ plugin will also cache this result until Vim is
+ restarted. The syntax list is retrieved using
+ the syntaxcomplete plugin.
+
+Using the 'syntax' keyword is a special case. This instructs the
+syntaxcomplete plugin to retrieve all syntax items. So this will effectively
+work for any of Vim's SQL syntax files. At the time of writing this includes
+10 different syntax files for the different dialects of SQL (see section 3
+above, |sql-dialects|).
+
+Here are some examples of the entries which are pulled from the syntax files: >
+ All
+ - Contains the contents of all syntax highlight groups
+ Statements
+ - Select, Insert, Update, Delete, Create, Alter, ...
+ Functions
+ - Min, Max, Trim, Round, Date, ...
+ Keywords
+ - Index, Database, Having, Group, With
+ Options
+ - Isolation_level, On_error, Qualify_owners, Fire_triggers, ...
+ Types
+ - Integer, Char, Varchar, Date, DateTime, Timestamp, ...
+
+
+4.2 Dynamic Mode *sql-completion-dynamic*
+----------------
+Dynamic mode populates the popups with data directly from a database. In
+order for the dynamic feature to be enabled you must have the dbext.vim
+plugin installed, (http://vim.sourceforge.net/script.php?script_id=356).
+
+Dynamic mode is used by several features of the SQL completion plugin.
+After installing the dbext plugin see the dbext-tutorial for additional
+configuration and usage. The dbext plugin allows the SQL completion plugin
+to display a list of tables, procedures, views and columns. >
+ Table List
+ - All tables for all schema owners
+ Procedure List
+ - All stored procedures for all schema owners
+ View List
+ - All stored procedures for all schema owners
+ Column List
+ - For the selected table, the columns that are part of the table
+
+To enable the popup, while in INSERT mode, use the following key combinations
+for each group (where <C-C> means hold the CTRL key down while pressing
+the space bar):
+ Table List - <C-C>t
+ - <C-X><C-O> (the default map assumes tables)
+ Stored Procedure List - <C-C>p
+ View List - <C-C>v
+ Column List - <C-C>c
+
+ Windows platform only - When viewing a popup window displaying the list
+ of tables, you can press <C-Right>, this will
+ replace the table currently highlighted with
+ the column list for that table.
+ - When viewing a popup window displaying the list
+ of columns, you can press <C-Left>, this will
+ replace the column list with the list of tables.
+ - This allows you to quickly drill down into a
+ table to view it's columns and back again.
+
+The SQL completion plugin caches various lists that are displayed in
+the popup window. This makes the re-displaying of these lists very
+fast. If new tables or columns are added to the database it may become
+necessary to clear the plugins cache. The default map for this is: >
+ imap <buffer> <C-C>R <C-\><C-O>:call sqlcomplete#Map('ResetCache')<CR><C-X><C-O>
+
+
+4.3 SQL Tutorial *sql-completion-tutorial*
+----------------
+
+This tutorial is designed to take you through the common features of the SQL
+completion plugin so that: >
+ a) You gain familiarity with the plugin
+ b) You are introduced to some of the more common features
+ c) Show how to customize it to your preferences
+ d) Demonstrate "Best of Use" of the plugin (easiest way to configure).
+
+First, create a new buffer: >
+ :e tutorial.sql
+
+
+Static features
+---------------
+To take you through the various lists, simply enter insert mode, hit:
+ <C-C>s (show SQL statements)
+At this point, you can page down through the list until you find "select".
+If you are familiar with the item you are looking for, for example you know
+the statement begins with the letter "s". You can type ahead (without the
+quotes) "se" then press:
+ <C-Space>t
+Assuming "select" is highlighted in the popup list press <Enter> to choose
+the entry. Now type:
+ * fr<C-C>a (show all syntax items)
+choose "from" from the popup list.
+
+When writing stored procedures using the "type" list is useful. It contains
+a list of all the database supported types. This may or may not be true
+depending on the syntax file you are using. The SQL Anywhere syntax file
+(sqlanywhere.vim) has support for this: >
+ BEGIN
+ DECLARE customer_id <C-C>T <-- Choose a type from the list
+
+
+Dynamic features
+----------------
+To take advantage of the dynamic features you must first install the
+dbext.vim plugin (http://vim.sourceforge.net/script.php?script_id=356). It
+also comes with a tutorial. From the SQL completion plugin's perspective,
+the main feature dbext provides is a connection to a database. dbext
+connection profiles are the most efficient mechanism to define connection
+information. Once connections have been setup, the SQL completion plugin
+uses the features of dbext in the background to populate the popups.
+
+What follows assumes dbext.vim has been correctly configured, a simple test
+is to run the command, :DBListTable. If a list of tables is shown, you know
+dbext.vim is working as expected. If not, please consult the dbext.txt
+documentation.
+
+Assuming you have followed the dbext-tutorial you can press <C-C>t to
+display a list of tables. There is a delay while dbext is creating the table
+list. After the list is displayed press <C-W>. This will remove both the
+popup window and the table name already chosen when the list became active. >
+
+ 4.3.1 Table Completion: *sql-completion-tables*
+
+Press <C-C>t to display a list of tables from within the database you
+have connected via the dbext plugin.
+NOTE: All of the SQL completion popups support typing a prefix before pressing
+the key map. This will limit the contents of the popup window to just items
+beginning with those characters. >
+
+ 4.3.2 Column Completion: *sql-completion-columns*
+
+The SQL completion plugin can also display a list of columns for particular
+tables. The column completion is trigger via <C-C>c.
+
+NOTE: The following example uses <C-Right> to trigger a column list while
+the popup window is active. This map is only available on the Windows
+platforms since *nix does not recognize CTRL and the right arrow held down
+together. If you wish to enable this functionality on a *nix platform choose
+a key and create one of these mappings (see |sql-completion-maps| for further
+details on where to create this imap): >
+ imap <buffer> <your_keystroke> <C-R>=sqlcomplete#DrillIntoTable()<CR>
+ imap <buffer> <your_keystroke> <C-Y><C-\><C-O>:call sqlcomplete#Map('column')<CR><C-X><C-O>
+
+Example of using column completion:
+ - Press <C-C>t again to display the list of tables.
+ - When the list is displayed in the completion window, press <C-Right>,
+ this will replace the list of tables, with a list of columns for the
+ table highlighted (after the same short delay).
+ - If you press <C-Left>, this will again replace the column list with the
+ list of tables. This allows you to drill into tables and column lists
+ very quickly.
+ - Press <C-Right> again while the same table is highlighted. You will
+ notice there is no delay since the column list has been cached. If you
+ change the schema of a cached table you can press <C-C>R, which
+ clears the SQL completion cache.
+ - NOTE: <C-Right> and <C-Left> have been designed to work while the
+ completion window is active. If the completion popup window is
+ not active, a normal <C-Right> or <C-Left> will be executed.
+
+Lets look how we can build a SQL statement dynamically. A select statement
+requires a list of columns. There are two ways to build a column list using
+the SQL completion plugin. >
+ One column at a time:
+< 1. After typing SELECT press <C-C>t to display a list of tables.
+ 2. Choose a table from the list.
+ 3. Press <C-Right> to display a list of columns.
+ 4. Choose the column from the list and press enter.
+ 5. Enter a "," and press <C-C>c. Generating a column list
+ generally requires having the cursor on a table name. The plugin
+ uses this name to determine what table to retrieve the column list.
+ In this step, since we are pressing <C-C>c without the cursor
+ on a table name the column list displayed will be for the previous
+ table. Choose a different column and move on.
+ 6. Repeat step 5 as often as necessary. >
+ All columns for a table:
+< 1. After typing SELECT press <C-C>t to display a list of tables.
+ 2. Highlight the table you need the column list for.
+ 3. Press <Enter> to choose the table from the list.
+ 4. Press <C-C>l to request a comma separated list of all columns
+ for this table.
+ 5. Based on the table name chosen in step 3, the plugin attempts to
+ decide on a reasonable table alias. You are then prompted to
+ either accept of change the alias. Press OK.
+ 6. The table name is replaced with the column list of the table is
+ replaced with the comma separate list of columns with the alias
+ prepended to each of the columns.
+ 7. Step 3 and 4 can be replaced by pressing <C-C>L, which has
+ a <C-Y> embedded in the map to choose the currently highlighted
+ table in the list.
+
+There is a special provision when writing select statements. Consider the
+following statement: >
+ select *
+ from customer c,
+ contact cn,
+ department as dp,
+ employee e,
+ site_options so
+ where c.
+
+In INSERT mode after typing the final "c." which is an alias for the
+"customer" table, you can press either <C-C>c or <C-X><C-O>. This will
+popup a list of columns for the customer table. It does this by looking back
+to the beginning of the select statement and finding a list of the tables
+specified in the FROM clause. In this case it notes that in the string
+"customer c", "c" is an alias for the customer table. The optional "AS"
+keyword is also supported, "customer AS c". >
+
+
+ 4.3.3 Procedure Completion: *sql-completion-procedures*
+
+Similar to the table list, <C-C>p, will display a list of stored
+procedures stored within the database. >
+
+ 4.3.4 View Completion: *sql-completion-views*
+
+Similar to the table list, <C-C>v, will display a list of views in the
+database.
+
+
+4.4 Completion Customization *sql-completion-customization*
+----------------------------
+
+The SQL completion plugin can be customized through various options set in
+your |vimrc|: >
+ omni_sql_no_default_maps
+< - Default: This variable is not defined
+ - If this variable is defined, no maps are created for OMNI
+ completion. See |sql-completion-maps| for further discussion.
+>
+ omni_sql_use_tbl_alias
+< - Default: a
+ - This setting is only used when generating a comma separated
+ column list. By default the map is <C-C>l. When generating
+ a column list, an alias can be prepended to the beginning of each
+ column, for example: e.emp_id, e.emp_name. This option has three
+ settings: >
+ n - do not use an alias
+ d - use the default (calculated) alias
+ a - ask to confirm the alias name
+<
+ An alias is determined following a few rules:
+ 1. If the table name has an '_', then use it as a separator: >
+ MY_TABLE_NAME --> MTN
+ my_table_name --> mtn
+ My_table_NAME --> MtN
+< 2. If the table name does NOT contain an '_', but DOES use
+ mixed case then the case is used as a separator: >
+ MyTableName --> MTN
+< 3. If the table name does NOT contain an '_', and does NOT
+ use mixed case then the first letter of the table is used: >
+ mytablename --> m
+ MYTABLENAME --> M
+
+ omni_sql_ignorecase
+< - Default: Current setting for|ignorecase|
+ - Valid settings are 0 or 1.
+ - When entering a few letters before initiating completion, the list
+ will be filtered to display only the entries which begin with the
+ list of characters. When this option is set to 0, the list will be
+ filtered using case sensitivity. >
+
+ omni_sql_include_owner
+< - Default: 0, unless dbext.vim 3.00 has been installed
+ - Valid settings are 0 or 1.
+ - When completing tables, procedure or views and using dbext.vim 3.00
+ or higher the list of objects will also include the owner name.
+ When completing these objects and omni_sql_include_owner is enabled
+ the owner name will be replaced. >
+
+ omni_sql_precache_syntax_groups
+< - Default:
+ ['syntax','sqlKeyword','sqlFunction','sqlOption','sqlType','sqlStatement']
+ - sqlcomplete can be used in conjunction with other completion
+ plugins. This is outlined at |sql-completion-filetypes|. When the
+ filetype is changed temporarily to SQL, the sqlcompletion plugin
+ will cache the syntax groups listed in the List specified in this
+ option.
+>
+
+4.5 SQL Maps *sql-completion-maps*
+------------
+
+The default SQL maps have been described in other sections of this document in
+greater detail. Here is a list of the maps with a brief description of each.
+
+Static Maps
+-----------
+These are maps which use populate the completion list using Vim's syntax
+highlighting rules. >
+ <C-C>a
+< - Displays all SQL syntax items. >
+ <C-C>k
+< - Displays all SQL syntax items defined as 'sqlKeyword'. >
+ <C-C>f
+< - Displays all SQL syntax items defined as 'sqlFunction. >
+ <C-C>o
+< - Displays all SQL syntax items defined as 'sqlOption'. >
+ <C-C>T
+< - Displays all SQL syntax items defined as 'sqlType'. >
+ <C-C>s
+< - Displays all SQL syntax items defined as 'sqlStatement'. >
+
+Dynamic Maps
+------------
+These are maps which use populate the completion list using the dbext.vim
+plugin. >
+ <C-C>t
+< - Displays a list of tables. >
+ <C-C>p
+< - Displays a list of procedures. >
+ <C-C>v
+< - Displays a list of views. >
+ <C-C>c
+< - Displays a list of columns for a specific table. >
+ <C-C>l
+< - Displays a comma separated list of columns for a specific table. >
+ <C-C>L
+< - Displays a comma separated list of columns for a specific table.
+ This should only be used when the completion window is active. >
+ <C-Right>
+< - Displays a list of columns for the table currently highlighted in
+ the completion window. <C-Right> is not recognized on most Unix
+ systems, so this maps is only created on the Windows platform.
+ If you would like the same feature on Unix, choose a different key
+ and make the same map in your vimrc. >
+ <C-Left>
+< - Displays the list of tables.
+ <C-Left> is not recognized on most Unix systems, so this maps is
+ only created on the Windows platform. If you would like the same
+ feature on Unix, choose a different key and make the same map in
+ your vimrc. >
+ <C-C>R
+< - This maps removes all cached items and forces the SQL completion
+ to regenerate the list of items.
+
+Customizing Maps
+----------------
+You can create as many additional key maps as you like. Generally, the maps
+will be specifying different syntax highlight groups.
+
+If you do not wish the default maps created or the key choices do not work on
+your platform (often a case on *nix) you define the following variable in
+your |vimrc|: >
+ let g:omni_sql_no_default_maps = 1
+
+Do no edit ftplugin/sql.vim directly! If you change this file your changes
+will be over written on future updates. Vim has a special directory structure
+which allows you to make customizations without changing the files that are
+included with the Vim distribution. If you wish to customize the maps
+create an after/ftplugin/sql.vim (see |after-directory|) and place the same
+maps from the ftplugin/sql.vim in it using your own key strokes. <C-C> was
+chosen since it will work on both Windows and *nix platforms. On the windows
+platform you can also use <C-Space> or ALT keys.
+
+
+4.6 Using with other filetypes *sql-completion-filetypes*
+------------------------------
+
+Many times SQL can be used with different filetypes. For example Perl, Java,
+PHP, Javascript can all interact with a database. Often you need both the SQL
+completion as well as the completion capabilities for the current language you
+are editing.
+
+This can be enabled easily with the following steps (assuming a Perl file): >
+ 1. :e test.pl
+ 2. :set filetype=sql
+ 3. :set ft=perl
+
+Step 1
+------
+Begins by editing a Perl file. Vim automatically sets the filetype to
+"perl". By default, Vim runs the appropriate filetype file
+ftplugin/perl.vim. If you are using the syntax completion plugin by following
+the directions at |ft-syntax-omni| then the |'omnifunc'| option has been set to
+"syntax#Complete". Pressing <C-X><C-O> will display the omni popup containing
+the syntax items for Perl.
+
+Step 2
+------
+Manually setting the filetype to 'sql' will also fire the appropriate filetype
+files ftplugin/sql.vim. This file will define a number of buffer specific
+maps for SQL completion, see |sql-completion-maps|. Now these maps have
+been created and the SQL completion plugin has been initialized. All SQL
+syntax items have been cached in preparation. The SQL filetype script detects
+we are attempting to use two different completion plugins. Since the SQL maps
+begin with <C-C>, the maps will toggle the |'omnifunc'| when in use. So you
+can use <C-X><C-O> to continue using the completion for Perl (using the syntax
+completion plugin) and <C-C> to use the SQL completion features.
+
+Step 3
+------
+Setting the filetype back to Perl sets all the usual "perl" related items back
+as they were.
+
+
+vim:tw=78:ts=8:ft=help:norl:
12 runtime/doc/gui.txt
View
@@ -1,4 +1,4 @@
-*gui.txt* For Vim version 7.1. Last change: 2007 May 11
+*gui.txt* For Vim version 7.2a. Last change: 2008 Jun 14
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -325,16 +325,22 @@ A different kind of selection is used when:
- at the |hit-enter| prompt
- whenever the current mode is not in the 'mouse' option
- when holding the CTRL and SHIFT keys in the GUI
+
Since Vim continues like the selection isn't there, and there is no mode
associated with the selection, this is called modeless selection. Any text in
the Vim window can be selected. Select the text by pressing the left mouse
button at the start, drag to the end and release. To extend the selection,
use the right mouse button when 'mousemodel' is "extend", or the left mouse
button with the shift key pressed when 'mousemodel' is "popup".
-The middle mouse button pastes the text.
The selection is removed when the selected text is scrolled or changed.
+
On the command line CTRL-Y can be used to copy the selection into the
-clipboard. To do this from Insert mode, use CTRL-O : CTRL-Y <CR>.
+clipboard. To do this from Insert mode, use CTRL-O : CTRL-Y <CR>. When
+'guioptions' contains a or A (default on X11), the selection is automatically
+copied to the "* register.
+
+The middle mouse button can then paste the text. On non-X11 systems, you can
+use CTRL-R +.
3.4 Using Mouse on Status Lines *gui-mouse-status*
2  runtime/doc/hangulin.txt
View
@@ -1,4 +1,4 @@
-*hangulin.txt* For Vim version 7.1. Last change: 2006 Apr 02
+*hangulin.txt* For Vim version 7.2a. Last change: 2006 Apr 02
VIM REFERENCE MANUAL by Chi-Deok Hwang and Sung-Hyun Nam
39 runtime/doc/map.txt
View
@@ -1,4 +1,4 @@
-*map.txt* For Vim version 7.1. Last change: 2007 May 11
+*map.txt* For Vim version 7.2a. Last change: 2008 Jun 21
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -266,12 +266,13 @@ as a special key.
1.3 MAPPING AND MODES *:map-modes*
+ *mapmode-nvo* *mapmode-n* *mapmode-v* *mapmode-o*
There are five sets of mappings
- For Normal mode: When typing commands.
- For Visual mode: When typing commands while the Visual area is highlighted.
- For Operator-pending mode: When an operator is pending (after "d", "y", "c",
- etc.). Example: ":omap { w" makes "y{" work like "yw" and "d{" like "dw".
+ etc.). See below: |omap-info|.
- For Insert mode. These are also used in Replace mode.
- For Command-line mode: When entering a ":" or "/" command.
@@ -282,7 +283,6 @@ to type a count with a zero.
*map-overview* *map-modes*
Overview of which map command works in which mode:
- *mapmode-nvo* *mapmode-n* *mapmode-v* *mapmode-o*
commands: modes: ~
Normal Visual+Select Operator-pending ~
:map :noremap :unmap :mapclear yes yes yes
@@ -318,6 +318,19 @@ Therefore the ":map" and ":map!" commands enter and display mappings for
several modes. In Vim you can use the ":nmap", ":vmap", ":omap", ":cmap" and
":imap" commands to enter mappings for each mode separately.
+ *omap-info*
+Operator-pending mappings can be used to define a movement command that can be
+used with any operator. Simple example: ":omap { w" makes "y{" work like "yw"
+and "d{" like "dw".
+
+To ignore the starting cursor position and select different text, you can have
+the omap start Visual mode to select the text to be operated upon. Example
+that operates on a function name in the current line: >
+ onoremap <silent> F :<C-U>normal! 0f(hviw<CR>
+The CTRL-U (<C-U>) is used to remove the range that Vim may insert. The
+Normal mode commands find the first '(' character and select the first word
+before it. That usually is the function name.
+
To enter a mapping for Normal and Visual mode, but not Operator-pending mode,
first define it for all three modes, then unmap it for Operator-pending mode:
:map xx something-difficult
@@ -473,7 +486,7 @@ scenario: >
:imap <M-C> foo
:set encoding=utf-8
The mapping for <M-C> is defined with the latin1 encoding, resulting in a 0xc3
-byte. If you type the character � (0xea <M-a>) in UTF-8 encoding this is the
+byte. If you type the character � (0xe1 <M-a>) in UTF-8 encoding this is the
two bytes 0xc3 0xa1. You don't want the 0xc3 byte to be mapped then,
otherwise it would be impossible to type the � character.
@@ -494,9 +507,9 @@ defined. Changing "mapleader" after that has no effect for already defined
mappings.
*<LocalLeader>* *maplocalleader*
-Just like <Leader>, except that it uses "maplocalleader" instead of
-"mapleader". <LocalLeader> is to be used for mappings which are local to a
-buffer. Example: >
+<LocalLeader> is just like <Leader>, except that it uses "maplocalleader"
+instead of "mapleader". <LocalLeader> is to be used for mappings which are
+local to a buffer. Example: >
:map <LocalLeader>q \DoItNow
<
In a global plugin <Leader> should be used and in a filetype plugin
@@ -1167,7 +1180,7 @@ defined, not where it is invoked! Example:
:source script1.vim
:let s:error = "Wrong!"
:Error s:error
-Executing script2.vim will result in "None" to be echoed. Not what you
+Executing script2.vim will result in "None" being echoed. Not what you
intended! Calling a function may be an alternative.
Completion behavior *:command-completion* *E179*
@@ -1203,7 +1216,7 @@ Custom completion *:command-completion-custom*
*E467* *E468*
It is possible to define customized completion schemes via the "custom,{func}"
or the "customlist,{func}" completion argument. The {func} part should be a
-function with the following prototype >
+function with the following signature: >
:function {func}(ArgLead, CmdLine, CursorPos)
@@ -1370,10 +1383,10 @@ This will invoke: >
:" A more substantial example
:function Allargs(command)
- : let i = 0
- : while i < argc()
- : if filereadable(argv(i))
- : execute "e " . argv(i)
+ : let i = 0
+ : while i < argc()
+ : if filereadable(argv(i))
+ : execute "e " . argv(i)
: execute a:command
: endif
: let i = i + 1
5 runtime/doc/mlang.txt
View
@@ -1,4 +1,4 @@
-*mlang.txt* For Vim version 7.1. Last change: 2006 Jul 12
+*mlang.txt* For Vim version 7.2a. Last change: 2008 Jun 08
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -73,6 +73,9 @@ use of "-" and "_".
This sets $LC_TIME.
Without an argument both are set, and additionally
$LANG is set.
+ When compiled with the |+float| feature the LC_NUMERIC
+ value will always be set to "C", so that floating
+ point numbers use '.' as the decimal point.
This will make a difference for items that depend on
the language (some messages, time and date format).
Not fully supported on all systems
2  runtime/doc/os_qnx.txt
View
@@ -1,4 +1,4 @@
-*os_qnx.txt* For Vim version 7.1. Last change: 2005 Mar 29
+*os_qnx.txt* For Vim version 7.2a. Last change: 2005 Mar 29
VIM REFERENCE MANUAL by Julian Kinraid
2  runtime/doc/os_vms.txt
View
@@ -1,4 +1,4 @@
-*os_vms.txt* For Vim version 7.1. Last change: 2006 Nov 18
+*os_vms.txt* For Vim version 7.2a. Last change: 2006 Nov 18
VIM REFERENCE MANUAL
2  runtime/doc/pi_gzip.txt
View
@@ -1,4 +1,4 @@
-*pi_gzip.txt* For Vim version 7.1. Last change: 2002 Oct 29
+*pi_gzip.txt* For Vim version 7.2a. Last change: 2002 Oct 29
VIM REFERENCE MANUAL by Bram Moolenaar
8 runtime/doc/print.txt
View
@@ -1,4 +1,4 @@
-*print.txt* For Vim version 7.1. Last change: 2007 Apr 22
+*print.txt* For Vim version 7.2a. Last change: 2008 Apr 30
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -26,6 +26,9 @@ systems a PostScript file is produced. This can be directly sent to a
PostScript printer. For other printers a program like ghostscript needs to be
used.
+Note: If you have problems printing with |:hardcopy|, an alternative is to use
+|:TOhtml| and print the resulting html file from a browser.
+
*:ha* *:hardcopy* *E237* *E238* *E324*
:[range]ha[rdcopy][!] [arguments]
Send [range] lines (default whole file) to the
@@ -193,7 +196,8 @@ the font. When omitted, the point size is 10.
This defines the format of the header produced in |:hardcopy| output. The
option is defined in the same way as the 'statusline' option. If Vim has not
been compiled with the |+statusline| feature, this option has no effect and a
-simple default header is used, which shows the page number.
+simple default header is used, which shows the page number. The same simple
+header is used when this option is empty.
*pmbcs-option*
'printmbcharset' 'pmbcs' string (default "")
2  runtime/doc/usr_03.txt
View
@@ -1,4 +1,4 @@
-*usr_03.txt* For Vim version 7.1. Last change: 2006 Jun 21
+*usr_03.txt* For Vim version 7.2a. Last change: 2006 Jun 21
VIM USER MANUAL - by Bram Moolenaar
2  runtime/doc/usr_43.txt
View
@@ -1,4 +1,4 @@
-*usr_43.txt* For Vim version 7.1. Last change: 2006 Apr 24
+*usr_43.txt* For Vim version 7.2a. Last change: 2006 Apr 24
VIM USER MANUAL - by Bram Moolenaar
2  runtime/doc/version5.txt
View
@@ -1,4 +1,4 @@
-*version5.txt* For Vim version 7.1. Last change: 2007 May 11
+*version5.txt* For Vim version 7.2a. Last change: 2007 May 11
VIM REFERENCE MANUAL by Bram Moolenaar
2  runtime/doc/visual.txt
View
@@ -1,4 +1,4 @@
-*visual.txt* For Vim version 7.1. Last change: 2006 Sep 26
+*visual.txt* For Vim version 7.2a. Last change: 2006 Sep 26
VIM REFERENCE MANUAL by Bram Moolenaar
68 runtime/ftplugin/gitcommit.vim
View
@@ -0,0 +1,68 @@
+" Vim filetype plugin
+" Language: git config file
+" Maintainer: Tim Pope <vimNOSPAM@tpope.info>
+" Last Change: 2008 Jun 04
+
+" Only do this when not done yet for this buffer
+if (exists("b:did_ftplugin"))
+ finish
+endif
+
+runtime! ftplugin/git.vim
+let b:did_ftplugin = 1
+
+if &textwidth == 0
+ " make sure that log messages play nice with git-log on standard terminals
+ setlocal textwidth=72
+ if !exists("b:undo_ftplugin")
+ let b:undo_ftplugin = ""
+ endif
+ let b:undo_ftplugin = b:undo_ftplugin . "|setl tw<"
+endif
+
+if exists("g:no_gitcommit_commands") || v:version < 700
+ finish
+endif
+
+if !exists("b:git_dir")
+ let b:git_dir = expand("%:p:h")
+endif
+
+" Automatically diffing can be done with:
+" autocmd FileType gitcommit DiffGitCached | wincmd p
+command! -bang -bar -buffer -complete=custom,s:diffcomplete -nargs=* DiffGitCached :call s:gitdiffcached(<bang>0,b:git_dir,<f-args>)
+
+function! s:diffcomplete(A,L,P)
+ let args = ""
+ if a:P <= match(a:L." -- "," -- ")+3
+ let args = args . "-p\n--stat\n--shortstat\n--summary\n--patch-with-stat\n--no-renames\n-B\n-M\n-C\n"
+ end
+ if exists("b:git_dir") && a:A !~ '^-'
+ let tree = fnamemodify(b:git_dir,':h')
+ if strpart(getcwd(),0,strlen(tree)) == tree
+ let args = args."\n".system("git diff --cached --name-only")
+ endif
+ endif
+ return args
+endfunction
+
+function! s:gitdiffcached(bang,gitdir,...)
+ let tree = fnamemodify(a:gitdir,':h')
+ let name = tempname()
+ let git = "git"
+ if strpart(getcwd(),0,strlen(tree)) != tree
+ let git .= " --git-dir=".(exists("*shellescape") ? shellescape(a:gitdir) : '"'.a:gitdir.'"')
+ endif
+ if a:0
+ let extra = join(map(copy(a:000),exists("*shellescape") ? 'shellescape(v:val)' : "'\"'.v:val.'\"'"))
+ else
+ let extra = "-p --stat=".&columns
+ endif
+ call system(git." diff --cached --no-color ".extra." > ".(exists("*shellescape") ? shellescape(name) : name))
+ exe "pedit ".(exists("*fnameescape") ? fnameescape(name) : name)
+ wincmd P
+ let b:git_dir = a:gitdir
+ command! -bang -bar -buffer -complete=custom,s:diffcomplete -nargs=* DiffGitCached :call s:gitdiffcached(<bang>0,b:git_dir,<f-args>)
+ nnoremap <silent> q :q<CR>
+ setlocal buftype=nowrite nobuflisted noswapfile nomodifiable filetype=git
+endfunction
94 runtime/ftplugin/html.vim
View
@@ -1,7 +1,7 @@
" Vim filetype plugin file
" Language: html
" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
-" Last Changed: 2006 Apr 26
+" Last Changed: 2007 Nov 20
" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
if exists("b:did_ftplugin") | finish | endif
@@ -13,63 +13,55 @@ let s:save_cpo = &cpo
set cpo-=C
setlocal commentstring=<!--%s-->
+setlocal matchpairs+=<:>
if exists('&omnifunc')
-" Distinguish between HTML versions
-" To use with other HTML versions add another
-" elseif condition to match proper DOCTYPE
-setlocal omnifunc=htmlcomplete#CompleteTags
+ " Distinguish between HTML versions
+ " To use with other HTML versions add another
+ " elseif condition to match proper DOCTYPE
+ setlocal omnifunc=htmlcomplete#CompleteTags
-if &filetype == 'xhtml'
- let b:html_omni_flavor = 'xhtml10s'
-else
- let b:html_omni_flavor = 'html401t'
-endif
-let i = 1
-while i < 10 && i < line("$")
- let line = getline(i)
- if line =~ '<!DOCTYPE.*\<DTD HTML 3\.2'
- let b:html_omni_flavor = 'html32'
- break
- elseif line =~ '<!DOCTYPE.*\<DTD HTML 4\.0 Transitional'
- let b:html_omni_flavor = 'html40t'
- break
- elseif line =~ '<!DOCTYPE.*\<DTD HTML 4\.0 Frameset'
- let b:html_omni_flavor = 'html40f'
- break
- elseif line =~ '<!DOCTYPE.*\<DTD HTML 4\.0'
- let b:html_omni_flavor = 'html40s'
- break
- elseif line =~ '<!DOCTYPE.*\<DTD HTML 4\.01 Transitional'
- let b:html_omni_flavor = 'html401t'
- break
- elseif line =~ '<!DOCTYPE.*\<DTD HTML 4\.01 Frameset'
- let b:html_omni_flavor = 'html401f'
- break
- elseif line =~ '<!DOCTYPE.*\<DTD HTML 4\.01'
- let b:html_omni_flavor = 'html401s'
- break
- elseif line =~ '<!DOCTYPE.*\<DTD XHTML 1\.0 Transitional'
- let b:html_omni_flavor = 'xhtml10t'
- break
- elseif line =~ '<!DOCTYPE.*\<DTD XHTML 1\.0 Frameset'
- let b:html_omni_flavor = 'xhtml10f'
- break
- elseif line =~ '<!DOCTYPE.*\<DTD XHTML 1\.0 Strict'
- let b:html_omni_flavor = 'xhtml10s'
- break
- elseif line =~ '<!DOCTYPE.*\<DTD XHTML 1\.1'
- let b:html_omni_flavor = 'xhtml11'
- break
- endif
- let i += 1
-endwhile
+ if &filetype == 'xhtml'
+ let b:html_omni_flavor = 'xhtml10s'
+ else
+ let b:html_omni_flavor = 'html401t'
+ endif
+ let i = 1
+ let line = ""
+ while i < 10 && i < line("$")
+ let line = getline(i)
+ if line =~ '<!DOCTYPE.*\<DTD '
+ break
+ endif
+ let i += 1
+ endwhile
+ if line =~ '<!DOCTYPE.*\<DTD ' " doctype line found above
+ if line =~ ' HTML 3\.2'
+ let b:html_omni_flavor = 'html32'
+ elseif line =~ ' XHTML 1\.1'
+ let b:html_omni_flavor = 'xhtml11'
+ else " two-step detection with strict/frameset/transitional
+ if line =~ ' XHTML 1\.0'
+ let b:html_omni_flavor = 'xhtml10'
+ elseif line =~ ' HTML 4\.01'
+ let b:html_omni_flavor = 'html401'
+ elseif line =~ ' HTML 4.0\>'
+ let b:html_omni_flavor = 'html40'
+ endif
+ if line =~ '\<Transitional\>'
+ let b:html_omni_flavor .= 't'
+ elseif line =~ '\<Frameset\>'
+ let b:html_omni_flavor .= 'f'
+ else
+ let b:html_omni_flavor .= 's'
+ endif
+ endif
+ endif
endif
" HTML: thanks to Johannes Zellner and Benji Fisher.
if exists("loaded_matchit")
let b:match_ignorecase = 1
- let b:match_skip = 's:Comment'
let b:match_words = '<:>,' .
\ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' .
\ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' .
@@ -85,7 +77,7 @@ if has("gui_win32")
endif
" Undo the stuff we changed.
-let b:undo_ftplugin = "setlocal commentstring<"
+let b:undo_ftplugin = "setlocal commentstring< matchpairs< omnifunc<"
\ " | unlet! b:match_ignorecase b:match_skip b:match_words b:browsefilter"
" Restore the saved compatibility options.
6 runtime/indent/php.vim
View
@@ -2,7 +2,7 @@
" Language: PHP
" Author: John Wellesz <John.wellesz (AT) teaser (DOT) fr>
" URL: http://www.2072productions.com/vim/indent/php.vim
-" Last Change: 2007 February 25th
+" Last Change: 2007 Jun 24
" Newsletter: http://www.2072productions.com/?to=php-indent-for-vim-newsletter.php
" Version: 1.24
"
@@ -310,11 +310,11 @@ function! ResetOptions()
setlocal comments=s1:/*,mb:*,ex:*/,://,:#
- setlocal formatoptions-=t
+ " setlocal formatoptions-=t
setlocal formatoptions+=q
setlocal formatoptions+=r
setlocal formatoptions+=o
- setlocal formatoptions+=w
+ " setlocal formatoptions+=w
setlocal formatoptions+=c
setlocal formatoptions+=b
endif
2  runtime/indent/sql.vim
View
@@ -36,4 +36,4 @@ endif
exec 'runtime indent/'.filename.'.vim'
-" vim:sw=4:ff=unix:
+" vim:sw=4:
29 runtime/indent/sqlanywhere.vim
View
@@ -1,8 +1,8 @@
" Vim indent file
" Language: SQL
" Maintainer: David Fishburn <fishburn at ianywhere dot com>
-" Last Change: Wed Sep 14 2005 10:21:15 PM
-" Version: 1.4
+" Last Change: Mon Apr 02 2007 9:13:47 AM
+" Version: 1.5
" Download: http://vim.sourceforge.net/script.php?script_id=495
" Notes:
@@ -106,7 +106,7 @@ function s:CheckToIgnoreRightParan( prev_lnum, num_levels )
" if getline(".") =~ '^)'
let matching_paran = searchpair('(', '', ')', 'bW',
- \ 'IsColComment(line("."), col("."))')
+ \ 's:IsColComment(line("."), col("."))')
if matching_paran < 1
" No match found
@@ -165,7 +165,7 @@ function s:GetStmtStarterIndent( keyword, curr_lnum )
\ '\%(\%(\<end\s\+\)\@<!\<if\>\)'.
\ '\)'
let matching_lnum = searchpair(stmts, '', '\<end\>\zs', 'bW',
- \ 'IsColComment(line("."), col(".")) == 1')
+ \ 's:IsColComment(line("."), col(".")) == 1')
exec 'normal! $'
if matching_lnum > 0 && matching_lnum < a:curr_lnum
let ind = indent(matching_lnum)
@@ -177,7 +177,7 @@ function s:GetStmtStarterIndent( keyword, curr_lnum )
\ '',
\ '\%(\%(\<when\s\+others\>\)\|\%(\<end\s\+case\>\)\)',
\ 'bW',
- \ 'IsColComment(line("."), col(".")) == 1')
+ \ 's:IsColComment(line("."), col(".")) == 1')
exec 'normal! $'
if matching_lnum > 0 && matching_lnum < a:curr_lnum
let ind = indent(matching_lnum)
@@ -191,7 +191,7 @@ endfunction
" Check if the line is a comment
-function IsLineComment(lnum)
+function s:IsLineComment(lnum)
let rc = synIDattr(
\ synID(a:lnum,
\ match(getline(a:lnum), '\S')+1, 0)
@@ -203,7 +203,7 @@ endfunction
" Check if the column is a comment
-function IsColComment(lnum, cnum)
+function s:IsColComment(lnum, cnum)
let rc = synIDattr(synID(a:lnum, a:cnum, 0), "name")
\ =~? "comment"
@@ -211,8 +211,9 @@ function IsColComment(lnum, cnum)
endfunction
-" Check if the column is a comment
-function ModuloIndent(ind)
+" Instead of returning a column position, return
+" an appropriate value as a factor of shiftwidth.
+function s:ModuloIndent(ind)
let ind = a:ind
if ind > 0
@@ -235,7 +236,7 @@ function GetSQLIndent()
" If the current line is a comment, leave the indent as is
" Comment out this additional check since it affects the
" indenting of =, and will not reindent comments as it should
- " if IsLineComment(lnum) == 1
+ " if s:IsLineComment(lnum) == 1
" return ind
" endif
@@ -246,9 +247,9 @@ function GetSQLIndent()
return ind
endif
- if IsLineComment(prevlnum) == 1
+ if s:IsLineComment(prevlnum) == 1
if getline(v:lnum) =~ '^\s*\*'
- let ind = ModuloIndent(indent(prevlnum))
+ let ind = s:ModuloIndent(indent(prevlnum))
return ind + 1
endif
" If the previous line is a comment, then return -1
@@ -378,7 +379,7 @@ function GetSQLIndent()
endif
" echom 'final - indent ' . ind
- return ModuloIndent(ind)
+ return s:ModuloIndent(ind)
endfunction
-" vim:sw=4:ff=unix:
+" vim:sw=4:
31 runtime/indent/vhdl.vim
View
@@ -1,8 +1,8 @@
" VHDL indent ('93 syntax)
" Language: VHDL
" Maintainer: Gerald Lai <laigera+vim?gmail.com>
-" Version: 1.50
-" Last Change: 2007 Jan 29
+" Version: 1.54
+" Last Change: 2007 Aug 17
" URL: http://www.vim.org/scripts/script.php?script_id=1450
" only load this indent file when no other was loaded
@@ -28,13 +28,13 @@ let s:ES = '\s*\%(--.*\)\=$'
let s:NE = '\%(\<end\s\+\)\@<!'
" option to disable alignment of generic/port mappings
-if !exists("g:vhdl_align_genportmap")
- let g:vhdl_align_genportmap = 1
+if !exists("g:vhdl_indent_genportmap")
+ let g:vhdl_indent_genportmap = 1
endif
" option to disable alignment of right-hand side assignment "<=" statements
-if !exists("g:vhdl_align_rhsassign")
- let g:vhdl_align_rhsassign = 1
+if !exists("g:vhdl_indent_rhsassign")
+ let g:vhdl_indent_rhsassign = 1
endif
" only define indent function once
@@ -54,6 +54,7 @@ function GetVHDLindent()
let prevn = prevnonblank(prevn - 1)
let prevs = getline(prevn)
endwhile
+ let prevs_noi = substitute(prevs, '^\s*', '', '')
" default indent starts as previous non-comment line's indent
let ind = prevn > 0 ? indent(prevn) : 0
@@ -77,8 +78,8 @@ function GetVHDLindent()
if curs =~ '^\s*--'
let pn = curn - 1
let ps = getline(pn)
- if ps =~ '--'
- return stridx(ps, '--')
+ if curs =~ '^\s*--\s' && ps =~ '--'
+ return indent(pn) + stridx(substitute(ps, '^\s*', '', ''), '--')
else
" find nextnonblank line that is not a comment
let nn = nextnonblank(curn + 1)
@@ -106,14 +107,14 @@ function GetVHDLindent()
if (curs =~ '^\s*)' || curs =~? '^\s*\%(\<\%(generic\|map\|port\)\>.*\)\@<!\S\+\s*\%(=>\s*\S\+\|:[^=]\@=\s*\%(\%(in\|out\|inout\|buffer\|linkage\)\>\|\w\+\s\+:=\)\)') && (prevs =~? s:NC.'\<\%(generic\|map\|port\)\s*(\%(\s*\w\)\=' || (ps =~? s:NC.'\<\%(generic\|map\|port\)'.s:ES && prevs =~ '^\s*('))
" align closing ")" with opening "("
if curs =~ '^\s*)'
- return stridx(prevs, '(')
+ return ind2 + stridx(prevs_noi, '(')
endif
- let m = matchend(prevs, '(\s*\ze\w')
+ let m = matchend(prevs_noi, '(\s*\ze\w')
if m != -1
- return m
+ return ind2 + m
else
- if g:vhdl_align_genportmap
- return stridx(prevs, '(') + &sw
+ if g:vhdl_indent_genportmap
+ return ind2 + stridx(prevs_noi, '(') + &sw
else
return ind2 + &sw
endif
@@ -124,8 +125,8 @@ function GetVHDLindent()
" keywords: variable + "<=" without ";" ending
" where: start of previous line
if prevs =~? '^\s*\S\+\s*<=[^;]*'.s:ES
- if g:vhdl_align_rhsassign
- return matchend(prevs, '<=\s*\ze.')
+ if g:vhdl_indent_rhsassign
+ return ind2 + matchend(prevs_noi, '<=\s*\ze.')
else
return ind2 + &sw
endif
42 runtime/keymap/sinhala-phonetic_utf-8.vim
View
@@ -1,7 +1,7 @@
" Vim Keymap file for Sinhala (Sri Lanka) (2003-11-02)
" Maintainer : Harshula Jayasuriya <harshula@gmail.com>
-" Last Updated: 2006-06-08
-" This is a static phonetic mapping for a standard US-English keyboard
+" Last Updated: 2007-06-30
+" This is a phonetic static mapping for a standard US-English keyboard
" (qwerty)
" http://www.nongnu.org/sinhala/doc/keymaps/sinhala-keyboard_3.html
@@ -48,18 +48,18 @@ J <char-0x0da3> " ඣ - mahaapraana jayanna (jha)
z <char-0x0da4> " ඤ - taaluja naasikyaya (nya)
Z <char-0x0da5> " ඥ - taaluja sanyooga naasikyaya (jnya)
<A-j> <char-0x0da6> " ඦ - sanyaka jayanna (nyja)
-t <char-0x0da7> " ට - alpapraana ttayanna (tta)
-T <char-0x0da8> " ඨ - mahaapraana ttayanna (ttha)
-d <char-0x0da9> " ඩ - alpapraana ddayanna (dda)
-D <char-0x0daa> " ඪ - mahaapraana ddayanna (ddha)
+<A-t> <char-0x0da7> " ට - alpapraana ttayanna (tta)
+<A-T> <char-0x0da8> " ඨ - mahaapraana ttayanna (ttha)
+<A-d> <char-0x0da9> " ඩ - alpapraana ddayanna (dda)
+<A-D> <char-0x0daa> " ඪ - mahaapraana ddayanna (ddha)
N <char-0x0dab> " ණ - muurdhaja nayanna (nna)
-x <char-0x0dac> " ඬ - sanyaka ddayanna (nndda)
-<A-t> <char-0x0dad> " ත - alpapraana tayanna (ta)
-<A-T> <char-0x0dae> " ථ - mahaapraana tayanna (tha)
-<A-d> <char-0x0daf> " ද - alpapraana dayanna (da)
-<A-D> <char-0x0db0> " ධ - mahaapraana dayanna (dha)
+X <char-0x0dac> " ඬ - sanyaka ddayanna (nndda)
+t <char-0x0dad> " ත - alpapraana tayanna (ta)
+T <char-0x0dae> " ථ - mahaapraana tayanna (tha)
+d <char-0x0daf> " ද - alpapraana dayanna (da)
+D <char-0x0db0> " ධ - mahaapraana dayanna (dha)
n <char-0x0db1> " න - dantaja nayanna (na)
-X <char-0x0db3> " ඳ - sanyaka dayanna (nda)
+x <char-0x0db3> " ඳ - sanyaka dayanna (nda)
p <char-0x0db4> " ප - alpapraana payanna (pa)
P <char-0x0db5> " ඵ - mahaapraana payanna (pha)
b <char-0x0db6> " බ - alpapraana bayanna (ba)
@@ -70,13 +70,13 @@ y <char-0x0dba> " ය - yayanna (ya)
r <char-0x0dbb> " ර - rayanna (ra)
l <char-0x0dbd> " ල - dantaja layanna (la)
v <char-0x0dc0> " ව - vayanna (va)
-<A-s> <char-0x0dc1> " ශ - taaluja sayanna (sha)
-S <char-0x0dc2> " ෂ - muurdhaja sayanna (ssa)
+S <char-0x0dc1> " ශ - taaluja sayanna (sha)
+<A-s> <char-0x0dc2> " ෂ - muurdhaja sayanna (ssa)
s <char-0x0dc3> " ස - dantaja sayanna (sa)
h <char-0x0dc4> " හ - hayanna (ha)
L <char-0x0dc5> " ළ - muurdhaja layanna (lla)
f <char-0x0dc6> " ෆ - fayanna (fa)
-<A-a> <char-0x0dca> " ් - al-lakuna
+<A-a> <char-0x0dca> " ් - al-lakuna
<A-A> <char-0x0dcf> " ා - aela-pilla (aa)
<A-w> <char-0x0dd0> " ැ - ketti aeda-pilla (ae)
<A-W> <char-0x0dd1> " ෑ - diga aeda-pilla (aae)
@@ -96,12 +96,12 @@ f <char-0x0dc6> " ෆ - fayanna (fa)
<A-L> <char-0x0df3> " ෳ - diga gayanukitta (ll)
<A-.> <char-0x0df4> " ෴ - kunddaliya (punctuation)
-R <char-0x0dca><char-0x200d><char-0x0dbb> " ්‍ර - rakaransaya
+R <char-0x0dca><char-0x200d><char-0x0dbb> " ්‍ර - rakaaranshaya
Y <char-0x0dca><char-0x200d><char-0x0dba> " ්‍ය - yansaya
-<A-r> <char-0x0dbb><char-0x0dca><char-0x200d> " ර්‍ - repaya
+<A-r> <char-0x0dbb><char-0x0dca><char-0x200d> " ර්‍ - repaya
-<A-\> <char-0x0dca><char-0x200d> " join - conjunct letters cons 0DCA ZWJ cons
-<A-|> <char-0x200d><char-0x0dca> " touch - cons ZWJ 0DCA cons
+<A-,> <char-0x0dca><char-0x200d> " join - conjunct letters cons 0DCA ZWJ cons
+<A-/> <char-0x200d><char-0x0dca> " touch - cons ZWJ 0DCA cons
-<S-space> <char-0x00a0> " - no-break space. <S-space> didn't work.
-<C-space> <char-0x200c> " - ZWNJ. <A-space> doesn't work!
+<C-space> <char-0x00a0> " - no-break space. <S-space> didn't work.
+<A-space> <char-0x200c> " - ZWNJ. <A-space> doesn't work!
4 runtime/keymap/ukrainian-jcuken.vim
View
@@ -4,7 +4,7 @@
" Useful mainly with utf-8 but may work with other encodings
" Maintainer: Anatoli Sakhnik <sakhnik@gmail.com>
-" Last Changed: 2006 Mar 15
+" Last Changed: 2007 Nov 11
" All characters are given literally, conversion to another encoding (e.g.,
" UTF-8) should work.
@@ -88,3 +88,5 @@ $ *
^ ,
& .
* ;
+~ ~
+~~ <char-0x301> Stress
15 runtime/macros/less.sh
View
@@ -2,8 +2,17 @@
# Shell script to start Vim with less.vim.
# Read stdin if no arguments were given.
-if test $# = 0; then
- vim --cmd 'let no_plugin_maps = 1' -c 'runtime! macros/less.vim' -
+if test -t 1; then
+ if test $# = 0; then
+ vim --cmd 'let no_plugin_maps = 1' -c 'runtime! macros/less.vim' -
+ else
+ vim --cmd 'let no_plugin_maps = 1' -c 'runtime! macros/less.vim' "$@"
+ fi
else
- vim --cmd 'let no_plugin_maps = 1' -c 'runtime! macros/less.vim' "$@"
+ # Output is not a terminal, cat arguments or stdin
+ if test $# = 0; then
+ cat
+ else
+ cat "$@"
+ fi
fi
14 runtime/plugin/vimballPlugin.vim
View
@@ -1,6 +1,6 @@
" vimballPlugin : construct a file containing both paths and files
" Author: Charles E. Campbell, Jr.
-" Copyright: (c) 2004-2006 by Charles E. Campbell, Jr.
+" Copyright: (c) 2004-2007 by Charles E. Campbell, Jr.
" The VIM LICENSE applies to Vimball.vim, and Vimball.txt
" (see |copyright|) except use "Vimball" instead of "Vim".
" No warranty, express or implied.
@@ -16,18 +16,18 @@
if &cp || exists("g:loaded_vimballPlugin")
finish
endif
-let g:loaded_vimballPlugin = 1
+let g:loaded_vimballPlugin = "v27"
let s:keepcpo = &cpo
set cpo&vim
" ------------------------------------------------------------------------------
" Public Interface: {{{1
-com! -ra -complete=dir -na=+ -bang MkVimball call vimball#MkVimball(<line1>,<line2>,<bang>0,<f-args>)
-com! -na=? -complete=dir UseVimball call vimball#Vimball(1,<f-args>)
-com! -na=0 VimballList call vimball#Vimball(0)
-com! -na=* -complete=dir RmVimball call vimball#RmVimball(<f-args>)
+com! -ra -complete=file -na=+ -bang MkVimball call vimball#MkVimball(<line1>,<line2>,<bang>0,<f-args>)
+com! -na=? -complete=dir UseVimball call vimball#Vimball(1,<f-args>)
+com! -na=0 VimballList call vimball#Vimball(0)
+com! -na=* -complete=dir RmVimball call vimball#SaveSettings()|call vimball#RmVimball(<f-args>)|call vimball#RestoreSettings()
au BufEnter *.vba.gz,*.vba.bz2,*.vba.zip call vimball#Decompress(expand("<amatch>"))
-au BufEnter *.vba setlocal noma bt=nofile fmr=[[[,]]] fdm=marker|call vimball#ShowMesg(0,"Source this file to extract it! (:so %)")
+au BufEnter *.vba setlocal ff=unix noma bt=nofile fmr=[[[,]]] fdm=marker|call vimball#ShowMesg(0,"Source this file to extract it! (:so %)")
" =====================================================================
" Restoration And Modelines: {{{1
13 runtime/spell/cleanadd.vim
View
@@ -1,6 +1,6 @@
" Vim script to clean the ll.xxxxx.add files of commented out entries
" Author: Antonio Colombo, Bram Moolenaar
-" Last Update: 2006 Jan 19
+" Last Update: 2008 Jun 3
" Time in seconds after last time an ll.xxxxx.add file was updated
" Default is one second.
@@ -14,12 +14,19 @@ endif
" Delete all comment lines, except the ones starting with ##.
for s:fname in split(globpath(&rtp, "spell/*.add"), "\n")
if filewritable(s:fname) && localtime() - getftime(s:fname) > g:spell_clean_limit
- silent exe "tab split " . escape(s:fname, ' \')
- echo "Processing" s:fname
+ if exists('*fnameescape')
+ let s:f = fnameescape(s:fname)
+ else
+ let s:f = escape(s:fname, ' \|<')
+ endif
+ silent exe "tab split " . s:f
+ echo "Processing" s:f
silent! g/^#[^#]/d
silent update
close
+ unlet s:f
endif
endfor
+unlet s:fname
echo "Done"
4 runtime/syntax/cmusrc.vim
View
@@ -1,6 +1,6 @@
" Vim syntax file
" Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2006-07-22
+" Latest Revision: 2007-06-17
if exists("b:current_syntax")
finish
@@ -9,7 +9,7 @@ endif
let s:cpo_save = &cpo
set cpo&vim
-setlocal iskeyword=@,48-57,_,-
+setlocal iskeyword+=-
syn keyword cmusrcTodo contained TODO FIXME XXX NOTE
6 runtime/syntax/gp.vim
View
@@ -1,7 +1,7 @@
" Vim syntax file
-" Language: gp (version 2.2)
+" Language: gp (version 2.4)
" Maintainer: Karim Belabas <Karim.Belabas@math.u-bordeaux.fr>
-" Last change: 2006 Apr 12
+" Last change: 2007 Oct 1
" URL: http://pari.math.u-bordeaux.fr
if version < 600
@@ -15,7 +15,7 @@ syntax keyword gpStatement break return next
syntax keyword gpConditional if
syntax keyword gpRepeat until while for fordiv forprime forstep forvec
" storage class
-syntax keyword gpScope local global
+syntax keyword gpScope my local global
" defaults
syntax keyword gpInterfaceKey colors compatible datadir debug debugfiles
syntax keyword gpInterfaceKey debugmem echo factor_add_primes format help
9 runtime/syntax/manual.vim
View
@@ -1,6 +1,6 @@
" Vim syntax support file
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2001 Jun 04
+" Last Change: 2008 Jan 26
" This file is used for ":syntax manual".
" It installs the Syntax autocommands, but no the FileType autocommands.
@@ -17,9 +17,12 @@ endif
let syntax_manual = 1
" Remove the connection between FileType and Syntax autocommands.
-silent! au! syntaxset FileType
+if exists('#syntaxset')
+ au! syntaxset FileType
+endif
" If the GUI is already running, may still need to install the FileType menu.
-if has("gui_running") && !exists("did_install_syntax_menu")
+" Don't do it when the 'M' flag is included in 'guioptions'.
+if has("menu") && has("gui_running") && !exists("did_install_syntax_menu") && &guioptions !~# 'M'
source $VIMRUNTIME/menu.vim
endif
135 runtime/syntax/msmessages.vim
View
@@ -0,0 +1,135 @@
+" Vim syntax file
+" Language: MS Message Text files (*.mc)
+" Maintainer: Kevin Locke <kwl7@cornell.edu>
+" Last Change: 2008 April 09
+" Location: http://kevinlocke.name/programs/vim/syntax/msmessages.vim
+
+" See format description at <http://msdn2.microsoft.com/en-us/library/aa385646.aspx>
+" This file is based on the rc.vim and c.vim
+
+" 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
+
+" Common MS Messages keywords
+syn case ignore
+syn keyword msmessagesIdentifier MessageIdTypedef
+syn keyword msmessagesIdentifier SeverityNames
+syn keyword msmessagesIdentifier FacilityNames
+syn keyword msmessagesIdentifier LanguageNames
+syn keyword msmessagesIdentifier OutputBase
+
+syn keyword msmessagesIdentifier MessageId
+syn keyword msmessagesIdentifier Severity
+syn keyword msmessagesIdentifier Facility
+syn keyword msmessagesIdentifier OutputBase
+
+syn match msmessagesIdentifier /\<SymbolicName\>/ nextgroup=msmessagesIdentEq skipwhite
+syn match msmessagesIdentEq transparent /=/ nextgroup=msmessagesIdentDef skipwhite contained
+syn match msmessagesIdentDef display /\w\+/ contained
+" Note: The Language keyword is highlighted as part of an msmessagesLangEntry
+
+" Set value
+syn case match
+syn region msmessagesSet start="(" end=")" transparent fold contains=msmessagesName keepend
+syn match msmessagesName /\w\+/ nextgroup=msmessagesSetEquals skipwhite contained
+syn match msmessagesSetEquals /=/ display transparent nextgroup=msmessagesNumVal skipwhite contained
+syn match msmessagesNumVal display transparent "\<\d\|\.\d" contains=msmessagesNumber,msmessagesFloat,msmessagesOctalError,msmessagesOctal nextgroup=msmessagesValSep
+syn match msmessagesValSep /:/ display nextgroup=msmessagesNameDef contained
+syn match msmessagesNameDef /\w\+/ display contained
+
+
+" Comments are converted to C source (by removing leading ;)
+" So we highlight the comments as C
+syn include @msmessagesC syntax/c.vim
+unlet b:current_syntax
+syn region msmessagesCComment matchgroup=msmessagesComment start=/;/ end=/$/ contains=@msmessagesC keepend
+
+" String and Character constants
+" Highlight special characters (those which have a escape) differently
+syn case ignore
+syn region msmessagesLangEntry start=/\<Language\>\s*=\s*\S\+\s*$/hs=e+1 end=/^\./ contains=msmessagesFormat,msmessagesLangEntryEnd,msmessagesLanguage keepend
+syn match msmessagesLanguage /\<Language\(\s*=\)\@=/ contained
+syn match msmessagesLangEntryEnd display /^\./ contained
+syn case match
+syn match msmessagesFormat display /%[1-9]\d\?\(![-+0 #]*\d*\(\.\d\+\)\?\(h\|l\|ll\|I\|I32\|I64\)\?[aAcCdeEfgGinopsSuxX]!\)\?/ contained
+syn match msmessagesFormat display /%[0.%\\br]/ contained
+syn match msmessagesFormat display /%!\(\s\)\@=/ contained
+
+" Integer number, or floating point number without a dot and with "f".
+" Copied from c.vim
+syn case ignore
+"(long) integer
+syn match msmessagesNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
+"hex number
+syn match msmessagesNumber display contained "\<0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
+" Flag the first zero of an octal number as something special
+syn match msmessagesOctal display contained "\<0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=msmessagesOctalZero
+syn match msmessagesOctalZero display contained "\<0"
+" flag an octal number with wrong digits
+syn match msmessagesOctalError display contained "\<0\o*[89]\d*"
+syn match msmessagesFloat display contained "\d\+f"
+"floating point number, with dot, optional exponent
+syn match msmessagesFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\="
+"floating point number, starting with a dot, optional exponent
+syn match msmessagesFloat display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
+"floating point number, without dot, with exponent
+syn match msmessagesFloat display contained "\d\+e[-+]\=\d\+[fl]\=\>"
+"hexadecimal floating point number, optional leading digits, with dot, with exponent
+syn match msmessagesFloat display contained "0x\x*\.\x\+p[-+]\=\d\+[fl]\=\>"
+"hexadecimal floating point number, with leading digits, optional dot, with exponent
+syn match msmessagesFloat display contained "0x\x\+\.\=p[-+]\=\d\+[fl]\=\>"
+
+" Types (used in MessageIdTypedef statement)
+syn case match
+syn keyword msmessagesType int long short char
+syn keyword msmessagesType signed unsigned
+syn keyword msmessagesType size_t ssize_t sig_atomic_t
+syn keyword msmessagesType int8_t int16_t int32_t int64_t
+syn keyword msmessagesType uint8_t uint16_t uint32_t uint64_t
+syn keyword msmessagesType int_least8_t int_least16_t int_least32_t int_least64_t
+syn keyword msmessagesType uint_least8_t uint_least16_t uint_least32_t uint_least64_t
+syn keyword msmessagesType int_fast8_t int_fast16_t int_fast32_t int_fast64_t
+syn keyword msmessagesType uint_fast8_t uint_fast16_t uint_fast32_t uint_fast64_t
+syn keyword msmessagesType intptr_t uintptr_t
+syn keyword msmessagesType intmax_t uintmax_t
+" Add some Windows datatypes that will be common in msmessages files
+syn keyword msmessagesType BYTE CHAR SHORT SIZE_T SSIZE_T TBYTE TCHAR UCHAR USHORT
+syn keyword msmessagesType DWORD DWORDLONG DWORD32 DWORD64
+syn keyword msmessagesType INT INT32 INT64 UINT UINT32 UINT64
+syn keyword msmessagesType LONG LONGLONG LONG32 LONG64
+syn keyword msmessagesType ULONG ULONGLONG ULONG32 ULONG64
+
+" Sync to language entries, since they should be most common
+syn sync match msmessagesLangSync grouphere msmessagesLangEntry "\<Language\s*="
+syn sync match msmessagesLangEndSync grouphere NONE "^\."
+
+" Define the default highlighting.
+hi def link msmessagesNumber Number
+hi def link msmessagesOctal Number
+hi def link msmessagesFloat Float
+hi def link msmessagesOctalError msmessagesError
+hi def link msmessagesSetError msmessagesError
+hi def link msmessagesError Error
+hi def link msmessagesLangEntry String
+hi def link msmessagesLangEntryEnd Special
+hi def link msmessagesComment Comment
+hi def link msmessagesFormat msmessagesSpecial
+hi def link msmessagesSpecial SpecialChar
+
+hi def link msmessagesType Type
+hi def link msmessagesIdentifier Identifier
+hi def link msmessagesLanguage msmessagesIdentifier
+hi def link msmessagesName msmessagesIdentifier
+hi def link msmessagesNameDef Macro
+hi def link msmessagesIdentDef Macro
+hi def link msmessagesValSep Special
+hi def link msmessagesNameErr Error
+
+let b:current_syntax = "msmessages"
+
+" vim: ts=8
66 runtime/syntax/netrw.vim
View
@@ -1,7 +1,7 @@
" Language : Netrw Remote-Directory Listing Syntax
" Maintainer : Charles E. Campbell, Jr.
-" Last change: Nov 27, 2006
-" Version : 9
+" Last change: Feb 06, 2008
+" Version : 12
" ---------------------------------------------------------------------
" Syntax Clearing: {{{1
@@ -13,40 +13,59 @@ endif
" ---------------------------------------------------------------------
" Directory List Syntax Highlighting: {{{1
-syn cluster NetrwGroup contains=netrwHide,netrwSortBy,netrwSortSeq,netrwQuickHelp,netrwVersion
+syn cluster NetrwGroup contains=netrwHide,netrwSortBy,netrwSortSeq,netrwQuickHelp,netrwVersion,netrwCopyTgt
+syn cluster NetrwTreeGroup contains=netrwDir,netrwSymLink,netrwExe
-syn match netrwSpecial "\%(\S\+ \)*\S\+[*|=]\ze\%(\s\{2,}\|$\)" contains=netrwClassify
-syn match netrwDir "\.\{1,2}/" contains=netrwClassify
-syn match netrwDir "\%(\S\+ \)*\S\+/" contains=netrwClassify
-syn match netrwDir "^\S*/" contains=netrwClassify
-syn match netrwSizeDate "\<\d\+\s\d\{1,2}/\d\{1,2}/\d\{4}\s" contains=netrwDateSep skipwhite nextgroup=netrwTime
-syn match netrwSymLink "\%(\S\+ \)*\S\+@\ze\%(\s\{2,}\|$\)" contains=netrwClassify
-syn match netrwExe "\%(\S\+ \)*\S\+\*\ze\%(\s\{2,}\|$\)" contains=netrwClassify,netrwTreeIgnore
-syn match netrwTreeIgnore contained "^\%(| \)*"
+syn match netrwSpecial "\%(\S\+ \)*\S\+[*|=]\ze\%(\s\{2,}\|$\)" contains=netrwClassify
+syn match netrwDir "\.\{1,2}/" contains=netrwClassify
+syn match netrwDir "\%(\S\+ \)*\S\+/" contains=netrwClassify
+syn match netrwSizeDate "\<\d\+\s\d\{1,2}/\d\{1,2}/\d\{4}\s" contains=netrwDateSep skipwhite nextgroup=netrwTime
+syn match netrwSymLink "\%(\S\+ \)*\S\+@\ze\%(\s\{2,}\|$\)" contains=netrwClassify
+syn match netrwExe "\%(\S\+ \)*\S\+\*\ze\%(\s\{2,}\|$\)" contains=netrwClassify
+syn match netrwTreeBar "^\%(| \)*" contains=netrwTreeBarSpace nextgroup=@netrwTreeGroup
+syn match netrwTreeBarSpace " " contained
syn match netrwClassify "[*=|@/]\ze\%(\s\{2,}\|$\)" contained
syn match netrwDateSep "/" contained
-syn match netrwTime "\d\{1,2}:\d\{2}:\d\{2}" contained contains=netrwTimeSep
+syn match netrwTime "\d\{1,2}:\d\{2}:\d\{2}" contained contains=netrwTimeSep
syn match netrwTimeSep ":"
-syn match netrwComment '".*\%(\t\|$\)' contains=@NetrwGroup
+syn match netrwComment '".*\%(\t\|$\)' contains=@NetrwGroup
syn match netrwHide '^"\s*\(Hid\|Show\)ing:' skipwhite nextgroup=netrwHidePat
syn match netrwSlash "/" contained
syn match netrwHidePat "[^,]\+" contained skipwhite nextgroup=netrwHideSep
syn match netrwHideSep "," contained transparent skipwhite nextgroup=netrwHidePat
syn match netrwSortBy "Sorted by" contained transparent skipwhite nextgroup=netrwList
syn match netrwSortSeq "Sort sequence:" contained transparent skipwhite nextgroup=netrwList
-syn match netrwList ".*$" contained contains=netrwComma
+syn match netrwCopyTgt "Copy/Move Tgt:" contained transparent skipwhite nextgroup=netrwList
+syn match netrwList ".*$" contained contains=netrwComma
syn match netrwComma "," contained
-syn region netrwQuickHelp matchgroup=Comment start="Quick Help:\s\+" end="$" contains=netrwHelpCmd keepend contained
+syn region netrwQuickHelp matchgroup=Comment start="Quick Help:\s\+" end="$" contains=netrwHelpCmd keepend contained
syn match netrwHelpCmd "\S\ze:" contained skipwhite nextgroup=netrwCmdSep
syn match netrwCmdSep ":" contained nextgroup=netrwCmdNote
syn match netrwCmdNote ".\{-}\ze " contained
syn match netrwVersion "(netrw.*)" contained
+" -----------------------------
+" Special filetype highlighting {{{1
+" -----------------------------
+if exists("g:netrw_special_syntax") && netrw_special_syntax
+ syn match netrwBak "\(\S\+ \)*\S\+\.bak\>" contains=netrwTreeBar
+ syn match netrwCompress "\(\S\+ \)*\S\+\.\%(gz\|bz2\|Z\|zip\)\>" contains=netrwTreeBar
+ syn match netrwData "\(\S\+ \)*\S\+\.dat\>" contains=netrwTreeBar
+ syn match netrwHdr "\(\S\+ \)*\S\+\.h\>" contains=netrwTreeBar
+ syn match netrwLib "\(\S\+ \)*\S*\.\%(a\|so\|lib\|dll\)\>" contains=netrwTreeBar
+ syn match netrwMakeFile "\<[mM]akefile\>\|\(\S\+ \)*\S\+\.mak\>" contains=netrwTreeBar
+ syn match netrwObj "\(\S\+ \)*\S*\.\%(o\|obj\)\>" contains=netrwTreeBar
+ syn match netrwTags "\<tags\>" contains=netrwTreeBar
+ syn match netrwTags "\<\(ANmenu\|ANtags\)\>" contains=netrwTreeBar
+ syn match netrwTilde "\(\S\+ \)*\S\+\~\>" contains=netrwTreeBar
+ syn match netrwTmp "\<tmp\(\S\+ \)*\S\+\>\|\(\S\+ \)*\S*tmp\>" contains=netrwTreeBar
+endif
+
" ---------------------------------------------------------------------
" Highlighting Links: {{{1
-if !exists("did_drchip_dbg_syntax")
+if !exists("did_drchip_netrwlist_syntax")
let did_drchip_netrwlist_syntax= 1
hi link netrwClassify Function
hi link netrwCmdSep Delimiter
@@ -56,13 +75,26 @@ if !exists("did_drchip_dbg_syntax")
hi link netrwHidePat Statement
hi link netrwList Statement
hi link netrwVersion Identifier
- hi link netrwSymLink Special
+ hi link netrwSymLink Question
hi link netrwExe PreProc
hi link netrwDateSep Delimiter
+ hi link netrwTreeBar Special
hi link netrwTimeSep netrwDateSep
hi link netrwComma netrwComment
hi link netrwHide netrwComment
+ hi link netrwMarkFile Identifier
+
+ " special syntax highlighting (see :he g:netrw_special_syntax)
+ hi link netrwBak NonText
+ hi link netrwCompress Folded
+ hi link netrwData DiffChange
+ hi link netrwLib DiffChange
+ hi link netrwMakefile DiffChange
+ hi link netrwObj Folded
+ hi link netrwTilde Folded
+ hi link netrwTmp Folded
+ hi link netrwTags Folded
endif
" Current Syntax: {{{1
73 runtime/syntax/pdf.vim
View
@@ -0,0 +1,73 @@
+" Vim syntax file
+" Language: PDF
+" Maintainer: Tim Pope <vimNOSPAM@tpope.info>
+" Last Change: 2007 Dec 16
+
+if exists("b:current_syntax")
+ finish
+endif
+
+if !exists("main_syntax")
+ let main_syntax = 'pdf'
+endif
+
+syn include @pdfXML syntax/xml.vim
+
+syn case match
+
+syn cluster pdfObjects contains=pdfBoolean,pdfConstant,pdfNumber,pdfFloat,pdfName,pdfHexString,pdfString,pdfArray,pdfHash,pdfReference,pdfComment
+syn keyword pdfBoolean true false contained
+syn keyword pdfConstant null contained
+syn match pdfNumber "[+-]\=\<\d\+\>"
+syn match pdfFloat "[+-]\=\<\%(\d\+\.\|\d*\.\d\+\)\>" contained
+
+syn match pdfNameError "#\X\|#\x\X\|#00" contained containedin=pdfName
+syn match pdfSpecialChar "#\x\x" contained containedin=pdfName
+syn match pdfName "/[^[:space:]\[\](){}<>/]*" contained
+syn match pdfHexError "[^[:space:][:xdigit:]<>]" contained
+"syn match pdfHexString "<\s*\x[^<>]*\x\s*>" contained contains=pdfHexError
+"syn match pdfHexString "<\s*\x\=\s*>" contained
+syn region pdfHexString matchgroup=pdfDelimiter start="<<\@!" end=">" contained contains=pdfHexError
+syn match pdfStringError "\\." contained containedin=pdfString
+syn match pdfSpecialChar "\\\%(\o\{1,3\}\|[nrtbf()\\]\)" contained containedin=pdfString
+syn region pdfString matchgroup=pdfDelimiter start="\\\@<!(" end="\\\@<!)" contains=pdfString
+
+syn region pdfArray matchgroup=pdfOperator start="\[" end="\]" contains=@pdfObjects contained
+syn region pdfHash matchgroup=pdfOperator start="<<" end=">>" contains=@pdfObjects contained
+syn match pdfReference "\<\d\+\s\+\d\+\s\+R\>"
+"syn keyword pdfOperator R contained containedin=pdfReference
+
+syn region pdfObject matchgroup=pdfType start="\<obj\>" end="\<endobj\>" contains=@pdfObjects
+syn region pdfObject matchgroup=pdfType start="\<obj\r\=\n" end="\<endobj\>" contains=@pdfObjects fold
+
+" Do these twice. The ones with only newlines are foldable
+syn region pdfStream matchgroup=pdfType start="\<stream\r\=\n" end="endstream\s*\%(\r\|\n\|\r\n\)" contained containedin=pdfObject
+syn region pdfXMLStream matchgroup=pdfType start="\<stream\r\=\n\_s*\%(<?\)\@=" end="endstream\s*\%(\r\|\n\|\r\n\)" contained containedin=pdfObject contains=@pdfXML
+syn region pdfStream matchgroup=pdfType start="\<stream\n" end="endstream\s*\%(\r\|\n\|\r\n\)" contained containedin=pdfObject fold
+syn region pdfXMLStream matchgroup=pdfType start="\<stream\n\_s*\%(<?\)\@=" end="endstream\s*\%(\r\|\n\|\r\n\)" contained containedin=pdfObject contains=@pdfXML fold
+
+syn region pdfPreProc start="\<xref\%(\r\|\n\|\r\n\)" end="^trailer\%(\r\|\n\|\r\n\)" skipwhite skipempty nextgroup=pdfHash contains=pdfNumber fold
+syn keyword pdfPreProc startxref
+syn match pdfComment "%.*\%(\r\|\n\)" contains=pdfPreProc
+syn match pdfPreProc "^%\%(%EOF\|PDF-\d\.\d\)\(\r\|\n\)"
+
+hi def link pdfOperator Operator
+hi def link pdfNumber Number
+hi def link pdfFloat Float
+hi def link pdfBoolean Boolean
+hi def link pdfConstant Constant
+hi def link pdfName Identifier
+hi def link pdfNameError pdfStringError
+hi def link pdfHexString pdfString
+hi def link pdfHexError pdfStringError
+hi def link pdfString String
+hi def link pdfStringError Error
+hi def link pdfSpecialChar SpecialChar
+hi def link pdfDelimiter Delimiter
+hi def link pdfType Type
+hi def link pdfReference Tag
+hi def link pdfStream NonText
+hi def link pdfPreProc PreProc
+hi def link pdfComment Comment
+
+let b:current_syntax = "pdf"
2  runtime/syntax/ruby.vim
View
@@ -321,4 +321,4 @@ hi def link rubySpaceError rubyError
let b:current_syntax = "ruby"
-" vim: nowrap sw=2 sts=2 ts=8 noet ff=unix:
+" vim: nowrap sw=2 sts=2 ts=8 noet :
5 runtime/syntax/scheme.vim
View
@@ -1,6 +1,6 @@
" Vim syntax file
" Language: Scheme (R5RS)
-" Last Change: Nov 28, 2004
+" Last Change: 2007 Jun 16
" Maintainer: Sergey Khorev <sergey.khorev@gmail.com>
" Original author: Dirk van Deun <dirk@igwe.vub.ac.be>
@@ -265,6 +265,9 @@ if exists("b:is_chicken") || exists("is_chicken")
syn region ChickenC matchgroup=schemeComment start=+#>%+ end=+<#+ contains=@ChickenC
endif
+ " suggested by Alex Queiroz
+ syn match schemeExtSyntax oneline "#![-a-z!$%&*/:<=>?^_~0-9+.@#%]\+"
+ syn region schemeString start=+#<#\s*\z(.*\)+ end=+^\z1$+
endif
" Synchronization and the wrapping up...
219 runtime/syntax/tcsh.vim
View
@@ -1,7 +1,6 @@
-" Vim syntax file
-" Language: C-shell (tcsh)
-" Maintainer: Gautam Iyer <gi1242@users.sourceforge.net>
-" Last Modified: Thu 16 Nov 2006 01:07:04 PM PST
+" tcsh.vim: Vim syntax file for tcsh scripts
+" Maintainer: Gautam Iyer <gi1242@users.sourceforge.net>
+" Modified: Sat 16 Jun 2007 04:52:12 PM PDT
"
" Description: We break up each statement into a "command" and an "end" part.
" All groups are either a "command" or part of the "end" of a statement (ie
@@ -13,64 +12,118 @@
" causes history to come up as a keyword, which we want to avoid.
" Quit when a syntax file was already loaded
-if exists("b:current_syntax")
+if exists('b:current_syntax')
finish
endif
+let s:oldcpo = &cpo
+set cpo&vim " Line continuation is used
+
+setlocal iskeyword+=-
+
syn case match
" ----- Clusters -----
syn cluster tcshModifiers contains=tcshModifier,tcshModifierError
syn cluster tcshQuoteList contains=tcshDQuote,tcshSQuote,tcshBQuote
-syn cluster tcshStatementEnds contains=@tcshQuoteList,tcshComment,tcshUsrVar,TcshArgv,tcshSubst,tcshRedir,tcshMeta,tcshHereDoc,tcshSpecial,tcshArguement
-syn cluster tcshStatements contains=tcshBuiltins,tcshCommands,tcshSet,tcshSetEnv,tcshAlias,tcshIf,tcshWhile
+syn cluster tcshStatementEnds contains=@tcshQuoteList,tcshComment,@tcshVarList,tcshRedir,tcshMeta,tcshHereDoc,tcshSpecial,tcshArguement
+syn cluster tcshStatements contains=tcshBuiltin,tcshCommands,tcshIf,tcshWhile
syn cluster tcshVarList contains=tcshUsrVar,tcshArgv,tcshSubst
+syn cluster tcshConditions contains=tcshCmdSubst,tcshParenExpr,tcshOperator,tcshNumber,@tcshVarList
+
+" ----- Errors -----
+" Define first, so can be easily overridden.
+syn match tcshError contained '\v\S.+'
" ----- Statements -----
" Tcsh commands: Any filename / modifiable variable (must be first!)
syn match tcshCommands '\v[a-zA-Z0-9\\./_$:-]+' contains=tcshSpecial,tcshUsrVar,tcshArgv,tcshVarError nextgroup=tcshStatementEnd
-" Builtin commands except (un)set(env), (un)alias, if, while, else
-syn keyword tcshBuiltins nextgroup=tcshStatementEnd alloc bg bindkey break breaksw builtins bye case cd chdir complete continue default dirs echo echotc end endif endsw eval exec exit fg filetest foreach getspath getxvers glob goto hashstat history hup inlib jobs kill limit log login logout ls ls-F migrate newgrp nice nohup notify onintr popd printenv pushd rehash repeat rootnode sched setpath setspath settc setty setxvers shift source stop suspend switch telltc time umask uncomplete unhash universe unlimit ver wait warp watchlog where which
+" Builtin commands except those treated specially. Currently (un)set(env),
+" (un)alias, if, while, else, bindkey
+syn keyword tcshBuiltin nextgroup=tcshStatementEnd alloc bg break breaksw builtins bye case cd chdir complete continue default dirs echo echotc end endif endsw eval exec exit fg filetest foreach getspath getxvers glob goto hashstat history hup inlib jobs kill limit log login logout ls ls-F migrate newgrp nice nohup notify onintr popd printenv pushd rehash repeat rootnode sched setpath setspath settc setty setxvers shift source stop suspend switch telltc time umask uncomplete unhash universe unlimit ver wait warp watchlog where which
-" StatementEnd is anything after a builtin / command till the lexical end of a
+" StatementEnd is anything after a built-in / command till the lexical end of a
" statement (;, |, ||, |&, && or end of line)
-syn region tcshStatementEnd transparent contained matchgroup=tcshBuiltins start='' end='\v\\@<!(;|\|[|&]?|\&\&|$)' contains=@tcshStatementEnds
+syn region tcshStatementEnd transparent contained matchgroup=tcshBuiltin start='' end='\v\\@<!(;|\|[|&]?|\&\&|$)' contains=@tcshStatementEnds
" set expressions (Contains shell variables)
syn keyword tcshShellVar contained afsuser ampm argv autocorrect autoexpand autolist autologout backslash_quote catalog cdpath color colorcat command complete continue continue_args correct cwd dextract dirsfile dirstack dspmbyte dunique echo echo_style edit ellipsis fignore filec gid group histchars histdup histfile histlit history home ignoreeof implicitcd inputmode killdup killring listflags listjobs listlinks listmax listmaxrows loginsh logout mail matchbeep nobeep noclobber noding noglob nokanji nonomatch nostat notify oid owd path printexitvalue prompt prompt2 prompt3 promptchars pushdtohome pushdsilent recexact recognize_only_executables rmstar rprompt savedirs savehist sched shell shlvl status symlinks tcsh term time tperiod tty uid user verbose version visiblebell watch who wordchars
-syn keyword tcshSet nextgroup=tcshSetEnd set unset
-syn region tcshSetEnd contained transparent matchgroup=tcshBuiltins start='' skip="\\$" end="$\|;" contains=tcshShellVar,@tcshStatementEnds
+syn keyword tcshBuiltin nextgroup=tcshSetEnd set unset
+syn region tcshSetEnd contained transparent matchgroup=tcshBuiltin start='' skip='\\$' end='$\|;' contains=tcshShellVar,@tcshStatementEnds
-" setenv expressions (Contains enviorenment variables)
+" setenv expressions (Contains environment variables)
syn keyword tcshEnvVar contained AFSUSER COLUMNS DISPLAY EDITOR GROUP HOME HOST HOSTTYPE HPATH LANG LC_CTYPE LINES LS_COLORS MACHTYPE NOREBIND OSTYPE PATH PWD REMOTEHOST SHLVL SYSTYPE TERM TERMCAP USER VENDOR VISUAL
-syn keyword tcshSetEnv nextgroup=tcshEnvEnd setenv unsetenv
-syn region tcshEnvEnd contained transparent matchgroup=tcshBuiltins start='' skip="\\$" end="$\|;" contains=tcshEnvVar,@tcshStatementEnds
+syn keyword tcshBuiltin nextgroup=tcshEnvEnd setenv unsetenv
+syn region tcshEnvEnd contained transparent matchgroup=tcshBuiltin start='' skip='\\$' end='$\|;' contains=tcshEnvVar,@tcshStatementEnds
" alias and unalias (contains special aliases)
syn keyword tcshAliases contained beepcmd cwdcmd jobcmd helpcommand periodic precmd postcmd shell
-syn keyword tcshAlias nextgroup=tcshAliCmd skipwhite alias unalias
+syn keyword tcshBuiltin nextgroup=tcshAliCmd skipwhite alias unalias
syn match tcshAliCmd contained nextgroup=tcshAliEnd skipwhite '\v[\w-]+' contains=tcshAliases
-syn region tcshAliEnd contained transparent matchgroup=tcshBuiltins start='' skip="\\$" end="$\|;" contains=@tcshStatementEnds
+syn region tcshAliEnd contained transparent matchgroup=tcshBuiltin start='' skip='\\$' end='$\|;' contains=@tcshStatementEnds
-" if statements (contains expressions / operators)
-syn keyword tcshIf nextgroup=tcshIfEnd if
-syn region tcshIfEnd contained matchgroup=tcshBuiltins start='' skip="\\$" end="\v<then>|$" contains=tcshOperator,tcshNumber,@tcshStatementEnds
+" if statements
+syn keyword tcshIf nextgroup=tcshIfEnd skipwhite if
+syn region tcshIfEnd contained start='\S' skip='\\$' matchgroup=tcshBuiltin end='\v<then>|$' contains=@tcshConditions,tcshSpecial,@tcshStatementEnds
+syn region tcshIfEnd contained matchgroup=tcshBuiltin contains=@tcshConditions,tcshSpecial start='(' end='\v\)%(\s+then>)?' skipwhite nextgroup=@tcshStatementEnds
+syn region tcshIfEnd contained matchgroup=tcshBuiltin contains=tcshCommands,tcshSpecial start='\v\{\s+' end='\v\s+\}%(\s+then>)?' skipwhite nextgroup=@tcshStatementEnds keepend
-" else statements (nextgroup if)
-syn keyword tcshElse nextgroup=tcshIf skipwhite else
+" else statements
+syn keyword tcshBuiltin nextgroup=tcshIf skipwhite else
" while statements (contains expressions / operators)
-syn keyword tcshWhile nextgroup=tcshWhEnd while
-syn region tcshWhEnd contained transparent matchgroup=tcshBuiltins start='' skip="\\$" end="\v$" contains=tcshOperator,tcshNumber,@tcshStatementEnds
+syn keyword tcshBuiltin nextgroup=@tcshConditions,tcshSpecial skipwhite while
+
+" Conditions (for if and while)
+syn region tcshParenExpr contained contains=@tcshConditions,tcshSpecial matchgroup=tcshBuiltin start='(' end=')'
+syn region tcshCmdSubst contained contains=tcshCommands matchgroup=tcshBuiltin start='\v\{\s+' end='\v\s+\}' keepend
+
+" Bindkey. Internal editor functions
+syn keyword tcshBindkeyFuncs contained backward-char backward-delete-char
+ \ backward-delete-word backward-kill-line backward-word
+ \ beginning-of-line capitalize-word change-case
+ \ change-till-end-of-line clear-screen complete-word
+ \ complete-word-fwd complete-word-back complete-word-raw
+ \ copy-prev-word copy-region-as-kill dabbrev-expand delete-char
+ \ delete-char-or-eof delete-char-or-list
+ \ delete-char-or-list-or-eof delete-word digit digit-argument
+ \ down-history downcase-word end-of-file end-of-line
+ \ exchange-point-and-mark expand-glob expand-history expand-line
+ \ expand-variables forward-char forward-word
+ \ gosmacs-transpose-chars history-search-backward
+ \ history-search-forward insert-last-word i-search-fwd
+ \ i-search-back keyboard-quit kill-line kill-region
+ \ kill-whole-line list-choices list-choices-raw list-glob
+ \ list-or-eof load-average magic-space newline normalize-path