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

  • Home
  • SEARCH
  • 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 7849785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:38:17+00:00 2026-06-02T18:38:17+00:00

I am editing an html file but when I invoke the NERD commenter it

  • 0

I am editing an html file but when I invoke the NERD commenter it is adding js comments (/*...*/) rather than html ones (<!-- ... -->). I have just installed the latest version (2.3.0) and am using vim 7.3.

How can I fix this?

Thanks

EDIT: Digging into this more, I found in the source code of NERD_commenter.vim a list of all the supported filetypes. Oddly, xhtml and html do not appear on the list:

\ 'htmlcheetah': { 'left': '##' },
\ 'htmldjango': { 'left': '<!--','right': '-->', 'leftAlt': '{#', 'rightAlt': '#}' },
\ 'htmlos': { 'left': '#', 'right': '/#' },

I feel this cannot be right somehow. Also, bonus question: Assuming you get html comments to work, can this plugin detect when the cursor is between <script> tags and change the comment to js comments when it is?

  • 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-06-02T18:38:20+00:00Added an answer on June 2, 2026 at 6:38 pm

    Digging into the NERD-commenter code, it seems that when the filetype is not in it’s list, it extracts it from a vim option named &commentstring. My guess would be that some other plugin/configurations has changed &commentstring for html files(probably to better support javascript comments).

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

Sidebar

Related Questions

I use DOMDocument for editing some HTML files, but some of theme have in
I am editing file: /templates/account/base.html and in it want to include: /templates/profiles/includes/sub_nav.html I have
I edited the index.template.html file, adding a script block to the HEAD section, but
we have all luxury with Firebug , Editing Html (In-Browser ) , CSS (In-Browser
I have two questions: While editing a source file, it's very convenient to be
I editing a latex file into html and I want to change all \\
In IntelliJ IDEA, when I am editing an HTML file and open a tag
I have been having a very difficult time editing my .htaccess file to do
I'm editing an HTML file in Vim and I want the browser to refresh
To do this manual i just pick a html file in the change wallpaper

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.