Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
Merge pull request #403 from shafouz/vimux
Browse files Browse the repository at this point in the history
added vimux executor, updated docs
  • Loading branch information
simrat39 authored Jul 10, 2023
2 parents 71d2cf6 + 648a2a9 commit 08665c6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ local opts = {
tools = { -- rust-tools options

-- how to execute terminal commands
-- options right now: termopen / quickfix
-- options right now: termopen / quickfix / toggleterm / vimux
executor = require("rust-tools.executors").termopen,

-- callback to execute once rust-analyzer is done initializing the workspace
Expand Down
2 changes: 1 addition & 1 deletion lua/rust-tools/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ local defaults = {
tools = { -- rust-tools options

-- how to execute terminal commands
-- options right now: termopen / quickfix
-- options right now: termopen / quickfix / toggleterm / vimux
executor = require("rust-tools.executors").termopen,

-- callback to execute once rust-analyzer is done initializing the workspace
Expand Down
2 changes: 2 additions & 0 deletions lua/rust-tools/executors/init.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
local termopen = require("rust-tools.executors.termopen")
local quickfix = require("rust-tools.executors.quickfix")
local toggleterm = require("rust-tools.executors.toggleterm")
local vimux = require("rust-tools.executors.vimux")

local M = {}

M.termopen = termopen
M.quickfix = quickfix
M.toggleterm = toggleterm
M.vimux = vimux

return M
14 changes: 14 additions & 0 deletions lua/rust-tools/executors/vimux.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
local utils = require("rust-tools.utils.utils")

local M = {}

function M.execute_command(command, args, cwd)
local full_command = utils.chain_commands({
utils.make_command_from_args("cd", { cwd }),
utils.make_command_from_args(command, args),
})

vim.fn.VimuxRunCommand(full_command)
end

return M

0 comments on commit 08665c6

Please sign in to comment.