Skip to content

Executing cypher queries from vim #3

@robinedwards

Description

@robinedwards

Not sure if this is useful to anyone but I have been using the following to execute cypher from within vim and get the results returned to me in a vim preview buffer. It relies on the cypher command line tool that comes with py2neo

" Run cypher query
function! EvalCypher()
  let src = expand("%")
  let dst = tempname()
  execute ":silent !cat " . src . " | cypher -f json -H hostname &> " . dst
  execute ":pedit! " . dst
  execute ":redraw!"
  wincmd P
  setlocal syntax=javascript
  retab
endfunction
autocmd BufNewFile,BufRead *.cypher map <F7> <Esc>:call EvalCypher()<CR>

Could add it to the read me if you think it's appropriate?

R

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions