]> Sergey Matveev's repositories - codecomm.git/commitdiff
codecomm filetype syntax highlight
authorSergey Matveev <stargrave@stargrave.org>
Wed, 27 May 2020 20:48:22 +0000 (23:48 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Wed, 27 May 2020 20:48:22 +0000 (23:48 +0300)
ftdetect/codecomm.vim [new file with mode: 0644]
plugin/codecomm.vim
syntax/codecomm.vim [new file with mode: 0644]

diff --git a/ftdetect/codecomm.vim b/ftdetect/codecomm.vim
new file mode 100644 (file)
index 0000000..916ecb8
--- /dev/null
@@ -0,0 +1 @@
+autocmd BufRead,BufNewFile **/codecomm.txt set filetype=codecomm
index 00efad25d0c739e6296c3ed315137dd817999bd2..c13f3787fb0eefca3a3b8ba4d9667de6e3127043 100644 (file)
@@ -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 (file)
index 0000000..eca42cd
--- /dev/null
@@ -0,0 +1,2 @@
+syntax region CCBlock start=/^-\{5}#/ end=/^-\+ >8 -\+/
+highlight link CCBlock Statement