Skip to content
Browse files

Add <C-CR> to run query and g:xqmarklogic_noMappings to skip mappings

  • Loading branch information...
1 parent b91db76 commit f6c97003690df2c219e47a1a263c11095e1f2f23 @coledarr committed Oct 3, 2012
Showing with 13 additions and 7 deletions.
  1. +8 −5 doc/xqmarklogic.txt
  2. +5 −2 ftplugin/xquery.vim
View
13 doc/xqmarklogic.txt
@@ -13,9 +13,10 @@ window
==============================================================================
1. Introduction *xqmarklogic-intro*
-xqmarklogic maps <LEADER>B to run a xquery against MarkLogic
-server using curl and a custom App Server running a short xquery file. It
-displays the results in a new window. It was inspired by this webpage:
+xqmarklogic maps <LEADER>B and <C-CR> (CTRL-RETURN like QueryConsole) to run a
+xquery against MarkLogic server using curl and a custom App Server running a
+short xquery file. It displays the results in a new window. It was inspired
+by this webpage:
http://superiorautomaticdictionary.com/vim-nirvana-interactive-xquery-with-marklogic
Git repository at: github.com/coledarr/vim-xqmarklogic
@@ -139,12 +140,14 @@ g:xqmarklogic_defaultPort - the default Port, if not set uses 8002
(which is used by MarkLogic by default and
wont work)
g:xqmarklogic_defaultUser - the default User, if not set uses 'admin'
-g:xqmarklogic_defaultPassword - the default password to use, if not set
+g:xqmarklogic_defaultPassword - the default password to use, if not set
you will probably have problems.
g:xqmarklogic_defaultScript - the default name of the xq.xqy, if not set
uses '/xq.xqy'
-g:xqmarklogic_defaultDb - the default Database to query against, if
+g:xqmarklogic_defaultDb - the default Database to query against, if
not set uses 'Documents'
+
+g:xqmarklogic_noMappings - if set \B and <C-CR> wont be mapped
Example:
let g:xqmarklogic_defaultUser='labarbara_conrad'
View
7 ftplugin/xquery.vim
@@ -1,6 +1,6 @@
" xquery.vim - man <Leader>B run against marklogic
" Maintainer: Darren Cole <http://github.com/coledarr/xqmarklogic>
-" Version: 0.7.0
+" Version: 0.7.1
" TODO: GetLatestVimScripts: ### ### :AutoInstall: xqmarklogic
" TODO: see *glvs-plugins*
"
@@ -147,7 +147,10 @@ function! s:DisplaySettings()
endfunction
" Running the Query
-map <Leader>B :XQmlquery<cr>
+if !exists('g:xqmarklogic_noMappings')
+ map <Leader>B :XQmlquery<cr>
+ map <C-CR> :XQmlquery<cr>
+endif
command -buffer XQmlquery :execute s:QueryMarkLogic(expand("%"))
function! s:QueryMarkLogic(fname)
let info = ''

0 comments on commit f6c9700

Please sign in to comment.
Something went wrong with that request. Please try again.