2012-11-16 2 views
3

을 사용하는 경우! {cmd} vim에서 이전 명령의 출력은 기본적으로 지워지지 않습니다. 예를 들어, VIM에서 두 개의 외부 명령을 실행했습니다 : !을 만드십시오! gcc 입력 할 때 ! gcc, 이전 명령의 출력 ! 만들가 포함되어 있습니다 : VIM에서 이전 외부 명령의 출력을 지움


[email protected]:~$ vim 

make: *** No targets specified and no makefile found. Stop. 

shell returned 2 

Press ENTER or type command to continue 
gcc: fatal error: no input files 
compilation terminated. 

shell returned 4 

Press ENTER or type command to continue 

는 내가 분명히 현재 명령의 출력을 볼 수 있도록 정력이 된 출력을 취소하려면,이에 대한 조언을 제공 할 수 있을까?

답변

3

처음으로 /usr/bin/clear을 실행할 수 있습니다.

:!clear && make 

this tip을 사용하여 새 스크래치 버퍼를 열 수도 있습니다.

0

쉘 변수를 .vimrc으로 설정하여 vim의 모든 명령 실행을 원하는대로 스크립트로 감쌀 수 있습니다. 라인 .vimrc에 추가 :

set shell=~/.vim/shell-wrapper.sh 

그런 다음 명명 된 스크립트 내에서 원래 요청한 명령을 실행하기 전에 clear를 호출 할 수 있습니다. ~/.vim/shell-wrapper.sh의 최소 내용 :

#!/bin/bash 
clear 
shift # strip the -c that vim adds to bash from arguments to this script 
eval [email protected] 

당신은 여기 내 전체 설정 찾을 수 있습니다 https://github.com/timabell/dotmatrix를,

(시간이 지남에 따라 변경 될 수 https://github.com/timabell/dotmatrix/commit/1098fcbcbcefa67b7a59d7a946cda1730db8ad8b 마지막으로 글을 쓰는 시간에 투입했다)
관련 문제