about summary refs log tree commit diff stats
path: root/vimrc.vim
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-06-21 14:08:30 -0700
committerKartik Agaram <vc@akkartik.com>2020-06-21 14:08:30 -0700
commit85eb81672548f8be71b6a51f3267afcd9f132489 (patch)
treedf6b67a532270e87665e42f48daa5119874ce2a4 /vimrc.vim
parent8d40bf67053c821e0f8791f53b908597c102cf28 (diff)
downloadmu-85eb81672548f8be71b6a51f3267afcd9f132489.tar.gz
6565 - support tmux in control mode
https://github.com/tmux/tmux/wiki/Control-Mode
https://www.iterm2.com/documentation-tmux-integration.html
Diffstat (limited to 'vimrc.vim')
-rw-r--r--vimrc.vim4
1 files changed, 2 insertions, 2 deletions
diff --git a/vimrc.vim b/vimrc.vim
index ad95a63e..be4da6c4 100644
--- a/vimrc.vim
+++ b/vimrc.vim
@@ -77,7 +77,7 @@ command! -nargs=0 L exec "%!grep label |grep -v clear-stream:loop"
 command! -nargs=0 C 1,.!awk '{x[$1] = $0} END{for (i in x) {if (int(i) < int($1)) {print x[i]}}}'
 
 " run test around cursor
-if empty($TMUX)
+if empty($TMUX) || (system("tmux display-message -p '#{client_control_mode}'") =~ "^1")
   " hack: need to move cursor outside function at start (`{`), but inside function at end (`<C-o>`)
   " this solution is unfortunate, but seems forced:
   "   can't put initial cursor movement inside function because we rely on <C-r><C-w> to grab word at cursor
@@ -89,7 +89,7 @@ if empty($TMUX)
     exec "normal \<C-o>"
   endfunction
 else
-  " we have tmux; we don't need to show any output in the Vim pane so life is simpler
+  " we have tmux and are not in control mode; we don't need to show any output in the Vim pane so life is simpler
   " assume the left-most window is for the shell
   noremap <Leader>t {:keeppatterns /^[^ #]<CR>:silent! call RunTestInFirstPane("<C-r><C-w>")<CR><C-o>
   function RunTestInFirstPane(arg)