From 5156e1aae36a153be98b6832ab3ced7be2b2faee Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Mon, 20 May 2024 16:06:57 +0200 Subject: refactor(hm): Rename to `modules/home` --- .../home/soispha/conf/nvim/files/ftplugin/tex.lua | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 modules/home/soispha/conf/nvim/files/ftplugin/tex.lua (limited to 'modules/home/soispha/conf/nvim/files/ftplugin/tex.lua') diff --git a/modules/home/soispha/conf/nvim/files/ftplugin/tex.lua b/modules/home/soispha/conf/nvim/files/ftplugin/tex.lua new file mode 100644 index 00000000..f3fffa86 --- /dev/null +++ b/modules/home/soispha/conf/nvim/files/ftplugin/tex.lua @@ -0,0 +1,57 @@ +-- local used = false; +-- vim.keymap.set('n', 't', function() +-- used = not used; +-- if used then +-- require('nvim-treesitter.configs').setup { +-- highlight = { +-- additional_vim_regex_highlighting = { "latex", "markdown" }, +-- }, +-- } +-- else +-- require('nvim-treesitter.configs').setup { +-- highlight = { +-- additional_vim_regex_highlighting = { "" }, +-- }, +-- } +-- end +-- end +-- ); +-- +-- + +-- Set tex specific telescope extension +require("telescope").setup({ + extensions = { + bibtex = { + -- Depth for the *.bib file + depth = 1, + -- Path to global bibliographies (placed outside of the project) + global_files = {}, + -- Define the search keys to use in the picker + search_keys = { "author", "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, + -- Wrapping in the preview window is disabled by default + wrap = false, + -- Custom format for citation label + custom_formats = { + { id = "tex_autocite", cite_marker = "\\autocite{%s}" }, + }, + format = "tex_autocite", + -- Use context awareness + context = true, + -- Fallback to global/directory .bib files if context not found + -- This setting has no effect if context = false + context_fallback = true, + }, + }, +}) +require("telescope").load_extension("bibtex") +vim.keymap.set("n", "ib", function() + require("telescope").extensions.bibtex.bibtex() +end, { noremap = true, silent = true, desc = "list bibtex entries in telescope" }) -- cgit 1.4.1