https://github.com/cyan903/gremlins.nvim
A Neovim rewrite of the vscode-gremlins extension, designed to reveal unwanted or invisible characters in your code.
https://github.com/cyan903/gremlins.nvim
gremlin linter neovim neovim-plugin
Last synced: 24 days ago
JSON representation
A Neovim rewrite of the vscode-gremlins extension, designed to reveal unwanted or invisible characters in your code.
- Host: GitHub
- URL: https://github.com/cyan903/gremlins.nvim
- Owner: Cyan903
- License: mit
- Created: 2024-11-29T10:54:52.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-19T12:45:55.000Z (over 1 year ago)
- Last Synced: 2025-04-09T07:35:44.862Z (about 1 year ago)
- Topics: gremlin, linter, neovim, neovim-plugin
- Language: Lua
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gremlins.nvim
  
A Neovim rewrite of the [vscode-gremlins](https://marketplace.visualstudio.com/items?itemName=nhoizey.gremlins) extension, designed to reveal unwanted or invisible characters in your code.
## Quickstart with lazy.nvim
```lua
return {
"Cyan903/gremlins.nvim",
opts = {},
config = function(_, opts)
local gremlins = require("gremlins")
-- Open popup.
vim.keymap.set("n", "gs", gremlins.select, { desc = "Gremlins select." })
-- Create quickfix list.
vim.keymap.set("n", "gc", gremlins.qflist, { desc = "Gremlins quickfix." })
-- Jump to next gremlin.
vim.keymap.set("n", "gj", gremlins.next, { desc = "Gremlins next." })
-- Jump to previous gremlin.
vim.keymap.set("n", "gk", gremlins.prev, { desc = "Gremlins previous." })
gremlins.setup(opts)
end,
}
```
## Configuration
The default configuration is recommended, but custom parameters can be provided through the setup function. Gremlins with a custom file type will only appear in the specified file type. You can view the default config in [config.lua](lua/gremlins/config.lua).
```lua
require("gremlins").setup {
icon = "😈",
gremlins = {
-- NOTE: Gremlins can simply be strings.
"2013",
-- NOTE: Or be more descriptive with a specified filetype.
{
name = "2013",
description = "en dash",
filetype = "markdown",
},
-- NOTE: Multiple filetypes are supported.
{
name = "2013",
description = "en dash",
filetype = { "markdown", "go" },
},
}
}
```
## API
`.setup()` must be called before the API can be used.
```lua
-- Open `vim.ui.select` with a list of gremlins in the current file.
require("gremlins").select()
-- Create and open a quickfix list of gremlins in the current file.
require("gremlins").qflist()
-- Jump to previous gremlin in file.
require("gremlins").next()
-- Jump to previous gremlin in file.
require("gremlins").prev()
```
## License
[MIT](LICENSE)