On Wednesday, November 11, 2015 at 5:05:06 PM UTC+1, Ben Fritz wrote: > On Wednesday, November 11, 2015 at 9:32:55 AM UTC-6, Jérôme Reybert wrote: > > 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? > > > > Use "acwrite" instead of "nofile" for your buftype, then you just use > BufWriteCmd to define what happens when you write your buffer. > > Unless you needed "nofile" for reasons like not warning on quit or something?
I already tried the 'acwrite' mode. But the buffer content can be modified by both the user and the plugin. Then, if I set the 'acwrite' mode, I get a warning when I close the buffer. -- -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
