Skip to content

sondalex/gubbins.nvim

Repository files navigation

gubbins.nvim

neovim plugin with utilities I commonly use.

System command

  1. Run a system command asynchronously and display output to separated window in one batch

    local cmd = require("gubbins.cmd")
    local waitcompletion = true
    cmd.run({ "node", "example/ls.js", "--slow" }, true, waitcompletion, nil, nil)
    batch.webm.mov
  2. Run a system command asynchronously and display output line by line.

    local cmd = require("gubbins.cmd")
    local waitcompletion = false
    cmd.run({ "node", "example/ls.js", "--slow" }, true, waitcompletion, nil, nil)
    linebyline.webm.mov

Advanced UI Layout

See ui/README.md

Example

Common usage consists of running command on keymap. Here's an example:

-- .config/lua/after/gubbins.lua
local cmd = require("gubbins.cmd")

local list_files = function()
  cmd.run({ "ls", "-l", "-h" }, true, false, nil, function(buf, win)
    vim.api.nvim_buf_set_keymap(buf, "n", "<CR>", "", {
      noremap = true,
      silent = true,
      callback = function()
        vim.api.nvim_win_close(win, false)
      end,
    })
  end)
end
vim.keymap.set("n", "<leader>lfs", list_files)

Installation

With packer:

use(
    "sondalex/gubbins.nvim"
})

Development

Building docs

ldoc lua/

Testing (Unix based only)

./tests/run

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages