]> Sergey Matveev's repositories - codecomm.git/blob - plugin/codecomm.vim
Counter state in external file
[codecomm.git] / plugin / codecomm.vim
1 vim9script
2
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
6
7 if exists("*codecomm#Do") | finish | endif
8
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"
13 endif
14
15 function CCRangeWrapper() range
16     call codecomm#Do(a:firstline, a:lastline, FugitiveExtractGitDir(getcwd()))
17 endfunction
18
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>