diff options
author | Bram Moolenaar <Bram@vim.org> | 2008-06-24 20:39:31 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2008-06-24 20:39:31 +0000 |
commit | a7241f5f19fd0865ce697939c347a8c88fb507d5 (patch) | |
tree | e1f1c07fe74094539286be048cc3306f6aedb0bc | |
parent | f233048a129fa7a3b89e064078435181d6421da5 (diff) |
updated for version 7.2a
69 files changed, 5931 insertions, 446 deletions
diff --git a/runtime/autoload/rubycomplete.vim b/runtime/autoload/rubycomplete.vim index 5b728607c2..47c77d93d7 100644 --- a/runtime/autoload/rubycomplete.vim +++ b/runtime/autoload/rubycomplete.vim @@ -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") diff --git a/runtime/autoload/xml/html401f.vim b/runtime/autoload/xml/html401f.vim index 6261265504..1797a5a078 100644 --- a/runtime/autoload/xml/html401f.vim +++ b/runtime/autoload/xml/html401f.vim @@ -466,4 +466,3 @@ let g:xmldata_html401t = { \ 'param': ['/>', ''], \ } \ } -" vim:ft=vim:ff=unix diff --git a/runtime/autoload/xml/xhtml10f.vim b/runtime/autoload/xml/xhtml10f.vim index 4cd894d3ac..0bfa30ce9d 100644 --- a/runtime/autoload/xml/xhtml10f.vim +++ b/runtime/autoload/xml/xhtml10f.vim @@ -467,4 +467,3 @@ let g:xmldata_xhtml10f = { \ 'param': ['/>', ''], \ } \ } -" vim:ft=vim:ff=unix diff --git a/runtime/colors/slate.vim b/runtime/colors/slate.vim index 12d91bab7d..f9a70b8777 100644 --- a/runtime/colors/slate.vim +++ b/runtime/colors/slate.vim @@ -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 diff --git a/runtime/doc/Makefile b/runtime/doc/Makefile index ad08a87e2d..3a289d7b04 100644 --- a/runtime/doc/Makefile +++ b/runtime/doc/Makefile @@ -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 diff --git a/runtime/doc/ft_sql.txt b/runtime/doc/ft_sql.txt new file mode 100644 index 0000000000..7946c4f702 --- /dev/null +++ b/runtime/doc/ft_sql.txt @@ -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 enabl |