XQuery indent/omnicomplete/ftplugin


Ⅰ. 插件描述

XQuery indent/omnicomplete/ftplugin

Ⅱ. 基本信息

创建日期:  2011-05-31
使用用户:  1
Github星:  4
插件作者:  David Lam

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin '/xquery-indent-omnicomplete-ftplugin'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle '/xquery-indent-omnicomplete-ftplugin'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug '/xquery-indent-omnicomplete-ftplugin'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/vim-scripts/XQuery-indentomnicompleteftplugin

Ⅳ. 文档说明

This plugin configures Vim to be a little more efficient at editing XQuery...!

It also sets up Exuberant Ctags for XQuery, since it's not one of the supported languages.

ftplugin/xquery.vim:
    -Makes keys like gd and<C-]> and i_CTRL-p work better when editing XQuery files by temporarily adding the hyphen - to the 'iskeyword' option
    -Sets options useful when editing XQuery (like 'set comments')
    -Sets a few variables to make matchit.vim and taglist.vim work better with XQuery
    -Comment regions out via surround.vim by visually selecting an area, then pressing Sc

xquerycomplete.vim:
    -Completes W3C XQuery 'fn' functions, types and keywords.
    -Also completes any MarkLogic functions I could find at...  http://developer.marklogic.com/pubs/4.1/apidocs/All.html

        Examples:

            fn<CTRL-x><CTRL-o>
               ->  list of functions in the 'fn' namespace

            fn:doc<CTRL-x><CTRL-o>
               ->  fn:doc(
                   fn:doc-available(
                   fn:document-uri(

            xs<CTRL-x><CTRL-o>
               ->  list of all xquery types

            decl<CTRL-x><CTRL-o>
               ->  declare
                   declare function
                   declare namespace
                   declare option
                   declare default

indent/xquery.vim:
    - It can recognize complex FLOWR expressions. For example in the example below,
      if in insert mode, hitting enter after the first line will immediately align the cursor with the 'for'.

      Also,  typing out the 'let' in the fourth line will immediately re-indent the line to align with the 'let' on the first line.

             let $foo := for $editor in $editors
                         where not(contains($editor, "emacs"))
                         return $editor
             let $bar := "bar"
             return
                   $bar

        

添加新评论