Tuesday, January 19, 2016

add mapping for buftype=nofile?

I'd like to map q to bwipe for all bt == nofile, but I'm having trouble finding the autocmd to make it work (assuming that this is the way to go)?

I've tried (transcribed from memory)

autocmd bufreadpost *
\ if buftype == 'nofile' |
\ nnoremap <buffer> q :bwipe<qr> |
\ endif

with various types of events, but I do not seem to be choosing the right events, or am missing something else.

Secondary question, can anyone see any issues with this?

FWIW, I'm trying to make the "q" -> quit convention universal across older plugins (it seems to be a pretty common convention with newer plugins)

Any collective wisdom?

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