From e9bfc5de6fbe2be7243b96e5744ccd536f15518d Mon Sep 17 00:00:00 2001 From: Christian Segundo Date: Sun, 8 Dec 2024 11:42:15 +0100 Subject: First commit --- README.md | 38 ++++++++++++++++++++++++++++++++++++++ preview.gif | Bin 0 -> 301495 bytes 2 files changed, 38 insertions(+) create mode 100644 README.md create mode 100644 preview.gif diff --git a/README.md b/README.md new file mode 100644 index 0000000..007de42 --- /dev/null +++ b/README.md @@ -0,0 +1,38 @@ +# cmp-abook + +A completion source for [nvim-cmp][nvim-cmp] that provides sources for addresses +in [Abook][abook] when writing emails. + +![](preview.gif) + +## Dependencies + +- [plenary.nvim][plenary.nvim] + +## Setup + +Just add the `abook` source to [nvim-cmp][nvim-cmp] setup call: + +``` lua +sources = { + -- Most names in an address book have spaces in them. However, cmp restarts + -- the completion after a space. The `space_filter` option is a way to get + -- around this by using a different character to represent spaces. + { name = "abook", option = { space_filter = "-" } } +} +``` + +### Multiple addressbooks + +By default the plugin uses the default addressbook. You can use the +`ABOOK_ADDRESSBOOK` environment variable option to control which addressbook to +use. If you're using `mutt` for email, you could set it like this: + +``` +set editor="ABOOK_ADDRESSBOOK='$HOME/.config/abook/my_custom_addressbook' nvim ...other options... %s" +``` + +--- +[plenary.nvim]: https://github.com/nvim-lua/plenary.nvim +[abook]: https://abook.sourceforge.io/ +[nvim-cmp]: https://github.com/hrsh7th/nvim-cmp diff --git a/preview.gif b/preview.gif new file mode 100644 index 0000000..771d0a4 Binary files /dev/null and b/preview.gif differ -- cgit v1.2.3