Search Unity

ShaderLab highlighting in Notepad++

Discussion in 'Shaders' started by luizgpa, Apr 25, 2011.

  1. luizgpa

    luizgpa

    Joined:
    Aug 20, 2009
    Posts:
    19
    I love Visual Studio but when it comes to edit shaders it sucks. I wanted a editor that could highlight keywords and match the curly braces, so I created a "User defined language" for Notepad++.

    I just threw all the keywords I found and changed the colors randomly. I chose to ignore all the Cg code because the languages in Notepad++ can have only 4 types of keywords and I've already used all of them. Besides that, there are (or should be) better editors for Cg.

    To use it, go to View -> User-defined dialogue and import this XML file.

    I hope it will be useful. If I missed a keyword or if you have a sugestion, please contact me.
     

    Attached Files:

    fguinier likes this.
  2. reissgrant

    reissgrant

    Joined:
    Aug 20, 2009
    Posts:
    726
    Awesome, thanks for sharing!
     
  3. timeisaparallax

    timeisaparallax

    Joined:
    Sep 22, 2008
    Posts:
    35
  4. ZoomDomain

    ZoomDomain

    Joined:
    Aug 30, 2012
    Posts:
    150
    thanks it works, it took a while tho because you have to open and close the shader file, restarting notepad itself didnt apply the theme to the open docs.


    What about user>style configurator>C>extension.... and mark shaderlab as an extension of C, it should work for the CG parts ok?

    i attempted to mark shaderlab as an extension of C and it refuses to highlight it again.
     
    Last edited: Aug 14, 2013
  5. frogsbo

    frogsbo

    Joined:
    Jan 16, 2014
    Posts:
    79
    it stopped unity from sending .shader's to notepad for editing.

    here is a high contrast version, i find just making an extension of C called shader in style config more convenient.

    i wouldnt use this too much, the shaderlab is easy but the CG is what needs serious highlighting, so it's cool if you dont use hlsl and cg

    timesparralax cg hlsl page refers to a .vsix file for visualstudio presumably.
     

    Attached Files:

  6. antx

    antx

    Joined:
    Feb 16, 2012
    Posts:
    28
    My Notepad++ does not have "User-defined dialogue" in its View menu. So how do I use this style?
     
  7. Jiraiyah

    Jiraiyah

    Joined:
    Mar 4, 2013
    Posts:
    175
    It's under Language menu, you need to choose Define your language, then save the file with .shader extension and reopen it, it will work
     
  8. Sylafrs

    Sylafrs

    Joined:
    Jun 25, 2013
    Posts:
    65
    Reahreic likes this.
  9. Johannski

    Johannski

    Joined:
    Jan 25, 2014
    Posts:
    826
    infuzo, canis, bricevdm and 2 others like this.
  10. DonCornholio

    DonCornholio

    Joined:
    Feb 27, 2017
    Posts:
    92
  11. Johannski

    Johannski

    Joined:
    Jan 25, 2014
    Posts:
    826
    Thanks! I'm glad it's useful to you :)