3 # Code comments preparation helper
4 # Maintainer: Sergey Matveev <stargrave@stargrave.org>
5 # License: GNU General Public License version 3 of the License or later
7 if exists("*codecomm#Do") | finish | endif
9 if !exists("g:codecomm_txt")
10 var tmp = (getenv("TMPDIR") == null) ? "/tmp" : getenv("TMPDIR")
11 g:codecomm_txt = tmp .. "/" .. "codecomm.txt"
12 g:codecomm_ctr = tmp .. "/" .. "codecomm.ctr"
15 function CCRangeWrapper() range
16 call codecomm#Do(a:firstline, a:lastline, FugitiveExtractGitDir(getcwd()))
19 command! CodeCommClear codecomm#Clear()
20 command! CodeCommEdit :execute "edit " .. g:codecomm_txt
21 command! -range CodeComm <line1>, <line2> call <SID>CCRangeWrapper()
22 vnoremap <silent><Leader>cc :call <SID>CCRangeWrapper()<CR>