diff-to-logmsg.vim
来自「subversion-1.4.3-1.tar.gz 配置svn的源码」· VIM 代码 · 共 47 行
VIM
47 行
" diff-to-logmsg.vim by Ph. Marek <philipp.marek@bmlv.gv.at>" " Usage is as follows:"" diff -urp subversion.orig subversion.mine > patch" or " svn diff --diff-cmd=diff --extensions="-up" [TARGET...] > patch"" (the -p tells diff to output the function names), then"" vi patch" :source diff_to_logmsg.vim"" and voila! Just the documentation has to be written."" Note from Julian Foad:" It ought to be noted that the generated list of function names" is only as accurate as the output of "diff -p", which is not very" accurate - e.g. for changes to a doc string appearing before a " function, it generally outputs the name of the _previous_ function." goto start of patch and insert the header (until the .):0insert[[[]]]." search for file and function names and put them before the ]]]:g/^\(---\|@@\)/normal ""yygg/]]]kk""p" change the copied lines to the wanted scheme:0:1;/]]]/ s#--- \([^\t ]\+\).\+#\r* \1#e:1;/]]]/ s#@@ .\+ @@.*\<\(\w\+\) *(.*# (\1): #e" all lines without function names are ignored:1;/]]]/ g#@@ .\+#normal dd" remove duplicates:1;/]]]/ !uniq
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?