Skip to content

Cant open "filename" for writing: name too long #3001

@Felipe-9

Description

@Felipe-9

Description

When opening a new file i get the following error:

Error detected while processing BufReadPost Autocommands for "*":
Error executing lua callback: ...rew/Cellar/neovim/0.10.1/share/nvim/runtime/filetype.lua:35: Error executing lua: ...rew/Cellar/
neovim/0.10.1/share/nvim/runtime/filetype.lua:36: BufReadPost Autocommands for "*"..FileType Autocommands for "tex": Vim(append):
Error executing lua callback: BufReadPost Autocommands for "*"..FileType Autocommands for "tex"..function vimtex#bib#files[37]..<
SNR>94_files_manual[57]..20, line 8: Vim(call):E482: Can't open file /Users/felipepinto/.cache/vimtex/bibfiles%Users%"...long_file_name...".json for writing: name too
 long
stack traceback:
        [C]: in function 'vimtex#bib#files'
        ...cal/share/nvim/lazy/cmp-vimtex/lua/cmp_vimtex/source.lua:152: in function 'start_parser'
        ...local/share/nvim/lazy/cmp-vimtex/lua/cmp_vimtex/init.lua:15: in function <...local/share/nvim/lazy/cmp-vimtex/lua/cmp_
vimtex/init.lua:15>
        [C]: in function 'nvim_cmd'
        ...rew/Cellar/neovim/0.10.1/share/nvim/runtime/filetype.lua:36: in function <...rew/Cellar/neovim/0.10.1/share/nvim/runti
me/filetype.lua:35>
        [C]: in function 'nvim_buf_call'
        ...rew/Cellar/neovim/0.10.1/share/nvim/runtime/filetype.lua:35: in function <...rew/Cellar/neovim/0.10.1/share/nvim/runti
me/filetype.lua:10>
stack traceback:
        [C]: in function 'nvim_cmd'
        ...rew/Cellar/neovim/0.10.1/share/nvim/runtime/filetype.lua:36: in function <...rew/Cellar/neovim/0.10.1/share/nvim/runti
me/filetype.lua:35>
        [C]: in function 'nvim_buf_call'
        ...rew/Cellar/neovim/0.10.1/share/nvim/runtime/filetype.lua:35: in function <...rew/Cellar/neovim/0.10.1/share/nvim/runti
me/filetype.lua:10>
stack traceback:
        [C]: in function 'nvim_buf_call'
        ...rew/Cellar/neovim/0.10.1/share/nvim/runtime/filetype.lua:35: in function <...rew/Cellar/neovim/0.10.1/share/nvim/runti
me/filetype.lua:10>

I should note

  • Im compiling with lualatex
  • im using subfiles package
  • the file in question is a subfile with the header # !TEX root = root.tex
  • I changed some text in error to ...long_file_name... or ... they were just long names or paths to the file im trying to open

Steps to reproduce

Have my configuration and try to compile a file with a long path i guess?

vimtex.lua

return {
  "lervag/vimtex",
  lazy = false,     -- we don't want to lazy load VimTeX
  -- tag = "v2.15", -- uncomment to pin to a specific release
  init = function()
    -- VimTeX configuration goes here, e.g.
    local g = vim.g
    g.vimtex_view_method = "zathura_simple"
    g.vimtex_compiler_engine = "lualatex"
    g.tex_flavor = "lualatex"
    g.vimtex_compiler_latexmk = {
      aux_dir = ".build",
      out_dir = "",
      -- options = [[
      --   
      -- ]]
    }
    g.vimtex_quickfix_mode=0
    g.vimtex_mappings_enable=0
    g.vimtex_syntax_conceal = {
      accents = 1,             
      ligatures = 1,
      cites = 1,
      fancy = 1,
      spacing = 1,
      greek = 1,
      math_bounds = 1,
      math_delimiters = 1,
      math_fracs = 1,
      math_super_sub = 1,
      math_symbols = 1,
      sections = 0,
      styles = 1,
    }
    g.vimtex_log_ignore = ({
      "Underfull",
      "Overfull",
      "specifier changed to",
      "Token not allowed in PDF string",
    })

    -- ---@diagnostic disable-next-line: missing-fields
    -- require 'nvim-treesitter.configs'.setup {
    --   ignore_install = { "latex" },
    -- }
  end
}

Expected behavior

Open the file normally with normal capabilities

Actual behavior

opening file as a text file, no highlights or completions

Do you use a latexmkrc file?

no

VimtexInfo

System info:
  OS: macOS 14.6.1 (23G93)
  Vim version: NVIM v0.10.1
  Has clientserver: true
  Servername: /var/folders/5f/hn34hzl13y907124_kr68p380000gn/T/nvim.felipepinto/lcLxVB/nvim.9938.0

VimTeX project: AM3C-Class_Annotations.1
  base: AM3C-Class_Annotations.1.tex
  root: /Users/felipepinto/Documents/.../dir
  tex: /Users/felipepinto/Documents/.../file.tex
  main parser: texroot specifier
  document class: subfiles
  packages: calc expl3 fontenc fontsize fontspec ifluatex iftex import luacode mypallete preview shellesc xcolor xfp xkeyval xparse
  compiler: latexmk
    engine: -pdf
    options:
      -verbose
      -file-line-error
      -synctex=1
      -interaction=nonstopmode
    aux_dir: .build
    callback: 1
    continuous: 1
    executable: latexmk
  viewer: Zathura
  qf method: LaTeX logfile

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions