1737973
1737973

Reputation: 118

`vimdiff` not compatible with autocmd?

I was used to use vimdiff and loading the compared files.

Now, on vimdiff execution, it happens:

"a" [readonly] 5454L, 269796C
"b" [readonly] 241L, 10170C
Press ENTER or type command to continue

The only configuration change is the introduction of these two autocmd instructions:

autocmd BufNewFile * call s:Function()
autocmd BufReadPre * call s:Function()

Can this be a normal behavior? Can it be a mistake of mine? Can be something depending on Vim versioning? Can the desired configuration change be combined with a straightforward vimdiff load (no ENTER key needed to continue)?

Upvotes: 0

Views: 329

Answers (2)

Ben
Ben

Reputation: 8905

If you want to keep whatever messages are displayed in your function, you can set your 'cmdheight' option higher to allow displaying more messages before the "hit enter" prompt appears. This, and other suggestions here: http://vim.wikia.com/wiki/Avoiding_the_"Hit_ENTER_to_continue"_prompts

Upvotes: 1

Ingo Karkat
Ingo Karkat

Reputation: 172520

The dreaded hit-enter prompt is usually triggered by additional :echo[msg] commands, here inside your s:Function(). Either remove them, or silence the output via :silent:

autocmd BufNewFile * silent call s:Function()

Upvotes: 3

Related Questions