syntax off and syntax on effect all buffers.
This works to turn of/off syntax color for only the current buffer.
Are there other ways?
I used strftime("%c") to prevent colliding with any syntax name.
function ToggleSyntaxCurrentBuffer()
if &syntax==""
syntax enable
else
if &syntax==&ft
let &syntax=strftime("%c")
else
let &syntax=&ft
endif
endif
endfunction
nmap <silent> <F8> :call ToggleSyntaxCurrentBuffer()<cr>
imap <silent> <F8> <c-o><F8>
vmap <silent> <F8> <esc><F8>gv
--
Bill
Santa Cruz, California
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---