Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/willothy/luahint
LSP inline hints for Lua, intended for use with Neovim.
https://github.com/willothy/luahint
Last synced: about 1 month ago
JSON representation
LSP inline hints for Lua, intended for use with Neovim.
- Host: GitHub
- URL: https://github.com/willothy/luahint
- Owner: willothy
- Created: 2023-05-31T05:48:12.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-05-31T12:41:03.000Z (over 1 year ago)
- Last Synced: 2024-06-09T00:34:43.659Z (3 months ago)
- Language: Rust
- Size: 31.3 KB
- Stars: 16
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# luahint
LSP inline hints for Lua, intended for use with Neovim.
Now that inline hints are working in Neovim nightly, I figured I'd attempt to build an LSP-adjacent project. Luahint provides inline parameter hints via LSP, and potentially more in the future. It's a work in progress right now, but here's a screenshot:
![LuahintDemo](https://github.com/willothy/luahint/assets/38540736/490e4100-914a-4895-95e6-e8c40c85a23f)
## Goals
- [x] Basic function parameter hints
- [ ] Index entire runtime (currently only indexes single file)
- [ ] Table function parameter hints
- [ ] Method parameter hints
- [ ] Metamethod parameter hints
- [ ] Emmylua type hints## Installation
With `lazy.nvim`
```lua
{
"willothy/luahint",
build = "cargo install --path=./",
config = true
-- or opts = { ... }
}
```## Configuration
Luahint comes with the following defaults:
```lua
{
-- string[] | string
-- Autocommands that should trigger a refresh
update = {
"CursorHold",
"CursorHoldI",
"InsertLeave",
"TextChanged",
},-- boolean
-- Whether to enable the plugin at startup
enabled_at_startup = true,-- fun(): string
-- Function to determine the root directory of the project
root_dir = vim.fn.getcwd,
}
```## Usage
```lua
local hints = require("luahint")-- show the hints
hints.show()-- hide the hints
hints.hide()-- toggle the hints
hints.toggle()```