From fa699348a8b40d7cb382c795b1096788c287df33 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Thu, 22 Feb 2018 13:15:16 -0600 Subject: [PATCH] Add Escaping Terminal Mode In An Nvim Termianl as a vim til --- README.md | 3 ++- ...aping-terminal-mode-in-an-nvim-terminal.md | 27 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 vim/escaping-terminal-mode-in-an-nvim-terminal.md diff --git a/README.md b/README.md index dbb39a2..fd2e8a4 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ smart people at [Hashrocket](http://hashrocket.com/). For a steady stream of TILs from a variety of rocketeers, checkout [til.hashrocket.com](https://til.hashrocket.com/). -_623 TILs and counting..._ +_624 TILs and counting..._ --- @@ -641,6 +641,7 @@ _623 TILs and counting..._ - [Display Word Count Stats](vim/display-word-count-stats.md) - [Edges Of The Selection](vim/edges-of-the-selection.md) - [End Of The Word](vim/end-of-the-word.md) +- [Escaping Terminal-Mode In An Nvim Terminal](vim/escaping-terminal-mode-in-an-nvim-terminal.md) - [Filter Lines Through An External Program](vim/filter-lines-through-an-external-program.md) - [Fix The Spelling Of A Word](vim/fix-the-spelling-of-a-word.md) - [Fold A Visual Selection And Expand It Back](vim/fold-a-visual-selection-and-expand-it-back.md) diff --git a/vim/escaping-terminal-mode-in-an-nvim-terminal.md b/vim/escaping-terminal-mode-in-an-nvim-terminal.md new file mode 100644 index 0000000..a87f74a --- /dev/null +++ b/vim/escaping-terminal-mode-in-an-nvim-terminal.md @@ -0,0 +1,27 @@ +# Escaping Terminal-Mode In An Nvim Terminal + +A recent +[TIL](https://til.hashrocket.com/posts/iity78ly38-open-a-zsh-terminal-in-a-split-window-in-neovim) +by Chris Erin showed how to split open a terminal in a +[Neovim](https://neovim.io/) session -- `:sp term://zsh`. + +The terminal is emulated into a Vim buffer which means that you can treat it +sort of like any other Vim buffer. You start in Normal mode. Once you use +any mapping that would transition you into Insert mode, you'll instead find +yourself in _Terminal_ mode. Terminal mode works just like any `zsh` +session (give `ls` a try). + +Try hitting `` though and you'll see that you stay in Terminal mode +instead of being transitioned back to Normal mode. + +So how do you get back to Normal mode? + +Hit ``. + +This is a pretty awkward key mapping though, so follow [the Nvim Terminal +docs](https://neovim.io/doc/user/nvim_terminal_emulator.html) and bring back +the Escape key. + +```vimscript +:tnoremap +```