mirror of
https://github.com/akinsho/toggleterm.nvim
synced 2024-09-16 21:34:03 +02:00
chore(build): auto-generate vimdoc
This commit is contained in:
parent
5b84866498
commit
fb0c365534
1 changed files with 40 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
*toggleterm.txt* For Neovim >= 0.8.0 Last change: 2023 October 02
|
||||
*toggleterm.txt* For Neovim >= 0.8.0 Last change: 2023 November 22
|
||||
|
||||
==============================================================================
|
||||
Table of Contents *toggleterm-table-of-contents*
|
||||
|
@ -300,6 +300,45 @@ You can "send lines" to the toggled terminals with the following commands:
|
|||
send the lines. If the parameter is not provided, then the default is the
|
||||
`first terminal`)
|
||||
|
||||
Alternatively, for more fine-grained control and use in mappings, in lua:
|
||||
|
||||
>lua
|
||||
local trim_spaces = true
|
||||
vim.keymap.set("v", "<space>s", function()
|
||||
require("toggleterm").send_lines_to_terminal("single_line", trim_spaces, { args = vim.v.count })
|
||||
end
|
||||
-- Replace with these for the other two options
|
||||
-- require("toggleterm").send_lines_to_terminal("visual_line", trim_spaces, { args = vim.v.count })
|
||||
-- require("toggleterm").send_lines_to_terminal("visual_selection", trim_spaces, { args = vim.v.count })
|
||||
|
||||
-- For use as an operator map:
|
||||
-- Send motion to terminal
|
||||
vim.keymap.set("n", [[<leader><c-\>]], function()
|
||||
set_opfunc(function(motion_type)
|
||||
require("toggleterm").send_lines_to_terminal(motion_type, false, { args = vim.v.count })
|
||||
end)
|
||||
vim.api.nvim_feedkeys("g@", "n", false)
|
||||
end)
|
||||
-- Double the command to send line to terminal
|
||||
vim.keymap.set("n", [[<leader><c-\><c-\>]], function()
|
||||
set_opfunc(function(motion_type)
|
||||
require("toggleterm").send_lines_to_terminal(motion_type, false, { args = vim.v.count })
|
||||
end)
|
||||
vim.api.nvim_feedkeys("g@_", "n", false)
|
||||
end)
|
||||
-- Send whole file
|
||||
vim.keymap.set("n", [[<leader><leader><c-\>]], function()
|
||||
set_opfunc(function(motion_type)
|
||||
require("toggleterm").send_lines_to_terminal(motion_type, false, { args = vim.v.count })
|
||||
end)
|
||||
vim.api.nvim_feedkeys("ggg@G''", "n", false)
|
||||
end)
|
||||
<
|
||||
|
||||
Set `trim_spaces=false` for sending to REPLs for whitespace-sensitive languages
|
||||
like python. (For python, you probably want to start ipython with `ipython
|
||||
--no-autoindent`.)
|
||||
|
||||
|
||||
TOGGLETERMSETNAME ~
|
||||
|
||||
|
|
Loading…
Reference in a new issue