Skip to content

dawsers/telescope-firefox.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

telescope-firefox.nvim

Introduction

telescope-firefox.nvim is an extension for Neovim’s telescope.nvim to search and open Firefox bookmarks and history. It can be downloaded here.

Requirements

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.

Installation and Configuration

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*',
    },
  } 
}

Commands

CommandDescription
Telescope firefox searchList every visited place
Telescope firefox bookmarksList bookmarks
Telescope firefox historyList history

There are no default mappings for any of the commands.

The extension supports Telescope’s multiple selections.

The key bindings are these:

KeyDescription
<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>

Highlighting

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")

About

Telescope extension to navigate Firefox's history and bookmarks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages