cypher-mode
: can be installed from melpa
Coming soon
- Clone it into your
.emacs.d
and add it into load path
(add-to-list 'load-path "~/.emacs.d/n4js.el/")
- Load the library with
require
(require 'n4js)
Change these variables based on your demand
n4js-cli-program
: the name of neo4j shell cli program, default toneo4j-shell
. Change it to absolute path if it's not in your load path.
(setq n4js-cli-program "/path/to/neo4j-shell")
-
n4js-cli-arguments
: the list of arguments to pass toneo4j-shell
. -
n4js-pop-to-buffer
: whether to pop up the neo4j shell buffer after sending command to execute. -
n4js-pop-to-buffer-function
: the function used for pop up the neo4j shell buffer if the above variable is set to t. Default ispop-to-buffer
. An example ispop-to-buffer-same-window
to pop up the neo4j buffer to current window instead of other window. -
n4js-font-lock-keywords
: font lock keywords list, default tocypher-font-lock-keywords
so that why we need cypher-mode as a dependency. Usually you don't need to change this variable.
n4js-start
: start a neo4j shell processn4js-send-current-region
: send the active region to neo4j shell processn4js-send-buffer
: send the whole buffer to neo4j shell processn4js-send-paragraph
: send the paragraph at point to neo4j shell processn4js-send-region-or-buffer
: send the current region if active, otherwise send the whole buffer to neo4j shell processn4js-send-dwim
: send the current region if active, otherwise send the paragraph at point to neo4j shell processn4js-switch-to-buffer
: switch to neo4j shell buffer if exist, otherwise, start a new one
If the neo4j shell instance is running on a different port other than the default 1337, add this to your .emacs
(setq n4js-cli-arguments '("-port" "7475"))
Usually, passing the argument -port
and -host
is not enough if you want to
connect to a neo4j shell that is not running on your computer because neo4j
shell requires some other port for running over RMI. In that case, you can use
the ssh tunnel for connecting
ssh user@host -p 2222 /path/to/neo4j-shell -port 12345
To achieve that, add this to your .emacs
(setq n4js-cli-program "ssh")
(setq n4js-cli-arguments '("user@host" "-p" "2222" "/path/to/neo4j-shell -port 12345"))
To connect to a neo4j shell instance running inside Vagrant, use the vagrant ssh
command like this
vagrant ssh -c '/path/to/neo4j-shell -port 12345'
To achieve that, add this to your .emacs
(setq n4js-cli-program "vagrant")
(setq n4js-cli-arguments '("ssh" "-c" "/path/to/neo4j-shell -port 12345"))
Note: in this case, you need to change to a dired buffer or a file inside
that project folder (or any buffer with default-directory
inside the project
folder) so that when running the start command, it will run with the cwd is the
default-directory
. You only need to do this once when you call the command
n4js-start
.