Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/LucasTavaresA/simpleCommand.nvim
Saves a table of commands based on cwd
https://github.com/LucasTavaresA/simpleCommand.nvim
coderunner executable lua neovim neovim-plugin nvim nvim-plugin run-command shell vim
Last synced: 3 months ago
JSON representation
Saves a table of commands based on cwd
- Host: GitHub
- URL: https://github.com/LucasTavaresA/simpleCommand.nvim
- Owner: LucasTavaresA
- License: gpl-3.0
- Created: 2022-12-10T11:23:53.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-27T03:48:26.000Z (over 1 year ago)
- Last Synced: 2024-04-16T03:06:01.068Z (7 months ago)
- Topics: coderunner, executable, lua, neovim, neovim-plugin, nvim, nvim-plugin, run-command, shell, vim
- Language: Lua
- Homepage:
- Size: 39.1 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# simpleCommand.nvim
Simple command runner that prompts you for a command based on neovim cwd and save a lua
table to a file## Installation
[packer.nvim](https://github.com/wbthomason/packer.nvim):
```lua
use {
'lucastavaresa/simpleCommand.nvim',
config = function()
require("simpleCommand").setup()
end
}
```## Usage
```lua
-- executes with ":! "
vim.keymap.set("n", "c", require("simpleCommand").command)
-- executes in a fullscreen terminal
vim.keymap.set("n", "c", function()
require("simpleCommand").command(":edit term://")
end)
-- executes in a terminal split
vim.keymap.set("n", "c", function()
require("simpleCommand").command(":split term://")
end)
-- executes in a vertical terminal split
vim.keymap.set("n", "c", function()
require("simpleCommand").command(":vsplit term://")
end)
-- executes in a floating window
vim.keymap.set("n", "c", function()
require("simpleCommand").command("float")
end)
```## Customization
Default config:
```lua
require("simpleCommand").setup({
prompt = "command> ",
-- file where commands are saved.
commands_file = vim.fn.stdpath("data") .. "/simpleCommand.nvim/commands.lua",
})
```### floating window
Options to customize the floating window
```lua
float = {
close_key = "",
-- Window border (see ':h nvim_open_win')
border = "none",
-- Num from `0 - 1` for measurements
height = 0.8,
width = 0.8,
x = 0.5,
y = 0.5,
-- Highlight group for floating window/border (see ':h winhl')
border_hl = "FloatBorder",
float_hl = "Normal",
-- Transparency (see ':h winblend')
blend = 0,
},
```