Vim’s modal editing system is very efficient for manipulating text with little keystrokes. Let’s say I had a list of URLs like the ones below, representing tabs. I could have the list as a text file, navigate them with arrow keys to move a text cursor, press enter or another key to focus on the tab under the cursor, d to cut a link (like cutting a file in a file explorer, or like how d deletes or cuts text in Vim), and p to put it in another position where the cursor is. I could select multiple lines to do d or p, or press y to yank (copy) them to my clipboard.

startpage.com
reddit.com/r/firefox
lemmy.ml/c/firefox

Oil.nvim seems to be a good point of reference for this. Its a Neovim plugin that acts as a file explorer, where all the files are text listed in a vim buffer, and you can do d y or p. I did a bunch of searches to see if Vimium Tridactyl or Surfing Keys can do this and nothing showed up. If they can, then an explanation would be helpful.

  • tal@lemmy.today
    link
    fedilink
    English
    arrow-up
    1
    ·
    3 months ago

    One other potential: it looks like these days – I seem to vaguely recall a bookmarks.txt years back – Firefox stores bookmarks in an sqlite database in your profile directory, “places.sqlite”.

    It also looks like people have constructed scripts to convert an SQL table to text, edit it in vim, and then reconstruct the table:

    https://github.com/BnMcGn/vibase

    You might be able to just use something like that to edit the database directly.

    That being said, it might be okay if you need one major piece of work offline, but it looks like Firefox establishes an exclusive lock on places.sqlite when it’s running, so unless offline editing is sufficient or there’s a way to request that Firefox not use exclusive access, I don’t know if this would work for you.