LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 04-15-2018, 08:47 PM   #1
bkelly
Member
 
Registered: Jan 2008
Distribution: Centos 7-4
Posts: 205

Rep: Reputation: 13
comment lines in .vimrc


On the Centos system at work and Debian at home, when the # character is used as a comment and vi is started it whines with:

Code:
Error detected while processing /home/bkelly/.vimrc:
line   3:
E488: Trailing characters: # set noncompatible
Press ENTER or type command to continue
What must be done to get vim to recognize a comment line and to ignore it.

Edit, just in case that .vimrc contains:
Code:
set term=ansi
# set noncompatible
The first line is blank, the third line is the one that vi is, apparently, complaining about. I just noted that the option for CODE detects and omits leading blank lines and puts one or two blank lines at the end of the section.

Last edited by bkelly; 04-15-2018 at 09:03 PM.
 
Old 04-16-2018, 12:13 AM   #2
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
A search for "comments in vimrc" gave me this:
Code:
How to comment in Vim's config files .vimrc
A double quote to the left of the text you want to comment.
Example: " this is how a comment looks like in ~/.vimrc
as the first of about 12 entries before the link to this thread.

So, a sh (#) is not the comment character for the .vimrc file...double quote is.
 
1 members found this post helpful.
Old 04-16-2018, 06:09 AM   #3
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Posts: 1,622
Blog Entries: 40

Rep: Reputation: Disabled
One of the best documentations of the vimrc syntax is the system-wide, default vimrc-file, or some of the others which appear to accumulate in arbitrary places, after some years of using vim.

Here, I have for example “/etc/vimrc
Another one is “/usr/share/vim/vim80/vimrc_example.vim”, with “80” replaced by any vim-version available on your system.
 
1 members found this post helpful.
Old 05-25-2018, 01:13 AM   #4
andreyssop
LQ Newbie
 
Registered: May 2018
Location: Россия
Distribution: andreyssopWU
Posts: 8

Rep: Reputation: 0
comment lines in vimrc

Hi,

How do you comment code in HTMLPad? Ctrl-/ des not work.

Thanks
 
Old 05-29-2018, 07:37 PM   #5
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by andreyssop View Post
Hi,

How do you comment code in HTMLPad? Ctrl-/ des not work.

Thanks
Going forward, you should start your own thread rather than add a non-related question to an existing thread.

That said, HTMLPad is just an editor.
To comment html use
Code:
<!-- comment -->
The included comment can span multiple lines.

Search for "xxx comments" where xxx is the language you want to find out how to comment.

Last edited by scasey; 05-30-2018 at 07:35 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
vimrc: persistent reports of errors in lines that were deleted escarpe Linux - Software 1 05-01-2012 03:54 PM
Comment out next 40 lines with vi-editor? Ujjain Linux - Software 3 07-06-2009 01:46 AM
Comment lines 1-9, 11-19, 21-29 using Sed kushalkoolwal Programming 8 02-03-2009 04:02 PM
listing non-comment lines scbops Linux - Newbie 5 09-18-2007 08:55 PM
awk/gawk/sed - read lines from file1, comment out or delete matching lines in file2 rascal84 Linux - General 1 05-24-2006 09:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 12:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration