vim9script # Code comments preparation helper # Maintainer: Sergey Matveev # License: GNU General Public License version 3 of the License or later if exists("*codecomm#Do") | finish | endif if !exists("g:codecomm_file") g:codecomm_file = ((getenv("TMPDIR") == null) ? "/tmp" : getenv("TMPDIR")) .. "/" .. "codecomm.txt" endif if !exists("g:codecomm_count") | g:codecomm_count = 0 | endif function CCRangeWrapper() range call codecomm#Do(a:firstline, a:lastline, FugitiveExtractGitDir(getcwd())) endfunction command! CodeCommClear codecomm#Clear() command! CodeCommEdit :execute "edit " .. g:codecomm_file command! -range CodeComm , call CCRangeWrapper() vnoremap cc :call CCRangeWrapper()