Может быть, что-то вроде:
function LoadFile()
0r ~/.vim/skel/tmpl.%:e
exe "normal /<CURSOR>\<Cr>"
endf
autocmd! BufNewFile * silent! call LoadFile()
Debe utilizar las opciones terminfo cup
. Esto se puede hacer desde un shell con el comando tput
.
por ejemplo
tput smcup
clear
echo hello
echo there
read
tput rmcup
Esto borrará la pantalla, imprimirá dos líneas, esperará a que presione RETURN y luego restaurará la pantalla a donde estaba antes.
Esto requiere la definición terminfo
de su terminal para admitir esto, por supuesto. No todos los terminales tienen la capacidad.
Использование clear
или tput clear
искажает историю исходного экрана при использовании в сценарии bash. Экран все еще там, но только видимый экран. Вся история ушла. Мне потребовалась целая вечность, чтобы узнать, что clear
нужно заменить наtput cup 0 0
(в моем случае работает, поместив курсор вверху слева ).
tput smcup
tput cup 0 0 # position cursor top left, simulate clear
...script
tput rmcup