Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/code-biscuits/nvim-biscuits
A neovim port of Assorted Biscuits. Ends up with more supported languages too.
https://github.com/code-biscuits/nvim-biscuits
Last synced: about 2 months ago
JSON representation
A neovim port of Assorted Biscuits. Ends up with more supported languages too.
- Host: GitHub
- URL: https://github.com/code-biscuits/nvim-biscuits
- Owner: code-biscuits
- License: mit
- Created: 2021-03-28T19:35:17.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-20T22:48:46.000Z (8 months ago)
- Last Synced: 2024-07-31T20:50:10.705Z (4 months ago)
- Language: Lua
- Size: 1.6 MB
- Stars: 243
- Watchers: 3
- Forks: 11
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-neovim - code-biscuits/nvim-biscuits - A Neovim port of Assorted Biscuits. Ends up with more supported languages too. (Utility / Cursorline)
README
# nvim-biscuits
Every dev needs something sweet sometimes. Code Biscuits are in-editor annotations usually at the end of a closing tag/bracket/parenthesis/etc. They help you get the context of the end of that AST node so you don't have to navigate to find it.
## Demo
Here you can see the plugin being used on a Go file with `cursor_line_only` turned on.
![Demo of the plugin being used on a Golang file](./assets/demo.gif)
## Installation
In your nvim config, add the Plug dependencies:
Using Vim Plug:
```lua
call plug#begin()
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'code-biscuits/nvim-biscuits'
call plug#end()
```Using Packer:
```lua
use {
'code-biscuits/nvim-biscuits',
requires = {
'nvim-treesitter/nvim-treesitter',
run = ':TSUpdate'
},
}```
You will also need to configure which language parsers you want to have enabled for tree-sitter. "maintained" currently will install 40 languages. "all" will install even more.
```lua
lua <bb",
function()
require("nvim-biscuits").BufferAttach()
end,
mode = "n",
desc = "Enable Biscuits",
},
},
```If you want to lazy load nvim-biscuits but also use the internal visibilty toggle, there are a couple ways of setting things up. If you are letting `show_on_start` default to `false`, you will need to manually toggle the biscuits in the callback function.
```lua
keys = {
{
"bb",
function()
local nvim_biscuits =
require("nvim-biscuits")
nvim_biscuits.BufferAttach()
nvim_biscuits.toggle_biscuits()
end,
mode = "n",
desc = "Enable Biscuits",
},
},
```A cleaner way of doing it is to set `show_on_start` to true for nvim-biscuits. Then, you do not need to call `toggle_biscuits` in your lazy.nvim callback.
## Supported Languages
We currently support all the languages supported in tree-sitter. Not all languages have specialized support, though most will probably need some.
As we make tailored handlers for specific languages we will create a table here to track that.
## Development
While doing local dev, it can be nice to use the `utils.console_log` command to write runtime logs to `~/.cache/nvim/nvim-biscuits.log`.
You can turn this on by passing DEBUG=true as an environment variable when launching Neovim.
## License
Copyright 2021 Chris Griffing
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.