telescope-firefox.nvim
is an extension for Neovim’s
telescope.nvim to
search and open Firefox bookmarks and history. It can be downloaded
here.
telescope-firefox.nvim
is an extension, so you need telescope.nvim
to make it work.
The package also needs sqlite.lua to be able to access the database containing bookmarks and history.
Install using Plug.
Plug 'nvim-telescope/telescope.nvim'
Plug 'kkharji/sqlite.lua'
Plug 'dawsers/telescope-firefox.nvim'
and setup and configure using lua:
require('telescope').load_extension('firefox')
-- These are the default values, usually correct for Linux.
--
-- For MacOS or Windows, adapt the configuration, search
-- where your Firefox profile is. It is usually in these
-- directories:
--
-- MacOS: "Library/Application Support/Firefox"
-- Windows: "Appdata/Roaming/Mozilla/Firefox"
--
-- The url open command is also different depending on the OS,
-- 'open' (MacOS), 'start firefox' or 'explorer' (Windows)
--
require('telescope').setup {
extensions = {
firefox = {
url_open_command = 'xdg-open',
firefox_profile_dir = '~/.mozilla/firefox',
firefox_profile_glob = '*.default*',
},
}
}
Command | Description |
---|---|
Telescope firefox search | List every visited place |
Telescope firefox bookmarks | List bookmarks |
Telescope firefox history | List history |
There are no default mappings for any of the commands.
The extension supports Telescope’s multiple selections.
The key bindings are these:
Key | Description |
---|---|
<CR> | Open selected url(s) in default browser |
<C-y> | Yank selected url(s) |
There are no default key bindings to call telescope-firefox.nvim
commands,
these are an example you may want to use:
" There are no default keyboard bindings, these are an example
nnoremap <silent> <leader>Ff :Telescope firefox search<CR>
nnoremap <silent> <leader>Fb :Telescope firefox bookmarks<CR>
nnoremap <silent> <leader>Fh :Telescope firefox history<CR>
There are four highlighting groups you can use to customize the look of the
results: TelescopeFirefoxDate
, TelescopeFirefoxFolder
,
TelescopeFirefoxTitle
and TelescopeFirefoxUrl
. You can assign colors to
them customizing your colorscheme, or in your Neovim configuration.
-- These are the default values for the highlighting groups if you don't
-- modify them
vim.cmd("highlight default link TelescopeFirefoxDate Number")
vim.cmd("highlight default link TelescopeFirefoxFolder Keyword")
vim.cmd("highlight default link TelescopeFirefoxTitle Function")
vim.cmd("highlight default link TelescopeFirefoxUrl Comment")