V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
wbsdty331
V2EX  ›  程序员

目前来看,除了 Notepad++,其他编辑器基本没法对 NSIS 脚本进行语法高亮

  •  
  •   wbsdty331 · Mar 13, 2016 · 2048 views
    This topic created in 3696 days ago, the information mentioned may be changed or developed.

    正常的高亮应该是这样的:

    !insertmacro MUI_PAGE_WELCOME
     ;许可协议页面
    !insertmacro MUI_PAGE_LICENSE "License.rtf"
    ; 安装目录选择页面
    !define MUI_PAGE_CUSTOMFUNCTION_SHOW fnc_Sourcesdk_Show
    ; 显示自定义页面
    !insertmacro MUI_PAGE_DIRECTORY
    ; 安装过程页面
    !define MUI_PAGE_CUSTOMFUNCTION_SHOW hidebutton
    !insertmacro MUI_PAGE_INSTFILES
    ; 安装完成页面
    !insertmacro MUI_PAGE_FINISH
    ; 安装界面包含的语言设置
    !insertmacro MUI_LANGUAGE "English"
    ; 安装预释放
    ReserveFile '${NSISDIR}\Plugins\InstallOptions.dll'
    ReserveFile '${NSISDIR}\Plugins\BASSMOD.dll'
    ; ------ MUI 现代界面定义结束 ------
    
    ; 安装程序相关的设置
    var ssdir
    Caption "Combine Prelude"
    AllowRootDirInstall false
    ReserveFile "${NSISDIR}\Plugins\system.dll"
    ReserveFile "${NSISDIR}\Plugins\ButtonLinker.dll"
    Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
    OutFile "CPSetup.exe"
    InstallDirRegKey HKCU "SOFTWARE\Valve\Steam" "SourceModInstallPath"
    ShowInstDetails hide
    BrandingText "wbsdty331 / CPMod Team"
    ;设置使用管理员权限运行
    RequestExecutionLevel admin
    

    测试报告


    • Notepad++一切正常,载入 NSI 文件自动识别语法并高亮
    • EmEditor语法里面没有 NSIS 的选项
    • Sublime Text 2插件可以支持
    • Sublime Text 3里面无法高亮,选择的语言也没有 NSIS
    • Visual Studio Code同上,已经提交过ISSUE,官方回复:

    We currently don't plan add to NSIS highlighting to VSCode, but this could be easily added as an extension, e.g. using this text mate grammar: https://github.com/SublimeText/NSIS/blob/master/NSIS.tmLanguage
    Check out https://code.visualstudio.com/docs/tools/yocode about how to create an extension.

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5238 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 51ms · UTC 01:16 · PVG 09:16 · LAX 18:16 · JFK 21:16
    ♥ Do have faith in what you're doing.