Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6955597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:45:27+00:00 2026-05-27T14:45:27+00:00

I have a text file on a unix system. The following text file content

  • 0

I have a text file on a unix system. The following text file content creates the problem:

good: ok line
vi: bad line
ok: ok line

So if I run: vim test.txt, I get the following error:

"test.txt" 3L, 39C
Error detected while processing modelines:
line    2:
E518: Unknown option: bad
Press ENTER or type command to continue

If I delete my ~/.vimrc, the error disappears. But what is weird is that, even with an empty ~/.vimrc file, the error appears.

I understand that it’s because the line starts with vi: that the error is created, but I don’t understand why or how to fix this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T14:45:28+00:00Added an answer on May 27, 2026 at 2:45 pm

    The vi: bad line line is in a format that Vim recognizes as a modeline, as mentioned in the error message. Modelines allow one to set options within a file.

    The reason it isn’t triggered when you don’t have a ~/.vimrc is because Vim requires you have 'nocompatible' set for modelines to be enabled by default, since it is a Vim-specific feature. The existence of ~/.vimrc is enough for Vim to switch from vi-compatible mode to nocompatible, though, which will result in the 'modeline' option also being set.

    For future reference, you can easily find help topics in Vim via :help topic<Tab>. In this case, :help modeline<Tab> would have given you a few topics to look into which explain this feature and how to control it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a text file test.txt with the following content: text1 text2 And I
I have a text file that contains unix style line endings: a 0x0A at
I have text file with something like first line line nr 2 line three
I have created a text file in Unix environment using Java code. For writing
I have a created text file in unix enviroment using java code. For writing
I have a Java program which generates a text file on a UNIX server.
We have a command line exe that takes input from a text file and
I am doing some text processing on a unix system. I have access to
I want to filter the data from a text file in unix. I have
I have a text file, where each line is a single string of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.