J@ArangoDB

{ "subject" : "ArangoDB", "tags": [ "multi-model", "nosql", "database" ] }

How to Set Up Fish Completion for ArangoDB

While experimenting with the fish shell on my laptop I found fish has a slightly different (but much fancier) tab-completion mechanism than bash.

Re-using the existing completer for bash wouldn’t work, so I put together some dedicated completions files for fish.

The files can be downloaded here: 2.5 2.6 2.7 2.8 3.0

To activate these completions, copy the appropriate file into ~/.arangodb-completions and source it from fish:

1
source ~/.arangodb-completions

In order to permanently activate these completions, you may source the completions file from your config.fish file, which is normally located in directory ~/.config/fish.

Full setup

The following command, executed in fish, should install the completions for 3.0 and activate them:

activate completions for ArangoDB 3.0
1
2
3
wget -O ~/.arangodb-completions https://jsteemann.github.io/downloads/code/completions-fish-3.0
echo "source ~/.arangodb-completions" >> ~/.config/fish/config.fish
source ~/.arangodb-completions

To install fish completions for ArangoDB 2.8, the command is:

activate completions for ArangoDB 2.8
1
2
3
wget -O ~/.arangodb-completions https://jsteemann.github.io/downloads/code/completions-fish-2.8
echo "source ~/.arangodb-completions" >> ~/.config/fish/config.fish
source ~/.arangodb-completions

To install fish completions for ArangoDB 2.7, the command is:

activate completions for ArangoDB 2.7
1
2
3
wget -O ~/.arangodb-completions https://jsteemann.github.io/downloads/code/completions-fish-2.7
echo "source ~/.arangodb-completions" >> ~/.config/fish/config.fish
source ~/.arangodb-completions

To see it in action, type arangosh -- in fish and then press TAB: