Git Product home page Git Product logo

command.nvim's Introduction

command.nvim

Easily select and launch commands directly from neovim

It uses toggleterm.nvim as backend

image

📦 Installation

Lazy (recommended)

With defaults

{
  "0xfraso/command.nvim",
  opts = {}, -- see section below for configuration options
  dependencies = {
    "akinsho/toggleterm.nvim",
  }
}

⚙️ Configuration

Defaults

{
  cache_file = vim.fn.stdpath("cache") .. "/commands", -- path to cache file
  sort = 'asc' -- Can be "asc", "desc" or "none"
}

⚡ Commands

command.nvim exposes the following user commands:

:CommandSelect
:CommandSelectShellHistory
:CommandExecLast
:CommandPrompt
:CommandPromptLast
:CommandEdit

For example, you can map commands using lazy.nvim:

{
  "0xfraso/command.nvim",
  opts = {
    cache_file = vim.fn.stdpath("cache") .. "/commands", -- path to cache file
    shell_file = os.getenv('HOME') .. "/.zsh_history",   -- change with your shell history file
    sort = "asc"
  },
  dependencies = {
    "akinsho/toggleterm.nvim",
    "stevearc/dressing.nvim", -- optional, but recommended
  },
  keys = {
    { "<leader>tl", ":CommandSelect<CR>",             desc = "Select command" },
    { "<leader>tr", ":CommandSelectShellHistory<CR>", desc = "Select command from history file" },
    { "<leader>tp", ":CommandPrompt<CR>",             desc = "Prompt command" },
    { "<leader>tP", ":CommandPromptLast<CR>",         desc = "Prompt last command" },
    { "<leader>tc", ":CommandExecLast<CR>",           desc = "Exec last command" },
    { "<leader>te", ":CommandEdit<CR>",               desc = "Edit commands file" },
  }
}

command.nvim's People

Contributors

0xfraso avatar

Stargazers

Yuta Katayama avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.