>如果我必须多次跳转:cn来比较代码的其他部分,找到最后编辑的条目:cp是很困难的. :cw有帮助,但在更大的列表上,它也变得困难.删除固定条目会很有帮助.
>在重构时,我偶尔会遇到一些我希望稍后返回的代码.使用全局标记是可以的,但将当前位置添加到quickfix列表会更有帮助.
所以我希望找到一个简单的命令:help quicktext将位置添加到quickfix列表或删除已经修复的条目.但我能找到的只有:cbuffer或:caddb.但是在编辑缓冲区之后:cw我得到一条消息,它是不可修改的.帮助文本提供了以下解决方案(但我真的不想编写临时文件):
Note: Making changes in the quickfix window has no effect on the list of
errors. ‘modifiable’ is off to avoid making changes. If you delete or insert
lines anyway,the relation between the text and the error number is messed up.
If you really want to do this,you Could write the contents of the quickfix
window to a file and use “:cfile” to have it parsed and used as the new error
list.
或许有:cad可以添加当前行吗?还是有人在考虑其他工作流程?
解决方法
这会覆盖quickfix列表中的dd(无论如何都是无用的,因为可修改已关闭)从quickfix列表中删除当前行(光标的当前行,而不是当前的quickfix项).
我无法弄清楚如何以编程方式确定当前的quickfix项目,这是我如何决定使用dd,使其更明显地应用于游标行.
我希望你会发现这很有用.
" When using `dd` in the quickfix list,remove the item from the quickfix list. function! RemoveQFItem() let curqfidx = line('.') - 1 let qfall = getqflist() call remove(qfall,curqfidx) call setqflist(qfall,'r') execute curqfidx + 1 . "cfirst" :copen endfunction :command! RemoveQFItem :call RemoveQFItem() " Use map <buffer> to only map dd in the quickfix window. Requires +localmap autocmd FileType qf map <buffer> dd :RemoveQFItem<cr>
更新:我已经解决了上面找到的一些问题.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。