blob: 007de4253a03cedc743242fb9835a5117f3d273f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# cmp-abook
A completion source for [nvim-cmp][nvim-cmp] that provides sources for addresses
in [Abook][abook] when writing emails.

## 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
|