Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/renerocksai/commandprompt.nvim
https://github.com/renerocksai/commandprompt.nvim
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/renerocksai/commandprompt.nvim
- Owner: renerocksai
- License: mit
- Created: 2023-04-01T01:22:11.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-04-01T01:26:15.000Z (almost 2 years ago)
- Last Synced: 2024-05-02T02:34:02.995Z (8 months ago)
- Language: Lua
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CommandPromt.nvim - Neovim Plugin for a simple command picker
This is a plugin for Neovim that allows you to easily pick and execute commands
using Telescope.## Installation
To use this plugin, you need to have
[Telescope](https://github.com/nvim-telescope/telescope.nvim) installed.You can install this plugin using your favorite plugin manager. For example,
using [vim-plug](https://github.com/junegunn/vim-plug):```vim
Plug 'renerocksai/CommandPrompt.nvim'
```## Usage
This plugin defines a list of default commands that you can execute using the
command picker. You can also define your own commands by passing them to the
`setup` function:```lua
require('commandprompt').setup({
{
description = "Summarize",
cmd = ':ChatGPTRun turbo-sum',
}
,{
description = "Make it sound more professional",
cmd = ':ChatGPTRun en-professional',
}
})
-- Add a keymapping to open the command picker
vim.api.nvim_set_keymap('n', 'g', ':lua require("commandprompt").command_picker()', { noremap = true, silent = true })
vim.api.nvim_set_keymap('v', 'g', ':lua require("commandprompt").command_picker()', { noremap = true, silent = true })
```To open the command picker, press `g` in normal mode or `g` in
visual mode.## Customization
You can customize the behavior of the command picker by passing options to the
`command_picker` function. For example:```lua
require('gptcommands').command_picker({
prompt_title = "My Commands",
sorter = require('telescope.sorters').get_fzy_sorter(),
})
```For more information on the available options, see the [Telescope documentation](https://github.com/nvim-telescope/telescope.nvim#pickers).
## License
This plugin is licensed under the MIT License. See the [LICENSE](LICENSE) file
for details.