Last active
August 29, 2015 13:56
-
-
Save oupo/9309453 to your computer and use it in GitHub Desktop.
A vimperator script to show bookmarks with sorting by date added.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:js <<EOF | |
let bookmarksService = services.get("bookmarks"); | |
let bookmarks = storage["bookmark-cache"].bookmarks; | |
let idToDate = Object.create(null); | |
for (let item of bookmarks) { | |
idToDate[item.id] = bookmarksService.getItemDateAdded(item.id); | |
} | |
completion.listCompleter(function(context, tags, extra) { | |
completion.bookmark(context, tags, extra); | |
context.compare = function (a,b) (idToDate[b.item.id] - idToDate[a.item.id]); | |
}, undefined, undefined, undefined, undefined, CompletionContext.Filter.textAndDescription); | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment