Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

23 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

OneCommand.nvim

Running quick repeatable commands with parsable output

OneCommand.nvim came about from my need to be able to run commands quickly and repeatadly, such as running tests or SCP-ing files to a server after updating.

There are currently 2 ways that I know of doing this:

  • Use :!<command> - The output of this is not easy to handle and work with.
  • <CTRL-z> to exit, and fg to return - Can be a bit cumbersome and pollutes command history.

Features

  • Prompts for command, runs it and displays the stdout in a popup window
  • Saves previous commands to history so they can be searched and run again
  • Saves the output of last command so it can be brought back up for reference

Demo

Note: On the date command in the video I am manually pressing the refresh button.

Default style

default_style.webm

Installation

    {
        "StephenKelly94/OneCommand.nvim",
        opts = {
            -- configuration here
            -- or leave it empty to use the default settings
            -- refer to the configuration section below
        },
        keys = {
            -- Set keybindings here
        },
    }
	use ("stephenkelly94/onecommand.nvim")

Configuration

When configuring onecommand you need to use the setup function

require("onecommand").setup({
    -- configuration here
})

Options

Here is a list of the options that are configurable with their default settings

{

}

Usage

Here are the things you can do and which key binds you can use

vim.api.nvim_set_keymap(
    "n",
    "<Leader>xc",
    ':lua require("onecommand").prompt_run_command()<CR>',
    { noremap = true }
)

vim.api.nvim_set_keymap(
    "n",
    "<Leader>xh",
    ':lua require("onecommand").view_history()<CR>',
    { noremap = true }
)

vim.api.nvim_set_keymap(
    "n",
    "<Leader>xl",
    ':lua require("onecommand").show_last_command_output()<CR>',
    { noremap = true }
)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages