diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-03-24 15:01:33 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-03-24 15:01:33 +1300 |
commit | ebda819bd699ebc75d3ff37561c18023e8ac0165 (patch) | |
tree | 3e1c1535a47761a22aaa330636a2eab60cde7475 /bin/exm | |
parent | Add exm(1df) to work around Vim's screen-clearing (diff) | |
download | dotfiles-ebda819bd699ebc75d3ff37561c18023e8ac0165.tar.gz dotfiles-ebda819bd699ebc75d3ff37561c18023e8ac0165.zip |
Better exm(1df) implementation
Diffstat (limited to 'bin/exm')
-rwxr-xr-x | bin/exm | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1,10 +1,11 @@ #!/bin/sh -# If input is a terminal and ex(1) is the Vim version, force it to use a dumb -# terminal so it doesn't clear the screen +# Prevent Vim's ex(1) implementation from clearing the screen if [ -t 0 ] ; then ver=$(ex --version | sed '1{s/ .*//;q}') 2>/dev/null case $ver in - VIM) set -- -T builtin_dumb "$@" ;; + # Lie to Vim; tell it it's a dumb terminal, and that its required "cm" + # feature is invoked with a newline character. + VIM) set -- -T dumb -c 'exe "set t_cm=\<C-M>"' "$@" ;; esac fi exec ex "$@" |