Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hkupty/classifier.nvim
Filetype to/from extension mapping
https://github.com/hkupty/classifier.nvim
Last synced: about 2 months ago
JSON representation
Filetype to/from extension mapping
- Host: GitHub
- URL: https://github.com/hkupty/classifier.nvim
- Owner: hkupty
- Created: 2020-09-22T15:43:09.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-11-11T11:25:57.000Z (almost 3 years ago)
- Last Synced: 2024-05-22T17:34:36.121Z (4 months ago)
- Language: Lua
- Size: 1.95 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# classifier.nvim
## Why?
This is a very, *very* simple mapping of `ft` to file extension and the other way around.
Should be used by plugin authors or users to glue together commands/plugins.## Caveats
Filetype to extensions is faster than extension to filetype. In order to avoid duplication, the extensions list is lazily populated.
## Usage
```lua
local classifier = require("classifier")-- Sample usage
local icons = require("nvim-web-devicons")icons.get_icon(filename, classifier.ext(vim.bo.ft)[1])
-- another example
vim.fn.systemlist("rg --vimgrep -g '*.{" .. table.concat(classifier.fts(ft), ",") .. "}' -- " .. some_search)
```