-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
57 lines (43 loc) · 1.38 KB
/
README.Rmd
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
title: nvim-cmp-fonts
output: amaryaml::github
---
# Preview
![](preview.gif)
# Introduction
nvim-cmp-fonts is a completion source for
[nvim-cmp](https://github.com/hrsh7th/nvim-cmp) that provides sources for fonts.
This is especially useful for editing
[configuration](#only-for-certain-file-types) file types. It gets them from the
fonts installed on your computer, which you can see by using the `fc-list`
command. Every time you open Neovim, the list of fonts is updated.
# Dependencies
* fontconfig
# Installation
## [packer.nvim](https://github.com/wbthomason/packer.nvim)
```lua
require "packer".startup(function(use)
use "amarakon/nvim-cmp-fonts"
end)
```
# Setup
The following code block shows the default options.
```lua
require "cmp".setup {
sources = {
-- Most font names have spaces in them. However, nvim-cmp restarts the
-- completion after a space, disallowing you to complete a font name
-- with spaces. The `space_filter` option is a way to get around this by
-- using a different character to represent spaces. If you wish, you can
-- set this option to a space character, but you know the downside of
-- that.
{ name = "fonts", option = { space_filter = "-" } }
}
}
```
## Only for certain file types
```lua
-- Only enable `fonts` for `conf` and `config` file types
require "cmp".setup.filetype({ "conf", "config" },
{ sources = { { name = "fonts"} } })
```