You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

为何vi将.lrp后缀文件识别为tar文件且无法编辑?

Fixing Vim's "tar#Browse" Error When Editing .lrp Files

Hey there! I’ve dealt with this exact frustrating issue across multiple Linux distros and macOS too—here’s what’s going on and how to fix it permanently.

What’s Causing the Error?

Vim’s built-in tar.vim plugin (which handles browsing tar archive files) automatically associates the .lrp file extension with tar-based archives. LRP files (used for Linux Router Project systems) do have tar-like components, but they aren’t standard tar archives—so when Vim tries to load them in tar browse mode, it throws that red ***error*** (tar#Browse) message.

Since this is part of Vim’s default plugin behavior, it’s why you’re seeing it across OS X High Sierra, Ubuntu 16.04, Debian, and your colleagues’ devices, regardless of .vimrc tweaks (unless your config overrides this association).

Quick Temporary Fixes

If you just need to edit a .lrp file right now:

  • Open the file with the ++noplugin flag to skip the tar plugin for this session only:
    vi ++noplugin yourfile.lrp
    
  • Or once Vim is open and showing the error, run this command to reset the filetype and disable the tar mode:
    :set filetype=text
    

Permanent Solution (No More Errors!)

To make Vim stop treating .lrp files as tar archives forever, add one of these lines to your ~/.vimrc (or ~/.vim/vimrc on some systems):

Option 1: Force .lrp files to use plain text mode

This is the simplest approach:

autocmd BufNewFile,BufRead *.lrp set filetype=text

Option 2: Tell the tar plugin to ignore .lrp files

If you want to keep other tar-related associations intact but exclude .lrp, use this:

autocmd BufRead,BufNewFile *.lrp let b:tar_ignore=1

After saving your .vimrc, restart Vim—you’ll be able to edit .lrp files normally without any red error bars.

内容的提问来源于stack exchange,提问作者Balthasar

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 03:23:39