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_txt") var tmp = (getenv("TMPDIR") == null) ? "/tmp" : getenv("TMPDIR") g:codecomm_txt = tmp .. "/" .. "codecomm.txt" g:codecomm_ctr = tmp .. "/" .. "codecomm.ctr" endif function CCRangeWrapper() range call codecomm#Do(a:firstline, a:lastline, FugitiveExtractGitDir(getcwd())) endfunction command! CodeCommClear codecomm#Clear() command! CodeCommEdit :execute "edit " .. g:codecomm_txt command! -range CodeComm , call CCRangeWrapper() vnoremap cc :call CCRangeWrapper()