Tuesday, May 3, 2011

BufReadPost getfsize and scp

I am using an autocommand to disable syntax highlighting for large
files.

I do this with:

au BufReadPost * if getfsize(bufname("%")) > 512*1024 | set syntax= |
endif

This will disable syntax for files bigger than 512kB.
However this is not working if I access files via scp://...

I assume vim thinks the file has 0Bytes and therefore does not disable
the hightlighting.
I tried some other events (e.g. BufWinEnter), but they didn't work
either for this.

Has anyone experience with events and scp or a good tip how to solve
this?

It would also help if there is a way to let Vim print out every event
it throws.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: