From: Sergey Matveev Date: Wed, 27 May 2020 20:48:22 +0000 (+0300) Subject: codecomm filetype syntax highlight X-Git-Url: http://www.git.stargrave.org/?p=codecomm.git;a=commitdiff_plain;h=4b76c79f3998ce296ffbeda12edada6dc10cd6f3 codecomm filetype syntax highlight --- diff --git a/ftdetect/codecomm.vim b/ftdetect/codecomm.vim new file mode 100644 index 0000000..916ecb8 --- /dev/null +++ b/ftdetect/codecomm.vim @@ -0,0 +1 @@ +autocmd BufRead,BufNewFile **/codecomm.txt set filetype=codecomm diff --git a/plugin/codecomm.vim b/plugin/codecomm.vim index 00efad2..c13f378 100644 --- a/plugin/codecomm.vim +++ b/plugin/codecomm.vim @@ -54,7 +54,7 @@ function! s:CodeComm() range endfor " Spawn a new small code commenting window nonbinded to file new CodeCommCommenting - setlocal noreadonly noswapfile buftype=acwrite + setlocal noreadonly noswapfile buftype=acwrite filetype=codecomm call append("^", ready) " Separate codecomm_file consolidating function, called when buffer is saved autocmd! BufWriteCmd CodeCommCommenting @@ -71,9 +71,6 @@ function! s:CodeComm() range echohl MoreMsg | echomsg "Commented:" len(ready) "lines" | echohl None endfunction autocmd BufWriteCmd CodeCommCommenting call s:AppendCC() - " Simple syntax highlighting for that window - syntax region CCBlock start=/^-\{5}#/ end=/^-\+ >8 -\+/ - highlight link CCBlock Statement normal zR startinsert endfunction diff --git a/syntax/codecomm.vim b/syntax/codecomm.vim new file mode 100644 index 0000000..eca42cd --- /dev/null +++ b/syntax/codecomm.vim @@ -0,0 +1,2 @@ +syntax region CCBlock start=/^-\{5}#/ end=/^-\+ >8 -\+/ +highlight link CCBlock Statement