this post was submitted on 06 Oct 2024
18 points (95.0% liked)

Firefox

4138 readers
2 users here now

A community for discussion about Mozilla Firefox.

founded 1 year ago
MODERATORS
 

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.

top 4 comments
sorted by: hot top controversial new old
[–] [email protected] 4 points 1 month ago
[–] [email protected] 3 points 1 month ago* (last edited 1 month ago)

I remember seeing a firefox plugin that would sync tabs to a filesystem folder where you could automate them and such. It could likely help with what you're looking for. Can't recall the name.

Found it https://omar.website/tabfs/

[–] [email protected] 2 points 1 month ago* (last edited 1 month ago) (1 children)

I'm an emacs person, so I don't have a good frame of reference for what you want, but does Vimium C do what you want?

https://github.com/gdh1995/vimium-c

EDIT: Or the original Vimium, not familiar with the differences:

https://github.com/philc/vimium

[–] [email protected] 1 points 1 month 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.