Skip to content

Commit

Permalink
feat(nvim): add telescope bibtex
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangyinzuo committed Apr 11, 2024
1 parent 3554e13 commit 3cb6e12
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions root/.config/nvim/lua/plugins/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ return {
"nvim-telescope/telescope-media-files.nvim",
"rmagatti/session-lens",
"nvim-tree/nvim-web-devicons",
"nvim-telescope/telescope-bibtex.nvim",
},
config = plugins_setup.telescope,
},
Expand Down
28 changes: 28 additions & 0 deletions root/.config/nvim/lua/plugins_setup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,33 @@ function M.telescope()
-- See Config
git_flags = { "-c", "delta.pager=never" }
},
bibtex = {
-- Depth for the *.bib file
depth = 999,
-- Custom format for citation label
custom_formats = {},
-- Format to use for citation label.
-- Try to match the filetype by default, or use 'plain'
format = '',
-- Path to global bibliographies (placed outside of the project)
global_files = {},
-- Define the search keys to use in the picker
search_keys = { 'year', 'title' },
-- Template for the formatted citation
citation_format = '{{author}} ({{year}}), {{title}}.',
-- Only use initials for the authors first name
citation_trim_firstname = true,
-- Max number of authors to write in the formatted citation
-- following authors will be replaced by "et al."
citation_max_auth = 2,
-- Context awareness disabled by default
context = false,
-- Fallback to global/directory .bib files if context not found
-- This setting has no effect if context = false
context_fallback = true,
-- Wrapping in the preview window is disabled by default
wrap = false,
},
media_files = {
-- filetypes whitelist
-- defaults to {"png", "jpg", "mp4", "webm", "pdf"}
Expand All @@ -53,6 +80,7 @@ function M.telescope()
telescope.load_extension "fzf"
telescope.load_extension "advanced_git_search"
telescope.load_extension "session-lens"
telescope.load_extension "bibtex"
end

function M.mason()
Expand Down

0 comments on commit 3cb6e12

Please sign in to comment.