Skip to content

Commit

Permalink
fix(terminal-integration): finish toggleterm-manager-nvim spec
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter committed May 14, 2024
1 parent 54b9d26 commit 36de23d
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 59 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# toggleterm-mamnager.nvim
# toggleterm-manager.nvim

Manage your toggleterm terminal buffers with telescope. Additional keybindings are added in the Telescope interface to
A Telescope extension to manage Toggleterm's terminals in NeoVim

Key `<Leader>ts` is mapped to open the telescope interface.

Keymaps in the Telescope interface:
Additionally added keymaps in the Telescope interface:

- `n` normal mode:
- `<CR>`: toggle the selected terminal.
Expand All @@ -17,10 +17,4 @@ Keymaps in the Telescope interface:
- `<C-d>`: delete the selected terminal.
- `<C-i>`: create a new terminal buffer

Dependencies:

- [akinsho/nvim-toggleterm.lua](https://github.com/akinsho/toggleterm.nvim)
- [nvim-telescope/telescope.nvim](https://github.com/nvim-telescope/telescope.nvim)
- [nvim-lua/plenary.nvim](https://github.com/nvim-lua/plenary.nvim)

**Repository:** <https://github.com/ryanmsnyder/toggleterm-manager.nvim>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
return {
"ryanmsnyder/toggleterm-manager.nvim",
init = function(plugin) require("astrocore").on_load("telescope.nvim", plugin.name) end,
dependencies = {
"akinsho/toggleterm.nvim",
"nvim-telescope/telescope.nvim",
"nvim-lua/plenary.nvim",
{
"AstroNvim/astrocore",
opts = {
mappings = {
n = {
["<Leader>ts"] = { "<cmd>Telescope toggleterm_manager<cr>", desc = "Search Toggleterms" },
},
},
},
},
},
opts = function(_, opts)
local term_icon = require("astroui").get_icon "Terminal"
local toggleterm_manager = require "toggleterm-manager"
local actions = toggleterm_manager.actions

return require("astrocore").extend_tbl(opts, {
titles = { prompt = term_icon .. " Terminals" },
results = { term_icon = term_icon },
mappings = {
n = {
["<CR>"] = { action = actions.toggle_term, exit_on_action = true }, -- toggles terminal open/closed
["r"] = { action = actions.rename_term, exit_on_action = false }, -- provides a prompt to rename a terminal
["d"] = { action = actions.delete_term, exit_on_action = false }, -- deletes a terminal buffer
["n"] = { action = actions.create_term, exit_on_action = false }, -- creates a new terminal buffer
},
},
})
end,
}
50 changes: 0 additions & 50 deletions lua/astrocommunity/utility/toggleterm-manager/init.lua

This file was deleted.

0 comments on commit 36de23d

Please sign in to comment.