Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xiyaowong/coc-lightbulb-
Code action 💡 for coc.nvim
https://github.com/xiyaowong/coc-lightbulb-
coc-nvim neovim
Last synced: 15 days ago
JSON representation
Code action 💡 for coc.nvim
- Host: GitHub
- URL: https://github.com/xiyaowong/coc-lightbulb-
- Owner: xiyaowong
- License: mit
- Created: 2021-09-04T10:58:37.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-20T01:12:51.000Z (8 months ago)
- Last Synced: 2024-10-12T22:53:11.910Z (about 1 month ago)
- Topics: coc-nvim, neovim
- Language: TypeScript
- Homepage:
- Size: 76.2 KB
- Stars: 21
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# coc-lightbulb
Code action 💡 for coc.nvim
Show a lightbulb if there are available codeActions for current cursor position
![demo](https://user-images.githubusercontent.com/47070852/132829062-519f5f76-bdc2-4ff4-a5f4-fcaf05673396.gif)
## Install
`:CocInstall coc-lightbulb`
## Configuration
| name | default | description |
| ------------------------------- | ------- | --------------------------------------------------------------- |
| `lightbulb.only` | `[]` | Array of codeActionKind used for filtering |
| `lightbulb.excludeFiletypes` | `[]` | Disable lightbulb in these filetyps |
| `lightbulb.enableVirtualText` | `true` | Whether to show virtual text(neovim only) |
| `lightbulb.virtualTextPosition` | `auto` | Virtual text position |
| `lightbulb.virtualTextPriority` | `50` | Priority of virtual text |
| `lightbulb.enableSign` | `false` | Whether to show sign |
| `lightbulb.signPriority` | `20` | Priority of sign |
| `lightbulb.followDiagnostic` | `true` | Don't show lightbulb when `b:coc_diagnostic_disable equal` to 1 |```jsonc
{
"lightbulb.text": {
// nerd-font: nf-mdi-lightbulb, text used when there're code actions
"default": "ï ´",
// nerd-font: nf-mdi-auto_fix, text used when there're code actions and quickfix exists
"quickfix": ""
}
}
```## Usage
1. The variable `b:coc_lightbulb_status` will always be set and you can use it for the statusline
2. How to disable lightbulb for current buffer ?
```vim
let b:coc_lightbulb_disable = 1
```3. highlights
by default
```vim
" virtual text
hi default LightBulbDefaultVirtualText guifg=#FDD164
hi default link LightBulbQuickFixVirtualText LightBulbDefaultVirtualText
" sign
hi default LightBulbDefaultSign guifg=#FDD164
hi default link LightBulbQuickFixSign LightBulbDefaultSign
" for numhl, you can set LightBulbDefaultSignLine, LightBulbQuickFixSignLine
```## License
MIT
---
> This extension is built with [create-coc-extension](https://github.com/fannheyward/create-coc-extension)