Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amarz45/nvim-cmp-fonts
Neovim completion for fonts installed on the system
https://github.com/amarz45/nvim-cmp-fonts
fontconfig fonts lua neovim neovim-plugin nvim-cmp nvim-plugin
Last synced: 1 day ago
JSON representation
Neovim completion for fonts installed on the system
- Host: GitHub
- URL: https://github.com/amarz45/nvim-cmp-fonts
- Owner: amarz45
- License: agpl-3.0
- Created: 2022-09-22T18:52:41.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-10-10T08:33:58.000Z (over 2 years ago)
- Last Synced: 2025-01-06T17:03:34.355Z (20 days ago)
- Topics: fontconfig, fonts, lua, neovim, neovim-plugin, nvim-cmp, nvim-plugin
- Language: Lua
- Homepage:
- Size: 3.46 MB
- Stars: 23
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
README
---
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"} } })
```