Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updated README, and added surround.vim key

  • Loading branch information...
commit 47fca39125cf1eacc5c3837ad7974ac25fdec471 1 parent 66d104a
@dlam26 authored
Showing with 12 additions and 4 deletions.
  1. +7 −4 README
  2. +3 −0  ftplugin/xquery.vim
  3. +2 −0  indent/xquery.vim
View
11 README
@@ -8,6 +8,7 @@ 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.
@@ -39,14 +40,16 @@ indent/xquery.vim:
- Typing out certain keywords (like for/let/where/order/return/else) will automatically indent to the correct location when typed out.
- - It can recognize complex FLOWR expressions. For example,
- if you're in insert mode hitting enter after the first line will immediately align the cursor with the 'for'.
+ - 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
+ where not(contains($editor, "emacs"))
+ return $editor
let $bar := "bar"
return
$bar
View
3  ftplugin/xquery.vim
@@ -190,4 +190,7 @@ let b:undo_ftplugin = 'setlocal formatoptions<'
\ . ' shiftwidth< tabstop<'
+" surround.vim Usage: visually select text, then type Sc
+let b:surround_{char2nr("c")} = "(: \r :)"
+
" vim:sw=4 fdm=marker tw=80
View
2  indent/xquery.vim
@@ -47,6 +47,8 @@ let b:did_indent = 1
setlocal autoindent "usually people just line FLOWR's up etc.
setlocal indentexpr=XQueryIndentGet()
+
+" automatically indent when typing these keys or typing out FLWOR keywords
setlocal indentkeys=!^F,0(,0),0{,0},o,O,e,0=for,0=let,0=where,0=order,0=return,0=else,0=or,0=and
" for a closing </xmlTag>
Please sign in to comment.
Something went wrong with that request. Please try again.