Wednesday, November 11, 2015

How to catch a write command in a butype=nofile buffer

I am trying to catch write commands, to perform some specific commands when user enters a write command (:w, :x, or anything else).

In my plugin, I use a buffer with parameter buftype=nofile

I tried BufWriteCmd and BufWritePre, but these hooks come too late, I always get:

> E382: Cannot write, 'buftype' option is set

I currently use a cmap mapping, but I am not satisfied with this solution.

Is anyone has an advice?

Thanks,

Jérôme

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment