Last active
December 14, 2015 11:59
-
-
Save robinedwards/5083532 to your computer and use it in GitHub Desktop.
Create binding for execute neo4j cypher and show results in separate vim window. Make sure you have installed py2neo first: pip install py2neo You can change the format of the results with the -f flag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Run cypher query and return result | |
function! EvalCypher() | |
let src = expand("%") | |
let dst = tempname() | |
execute ":silent !cat " . src . " | cypher -f json -H localhost &> " . dst | |
execute ":pedit! " . dst | |
execute ":redraw!" | |
wincmd P | |
setlocal syntax=javascript | |
retab | |
endfunction | |
augroup filetype | |
autocmd BufNewFile,BufRead *.cypher map <F7> <Esc>:call EvalCypher()<CR> | |
autocmd BufNewFile,BufRead *.cypher set syntax=cypher | |
augroup END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment