From f6ac73b1756223f202ece3b0d6e8aa5997d0bdb1 Mon Sep 17 00:00:00 2001 From: Shidong Wang Date: Sun, 17 Oct 2021 23:51:28 +0800 Subject: [PATCH] revert(shell)!: revert key binding `` in terminal mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: There is no way to send Esc to terminal Solution: revert Esc in terminal, add ctrl-` key binding to hide terminal from terminal mode. merge: https://github.com/SpaceVim/SpaceVim/pull/3170 BREAKING CHANGE: revert key binding `` in terminal mode Co-authored-by: Clément Joly --- autoload/SpaceVim/layers/shell.vim | 12 +++++++----- doc/SpaceVim.txt | 10 ++++++---- docs/cn/layers/shell.md | 21 +++++++++++---------- docs/layers/shell.md | 21 +++++++++++---------- 4 files changed, 35 insertions(+), 29 deletions(-) diff --git a/autoload/SpaceVim/layers/shell.vim b/autoload/SpaceVim/layers/shell.vim index 96e7c8848..0524ec5f2 100644 --- a/autoload/SpaceVim/layers/shell.vim +++ b/autoload/SpaceVim/layers/shell.vim @@ -12,14 +12,16 @@ " SpaceVim uses deol.nvim for shell support in neovim and uses vimshell for " vim. For more info, read |deol| and |vimshell|. " -" @subsection variable +" @subsection layer options " -" default_shell: config the default shell to be used by shell layer. +" 1. `default_shell`: config the default shell to be used by shell layer. " " @subsection key bindings " > -" SPC ' Open or switch to terminal windows -" q Hide terminal windows in normal mode +" Key bindings Description +" SPC ' Open or switch to terminal windows +" q Hide terminal windows in normal mode +" ctrl-` Hide terminal window in terminal mode " < let s:SYSTEM = SpaceVim#api#import('system') @@ -63,7 +65,7 @@ function! SpaceVim#layers#shell#config() abort exe 'tnoremap :wincmd j' exe 'tnoremap :bprev' exe 'tnoremap :bnext' - exe 'tnoremap ' + exe 'tnoremap :q' if s:SYSTEM.isWindows exe 'tnoremap SpaceVim#layers#shell#terminal()' exe 'tnoremap SpaceVim#layers#shell#ctrl_u()' diff --git a/doc/SpaceVim.txt b/doc/SpaceVim.txt index 6606ccdb8..6eb7ab360 100644 --- a/doc/SpaceVim.txt +++ b/doc/SpaceVim.txt @@ -4565,15 +4565,17 @@ SHELL *SpaceVim-layers-shell* SpaceVim uses deol.nvim for shell support in neovim and uses vimshell for vim. For more info, read |deol| and |vimshell|. -VARIABLE +LAYER OPTIONS -default_shell: config the default shell to be used by shell layer. + 1. `default_shell`: config the default shell to be used by shell layer. KEY BINDINGS > - SPC ' Open or switch to terminal windows - q Hide terminal windows in normal mode + Key bindings Description + SPC ' Open or switch to terminal windows + q Hide terminal windows in normal mode + ctrl-` Hide terminal window in terminal mode < ============================================================================== diff --git a/docs/cn/layers/shell.md b/docs/cn/layers/shell.md index f6933fdb1..5cbb5b493 100644 --- a/docs/cn/layers/shell.md +++ b/docs/cn/layers/shell.md @@ -57,13 +57,14 @@ The default shell is quickly accessible via a the default shortcut key `SPC '`. ## 快捷键 -| 快捷键 | 功能描述 | -| ------------ | ---------------------------------- | -| `SPC '` | 打开或跳至已打开的终端窗口 | -| `Ctrl-d` | 输入模式下关闭终端窗口 | -| `q` | Normal 模式下隐藏终端窗口 | -| `` | 从 Terminal 模式切换到 Normal 模式 | -| `Ctrl-Left` | 切换到左侧窗口 | -| `Ctrl-Up` | 切换到上方窗口 | -| `Ctrl-Down` | 切换到下方窗口 | -| `Ctrl-Right` | 切换到右侧窗口 | +| 快捷键 | 功能描述 | +| --------------- | ---------------------------------- | +| `SPC '` | 打开或跳至已打开的终端窗口 | +| `Ctrl-d` | 输入模式下关闭终端窗口 | +| `q` | Normal 模式下隐藏终端窗口 | +| `` Ctrl-` `` | Terminal 模式下隐藏终端窗口 | +| `Ctrl-\-Ctrl-n` | 从 Terminal 模式切换到 Normal 模式 | +| `Ctrl-Left` | 切换到左侧窗口 | +| `Ctrl-Up` | 切换到上方窗口 | +| `Ctrl-Down` | 切换到下方窗口 | +| `Ctrl-Right` | 切换到右侧窗口 | diff --git a/docs/layers/shell.md b/docs/layers/shell.md index 662459d09..c834a44b6 100644 --- a/docs/layers/shell.md +++ b/docs/layers/shell.md @@ -59,16 +59,17 @@ in percents with the variable `default_height`. Default value is 30. ## Key bindings -| Key Binding | Description | -| ------------ | ---------------------------------------- | -| `SPC '` | Open or switch to the terminal windows | -| `Ctrl-d` | Close terminal windows in terminal mode | -| `q` | Hide terminal windows in Normal mode | -| `` | Switch to Normal mode from terminal mode | -| `Ctrl-Left` | Switch to the windows on the left | -| `Ctrl-Down` | Switch to the windows below | -| `Ctrl-Up` | Switch to the windows on the top | -| `Ctrl-Right` | Switch to the windows on the right | +| Key Binding | Description | +| --------------- | ---------------------------------------- | +| `SPC '` | Open or switch to the terminal windows | +| `Ctrl-d` | Close terminal windows in terminal mode | +| `q` | Hide terminal windows in Normal mode | +| `` Ctrl-` `` | Hide terminal windows in terminal mode | +| `Ctrl-\-Ctrl-n` | Switch to Normal mode from terminal mode | +| `Ctrl-Left` | Switch to the windows on the left | +| `Ctrl-Down` | Switch to the windows below | +| `Ctrl-Up` | Switch to the windows on the top | +| `Ctrl-Right` | Switch to the windows on the right | ### Additional key bindings on Windows