]> Sergey Matveev's repositories - codecomm.git/blob - plugin/codecomm.vim
vim9script
[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_file")
10     g:codecomm_file = ((getenv("TMPDIR") == null) ? "/tmp" : getenv("TMPDIR")) ..
11         "/" .. "codecomm.txt"
12 endif
13
14 if !exists("g:codecomm_count") | g:codecomm_count = 0 | endif
15
16 function CCRangeWrapper() range
17     call codecomm#Do(a:firstline, a:lastline, FugitiveExtractGitDir(getcwd()))
18 endfunction
19
20 command! CodeCommClear codecomm#Clear()
21 command! CodeCommEdit :execute "edit " .. g:codecomm_file
22 command! -range CodeComm <line1>, <line2> call <SID>CCRangeWrapper()
23 vnoremap <silent><Leader>cc :call <SID>CCRangeWrapper()<CR>