From 9dfe745294a87a1666325bb4959c164422cc84b5 Mon Sep 17 00:00:00 2001
From: Max Christian Pohle
Date: Wed, 10 May 2017 07:59:38 +0200
Subject: Improved nvim terminal integration

---
 vimrc-full | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/vimrc-full b/vimrc-full
index 5b7327a..6946b1b 100644
--- a/vimrc-full
+++ b/vimrc-full
@@ -306,8 +306,8 @@ set redrawtime=400            | " The time in milliseconds for redrawing the dis
 set scrolljump=5              | " how many lines get scrolled into view when cursor reaches the screens edge
 set splitbelow                | " open new windows below the current one (i find that more intuitive)
 set shiftround                | " indent/unindent snaps to multiple of shiftwidth
-" set showcmd                   | " essential: show keys of combined commands in the lower right corner (BUT SLOW, makes cursor flickering)
-set noshowcmd                   | " essential: show keys of combined commands in the lower right corner (BUT SLOW, makes cursor flickering)
+set showcmd                   | " essential: show keys of combined commands in the lower right corner (BUT SLOW, makes cursor flickering)
+" ret noshowcmd                   | " essential: show keys of combined commands in the lower right corner (BUT SLOW, makes cursor flickering)
 set winwidth=30               | " keep NERDTreeWindow at least this size
 set winminwidth=30            | " (and all other windows, so TODO: watch out)
 set tags+=../tags
@@ -461,7 +461,9 @@ if has("autocmd")
   augroup END
 
   if has('nvim')
-    autocmd BufEnter term://* set nobuflisted
+    autocmd TermOpen term://* set nobuflisted
+    " use default ESC key to leave insert mode in the internal terminal emulator
+    tnoremap <Esc> <C-\><C-n>
   else
     augroup vimonly
       autocmd VimLeave * call system("echo -n $'" . escape(getreg(), "'") . "' | xsel -ib")
-- 
cgit v1.2.3