Visual SlickEdit: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
 
(One intermediate revision by the same user not shown)
Line 152: Line 152:
</pre>
</pre>


[[Category:Syntax Files For Text Editors]]
[[Category:Syntax_Highlighting]]

Latest revision as of 16:44, 16 March 2014

Author: phord (talk, contrib)


Description

This is a NSIS syntax file for SlickEdit

Adding the feature

Add NSIS syntax support to SlickEdit by editing the following files. Because these are SlickEdit configuration files, they are liable to be overwritten when you exit SlickEdit. Therefore, you should probably use a different editor to modify them.

All these files are in "...\My Documents\My SlickEdit Config\<version>\"

user.vlx

Add this to the end of user.vlx:

[NSIS Nullsoft Install Script]
idchars=$a-zA-Z 0-9_
case-sensitive=y
styles=xhex zerooct dqbackslash dqbackslashml sqbackslash sqbackslashml
keywords= Function FunctionEnd PageEx PageExEnd Section SectionEnd SubSection
keywords= SubSectionEnd
ppkeywords= !addincludedir !addplugindir !cd !define !echo !else !endif
ppkeywords= !error !execute !ifdef !ifmacrodef !ifmacrondef !ifndef !include
ppkeywords= !insertmacro !macro !macroend !packhdr !system !undef !verbose
ppkeywords= !warning
libkeywords= Abort AddBrandingImage AddSize AllowRootDirInstall AllowSkipFiles
libkeywords= AutoCloseWindow BGFont BGGradient BrandingText BringToFront
libkeywords= Call CallInstDLL Caption ChangeUI CheckBitmap ClearErrors CompletedText
libkeywords= ComponentText CopyFiles CRCCheck CreateDirectory CreateFont
libkeywords= CreateShortCut Delete DeleteINISec DeleteINIStr DeleteRegKey
libkeywords= DeleteRegValue DetailPrint DetailsButtonText DirText DirVar
libkeywords= DirVerify EnableWindow EnumRegKey EnumRegValue Exch Exec ExecShell
libkeywords= ExecWait ExpandEnvStrings File FileBufSize FileClose FileErrorText
libkeywords= FileOpen FileRead FileReadByte FileSeek FileWrite FileWriteByte
libkeywords= FindClose FindFirst FindNext FindWindow FlushINI GetCurInstType
libkeywords= GetCurrentAddress GetDlgItem GetDLLVersion GetDLLVersionLocal
libkeywords= GetErrorLevel GetFileTime GetFileTimeLocal GetFullPathName
libkeywords= GetFunctionAddress GetInstDirError GetLabelAddress GetTempFileName
libkeywords= Goto HideWindow Icon IfAbort IfErrors IfFileExists IfRebootFlag
libkeywords= IfSilent InitPluginsDir InstallButtonText InstallColors InstallDir
libkeywords= InstallDirRegKey InstProgressFlags InstType InstTypeGetText
libkeywords= InstTypeSetText IntCmp IntCmpU IntFmt IntOp IsWindow LangString
libkeywords= LicenseBkColor LicenseData LicenseForceSelection LicenseLangString
libkeywords= LicenseText LoadLanguageFile LogSet LogText MessageBox MiscButtonText
libkeywords= Name OutFile Page PageCallbacks Pop Push Quit ReadEnvStr ReadINIStr
libkeywords= ReadRegDWORD ReadRegStr Reboot RegDLL Rename ReserveFile Return
libkeywords= RMDir SearchPath SectionGetFlags SectionGetInstTypes SectionGetSize
libkeywords= SectionGetText SectionIn SectionSetFlags SectionSetInstTypes
libkeywords= SectionSetSize SectionSetText SendMessage SetAutoClose SetBrandingImage
libkeywords= SetCompress SetCompressor SetCompressorDictSize SetCtlColors
libkeywords= SetCurInstType SetDateSave SetDetailsPrint SetDetailsView SetErrorLevel
libkeywords= SetErrors SetFileAttributes SetFont SetOutPath SetOverwrite
libkeywords= SetPluginUnload SetRebootFlag SetShellVarContext SetSilent
libkeywords= ShowInstDetails ShowUninstDetails ShowWindow SilentInstall
libkeywords= Sleep SpaceTexts StrCmp StrCpy StrLen SubCaption UninstallButtonText
libkeywords= UninstallCaption UninstallIcon UninstallSubCaption UninstallText
libkeywords= UninstPage UnRegDLL Var VIAddVersionKey VIProductVersion WindowIcon
libkeywords= WriteINIStr WriteRegBin WriteRegDWORD WriteRegExpandStr WriteRegStr
libkeywords= WriteUninstaller XPStyle
userkeywords= HKCC HKCR HKCU HKDD HKLM HKPD HKU MB_ABORTRETRYIGNORE MB_ICONEXCLAMATION
userkeywords= MB_ICONINFORMATION MB_ICONQUESTION MB_ICONSTOP MB_OK MB_OKCANCEL
userkeywords= MB_RETRYCANCEL MB_RIGHT MB_SETFOREGROUND MB_TOPMOST MB_USERICON
userkeywords= MB_YESNO MB_YESNOCANCEL SHCTX
linecomment=#
linecomment=;

