Git Product home page Git Product logo

Comments (4)

scrooloose avatar scrooloose commented on May 18, 2024

Hey Rodrigo

What was probably happening was that the filetype was getting set to html by vim's filetype.vim first, then changed to gsp.html by your autocommand. So nerdcommenter was setting up the html delimiters, but then didnt know how to handle the 'gsp.html' filetype and so left the delimiters as html.

Ive pushed a couple of fixes to this. First, if the filetype is compound (e.g. foo.bar.baz) and the script doesnt know how to handle it, it will break down the filetype into its parts and set the delimiters for the first part that it recognizes. So you could set the filetype to gsp.html and gsp comment delimiters will be set.

Also, i have added a new option called NERDCustomDelimiters. This lets you override or add delimiters for unknown filetypes. In short, you could add something like this to your vimrc:

let g:NERDCustomDelimiters = {
\ 'gsp.html': { 'left': '<!--', 'right': '-->', 'leftAlt': '<%--', 'rightAlt': '--%>' }
\ }

If you install the latest dev version you can see :help NERDCustomDelimiters.

HTH :)

from nerdcommenter.

rosenfeld avatar rosenfeld commented on May 18, 2024

Hi Scrooloose, I've just tested it and it worked great! Thank you a lot!

Let me ask you just one more feature if you don't mind. All GSP files are also HTML files as far as I can tell you. So, it would be great if you could set its alternative comments the same as HTML. Another approach would to automatically set the alternative comment style, when absent, to the main comment style from the second filetype when using multiple filetypes. I still need to set GSP filetype as gsp.html so that I can take advantage of the HTML snippets from the snipMate plugin.

Thank you a lot!

from nerdcommenter.

scrooloose avatar scrooloose commented on May 18, 2024

I have added html delimiters as the alternative delimiters for gsp.

Your suggestion about using the next known filetype's main delimiters as the alternative delimiters is pretty good, but for now I think ill keep it simple.

from nerdcommenter.

rosenfeld avatar rosenfeld commented on May 18, 2024

Thank you very much!

from nerdcommenter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.