About: Automatically sort Quickfix list   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : 134.155.108.49:8890 associated with source dataset(s)

Create file ~/.vim/plugin/quickfix.vim (Unix) or $HOME/vimfiles/plugin/quickfix.vim (Windows) containing the script below, then restart Vim. After a quickfix command such as :grep is run, the script will automatically be invoked by the QuickfixCmdPost event, and the quickfix list will be sorted by file name and line number, and duplicates will be removed.

AttributesValues
rdfs:label
  • Automatically sort Quickfix list
rdfs:comment
  • Create file ~/.vim/plugin/quickfix.vim (Unix) or $HOME/vimfiles/plugin/quickfix.vim (Windows) containing the script below, then restart Vim. After a quickfix command such as :grep is run, the script will automatically be invoked by the QuickfixCmdPost event, and the quickfix list will be sorted by file name and line number, and duplicates will be removed.
Version
  • 7(xsd:integer)
dbkwik:vim/property/wikiPageUsesTemplate
Previous
  • 1638(xsd:integer)
Author
  • EUEU
Subpage
  • /200911
Complexity
  • basic
Created
  • 2009(xsd:integer)
ID
  • 1639(xsd:integer)
NEXT
  • 1640(xsd:integer)
abstract
  • Create file ~/.vim/plugin/quickfix.vim (Unix) or $HOME/vimfiles/plugin/quickfix.vim (Windows) containing the script below, then restart Vim. After a quickfix command such as :grep is run, the script will automatically be invoked by the QuickfixCmdPost event, and the quickfix list will be sorted by file name and line number, and duplicates will be removed. function! s:CompareQuickfixEntries(i1, i2) if bufname(a:i1.bufnr) == bufname(a:i2.bufnr) return a:i1.lnum == a:i2.lnum ? 0 : (a:i1.lnum < a:i2.lnum ? -1 : 1) else return bufname(a:i1.bufnr) < bufname(a:i2.bufnr) ? -1 : 1 endif endfunction function! s:SortUniqQFList() let sortedList = sort(getqflist(), 's:CompareQuickfixEntries') let uniqedList = [] let last = '' for item in sortedList let this = bufname(item.bufnr) . " " . item.lnum if this !=# last call add(uniqedList, item) let last = this endif endfor call setqflist(uniqedList) endfunction autocmd! QuickfixCmdPost * call s:SortUniqQFList()
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software