Note that if you are using SlickEdit version 7 or earlier, you will need to create this file if it does not already exist and replace 'libkeywords' and 'userkeywords' with just 'keywords'.

vusrdefs.e

Add this to the middle of vusrdefs.e (at the end of the existing "replace_def_data" section):


  replace_def_data("def-setup-nsi",'MN=NSIS Nullsoft Install Script,':+
         'TABS=+4,MA=1 74 1,KEYTAB=ext-keys,WW=1,IWT=0,ST=0,IN=2,':+
         'WC=A-Za-z0-9_$,LN=NSIS Nullsoft Install Script,CF=3,LNL=6,':+
         'TL=0,BNDS=,CAPS=0,SW=0,SOW=0,');
  replace_def_data("def-options-nsi",'4 1 1 0 0 3 0');
  replace_def_data("def-surround-nsi",'65535');
  replace_def_data("def-codehelp-nsi",'4218732');
  replace_def_data("def-alias-nsi",'nsi.als');
  replace_def_data("def-setup-nsh",'@nsi');
  replace_def_data("def-options-nsh",'4 1 1 0 0 3 0');

project.vpe

Optional for project support. Create or edit this file to add the NSIS section.

You may also need to change the path to MakeNSIS.exe.

<!DOCTYPE Project SYSTEM "http://www.slickedit.com/dtd/vse/10.0/vpe.dtd">
<Project
	Version="10.0"
	VendorName="SlickEdit">
	<Config Name=".nsi">
		<Menu>
			<Target
				Name="Compile"
				MenuCaption="&Compile"
				CaptureOutputWith="ProcessBuffer"
				SaveOption="SaveCurrent"
				RunFromDir="%rw">
				<Exec CmdLine='"C:\Program Files\NSIS\makensis.exe" %w'/>
			</Target>
			<Target
				Name="Build"
				MenuCaption="&Build"
				CaptureOutputWith="ProcessBuffer"
				SaveOption="SaveWorkspaceFiles"
				RunFromDir="%rw">
				<Exec CmdLine='"C:\Program Files\NSIS\makensis.exe" %rp\%rn.nsi'/>
			</Target>
			<Target
				Name="Rebuild"
				MenuCaption="&Rebuild"
				CaptureOutputWith="ProcessBuffer"
				SaveOption="SaveWorkspaceFiles"
				RunFromDir="%rw">
				<Exec/>
			</Target>
			<Target
				Name="Debug"
				MenuCaption="&Debug"
				SaveOption="SaveNone"
				RunFromDir="%rw">
				<Exec/>
			</Target>
			<Target
				Name="Execute"
				MenuCaption="E&xecute"
				SaveOption="SaveNone"
				RunFromDir="%rw">
				<Exec CmdLine='"%<e.exe"'/>
			</Target>
		</Menu>
	</Config>
</Project>

ubox.ini

(Optional) Add this to the end of ubox.ini:

[nsi]
boxchars=tlc=# trc=\e blc=# brc=\e bhside=# thside=# lvside=# rvside=\e
firstline_is_top=0
lastline_is_bottom=0
nonboxchars=left=; right=\e
line_comment_mode=0