liverepl

Evaluer ses scripts en temps réel (dangereux ⚠️) - retour accueil

git clone git://bebou.netlib.re/liverepl
Log | Files | Refs | README |

commit f2d0d667025bba0ea7ae2d3593561c919be1dae4
parent 0dbfaefa860aec8540eb76ccdd80a344969bc29d
Auterice: Arthur Pons <arthur.pons@unistra.fr>
Date:   Wed,  8 May 2024 14:03:01 +0200

Version vim fonctionnelle ?

Diffstat:
Mliverepl | 13++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/liverepl b/liverepl @@ -1,18 +1,17 @@ #! /bin/sh -[ -e "$2" ] && { echo "fichier $2 existe déjà"; exit 1; } -script=${1:-$(mktemp)} -data=${2:-$(mktemp)} +script=$(mktemp) +data=$(mktemp) touch "$script" chmod +x "$script" vim -c "set aw"\ - -c "autocmd TextChanged * silent! !$(pwd)/$script > $data 2>&1"\ - -c "autocmd TextChangedI * silent! !$(pwd)/$script > $data 2>&1"\ + -c "autocmd TextChanged * silent! !$script > $data 2>&1"\ + -c "autocmd TextChangedI * silent! !$script > $data 2>&1"\ -c "vnew $data"\ - -c "set ar"\ + -c "set updatetime=100 | set autoread | au CursorHoldI * checktime | au CursorHold * checktime"\ -c "wincmd h"\ - -c "autocmd FocusGained,BufEnter,CursorHold,CursorHoldI * if mode() !~ '\v(c|r.?|!|t)' && getcmdwintype() == '' | checktime | endif"\ -c "doautocmd TextChanged"\ + -c "call feedkeys('lh')"\ "$script" echo "script : $script" echo "données : $data"