Skip to content

Commit

Permalink
fix(ToggleTerm/keymap): respect v:count (#1012)
Browse files Browse the repository at this point in the history
* fix(keymap): be able to open multiple terminals according to toggleterm default behavior.

Signed-off-by: ayamir <lgt986452565@gmail.com>

* fix(toggleterm/keymap): `<C-\>` missing direction spec

* fixup! fix(toggleterm/keymap): `<C-\>` missing direction spec

---------

Signed-off-by: ayamir <lgt986452565@gmail.com>
Co-authored-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com>
  • Loading branch information
ayamir and Jint-lzxy authored Sep 30, 2023
1 parent 83eb3b5 commit bdb0898
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions lua/keymap/tool.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ local plug_map = {
-- Plugin: toggleterm
["t|<Esc><Esc>"] = map_cmd([[<C-\><C-n>]]):with_noremap():with_silent(), -- switch to normal mode in terminal.
["t|jk"] = map_cmd([[<C-\><C-n>]]):with_noremap():with_silent(), -- switch to normal mode in terminal.
["n|<C-\\>"] = map_cr([[execute v:count . "ToggleTerm direction=horizontal"]])
["n|<C-\\>"] = map_cr("ToggleTerm direction=horizontal")
:with_noremap()
:with_silent()
:with_desc("terminal: Toggle horizontal"),
Expand All @@ -32,7 +32,7 @@ local plug_map = {
:with_silent()
:with_desc("terminal: Toggle horizontal"),
["t|<C-\\>"] = map_cmd("<Cmd>ToggleTerm<CR>"):with_noremap():with_silent():with_desc("terminal: Toggle horizontal"),
["n|<A-\\>"] = map_cr([[execute v:count . "ToggleTerm direction=vertical"]])
["n|<A-\\>"] = map_cr("ToggleTerm direction=vertical")
:with_noremap()
:with_silent()
:with_desc("terminal: Toggle vertical"),
Expand All @@ -41,7 +41,7 @@ local plug_map = {
:with_silent()
:with_desc("terminal: Toggle vertical"),
["t|<A-\\>"] = map_cmd("<Cmd>ToggleTerm<CR>"):with_noremap():with_silent():with_desc("terminal: Toggle vertical"),
["n|<F5>"] = map_cr([[execute v:count . "ToggleTerm direction=vertical"]])
["n|<F5>"] = map_cr("ToggleTerm direction=vertical")
:with_noremap()
:with_silent()
:with_desc("terminal: Toggle vertical"),
Expand All @@ -50,10 +50,7 @@ local plug_map = {
:with_silent()
:with_desc("terminal: Toggle vertical"),
["t|<F5>"] = map_cmd("<Cmd>ToggleTerm<CR>"):with_noremap():with_silent():with_desc("terminal: Toggle vertical"),
["n|<A-d>"] = map_cr([[execute v:count . "ToggleTerm direction=float"]])
:with_noremap()
:with_silent()
:with_desc("terminal: Toggle float"),
["n|<A-d>"] = map_cr("ToggleTerm direction=float"):with_noremap():with_silent():with_desc("terminal: Toggle float"),
["i|<A-d>"] = map_cmd("<Esc><Cmd>ToggleTerm direction=float<CR>")
:with_noremap()
:with_silent()
Expand Down

0 comments on commit bdb0898

Please sign in to comment.