https://github.com/kilavila/cheat-sh.nvim
Search cht.sh without leaving neovim
https://github.com/kilavila/cheat-sh.nvim
lua neovim neovim-plugin nvim
Last synced: 11 months ago
JSON representation
Search cht.sh without leaving neovim
- Host: GitHub
- URL: https://github.com/kilavila/cheat-sh.nvim
- Owner: kilavila
- License: mit
- Created: 2024-11-26T20:35:41.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-27T17:25:11.000Z (about 1 year ago)
- Last Synced: 2025-01-26T15:28:54.215Z (about 1 year ago)
- Topics: lua, neovim, neovim-plugin, nvim
- Language: Lua
- Homepage:
- Size: 4.88 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# cheat-sh.nvim
**cheat-sh.nvim** allows you to search the [cht.sh](https://cht.sh) website directly from Neovim,
enabling you to get code examples and documentation without leaving your editor.
## Installation
To install **cheat-sh.nvim**, add the following to your Neovim configuration:
```lua
{ 'kilavila/cheat-sh.nvim' }
```
## Configuration
Add keybinding:
```lua
vim.keymap.set('n', 'sc', 'lua require("cheat-sh").search()')
vim.keymap.set('n', 'sx', 'lua require("cheat-sh").get_cursor_word(true)')
-- get_cursor_word(true) will open the search window so you can edit the query
-- without or set to false will run the search on cursor word
```
## Usage
Open the search window, type f.ex: `lua/:learn` and press enter.
You can also learn about cht.sh while using this plugin,
try searching for `:intro`, `:list` and `:help`.
## TODO
- [ ] Add completion for search field(using /:list)
- [ ] Language detection for syntax highlighting