Skip to content

Commit

Permalink
Merge branch 'main' of github.com:jmbuhr/telescope-zotero.nvim
Browse files Browse the repository at this point in the history
  • Loading branch information
jmbuhr committed Mar 26, 2024
2 parents 695ae60 + 7353951 commit df0d7fd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 45 deletions.
62 changes: 18 additions & 44 deletions doc/telescope-zotero.nvim.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*telescope-zotero.nvim.txt* For Neovim >= 0.9.5 Last change: 2024 March 23
*telescope-zotero.nvim.txt* For Neovim >= 0.9.5 Last change: 2024 March 26

==============================================================================
Table of Contents *telescope-zotero.nvim-table-of-contents*
Expand Down Expand Up @@ -42,53 +42,27 @@ Add to your telescope config, e.g. in lazy.nvim
dependencies = {
{ 'kkharji/sqlite.lua' },
},
-- default opts shown
-- i.e. if you want to use them
-- you can just set opts = {}
opts = {
zotero_db_path = '~/Zotero/zotero.sqlite',
better_bibtex_db_path = '~/Zotero/better-bibtex.sqlite',
-- specify options for different filetypes
-- locate_bib can be a string or a function
ft = {
quarto = {
insert_key_formatter = function(citekey)
return '@' .. citekey
end,
locate_bib = require'zotero.bib'.locate_quarto_bib,
},
tex = {
insert_key_formatter = function(citekey)
return '\\cite{' .. citekey .. '}'
end,
locate_bib = require'zotero.bib'.locate_tex_bib,
},
plaintex = {
insert_key_formatter = function(citekey)
return '\\cite{' .. citekey .. '}'
end,
locate_bib = require'zotero.bib'.locate_tex_bib,
},
-- fallback for unlisted filetypes
default = {
insert_key_formatter = function(citekey)
return '@' .. citekey
end,
locate_bib = require'zotero.bib'.locate_quarto_bib,
},
},
}
-- options:
-- to use the default opts:
opts = {},
-- to configure manually:
-- config = function
-- require'zotero'.setup{ <your options> }
-- end,
},
},
config = function()
local telescope = require 'telescope'
-- other telescope setup
-- ...
telescope.load_extension 'zotero'
end
},
config = function()
local telescope = require 'telescope'
-- other telescope setup
-- ...
telescope.load_extension 'zotero'
end
},
<

Default options:
<https://github.com/jmbuhr/telescope-zotero.nvim/blob/main/lua/zotero/init.lua#L12>


DEMO *telescope-zotero.nvim-telescope-zotero.nvim-demo*

Expand Down
2 changes: 1 addition & 1 deletion lua/zotero/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ M.picker = function(opts)
local ft_options = M.config.ft[vim.bo.filetype] or M.config.ft.default
pickers
.new(opts, {
prompt_title = 'Zotoro library',
prompt_title = 'Zotero library',
finder = finders.new_table {
results = get_items(),
entry_maker = function(pre_entry)
Expand Down

0 comments on commit df0d7fd

Please sign in to comment.