! Preferences file for NEdit
!
! This file is overwritten by the "Save Defaults..." command in NEdit 
! and serves only the interactively settable options presented in the NEdit
! "Preferences" menu.  To modify other options, such as key bindings, use 
! the .Xdefaults file in your home directory (or the X resource 
! specification method appropriate to your system).  The contents of this 
! file can be moved into an X resource file, but since resources in this file
! override their corresponding X resources, either this file should be 
! deleted or individual resource lines in the file should be deleted for the
! moved lines to take effect.

nedit.fileVersion: 5.5
nedit.shellCommands: \
	spell:Alt+B:s:EX:\n\
		cat>spellTmp; xterm -e ispell -x spellTmp; cat spellTmp; rm spellTmp\n\
	wc::w:ED:\n\
		wc | awk '{print $1 " lines, " $2 " words, " $3 " characters"}'\n\
	sort::o:EX:\n\
		sort\n\
	number lines::n:AW:\n\
		nl -ba\n\
	make:Alt+Z:m:W:\n\
		make\n\
	expand::p:EX:\n\
		expand\n\
	unexpand::u:EX:\n\
		unexpand\n
nedit.macroCommands: \
	Complete Word:Alt+D::: {\n\
		# Tuning parameters\n\
		ScanDistance = 200\n\
		\n\
		# Search back to a word boundary to find the word to complete\n\
		startScan = max(0, $cursor - ScanDistance)\n\
		endScan = min($text_length, $cursor + ScanDistance)\n\
		scanString = get_range(startScan, endScan)\n\
		keyEnd = $cursor-startScan\n\
		keyStart = search_string(scanString, "<", keyEnd, "backward", "regex")\n\
		if (keyStart == -1)\n\
		    return\n\
		keyString = "<" substring(scanString, keyStart, keyEnd)\n\
		\n\
		# search both forward and backward from the cursor position.  Note that\n\
		# using a regex search can lead to incorrect results if any of the special\n\
		# regex characters is encountered, which is not considered a delimiter\n\
		backwardSearchResult = search_string(scanString, keyString, keyStart-1, \\\n\
		    	"backward", "regex")\n\
		forwardSearchResult = search_string(scanString, keyString, keyEnd, "regex")\n\
		if (backwardSearchResult == -1 && forwardSearchResult == -1) {\n\
		    beep()\n\
		    return\n\
		}\n\
		\n\
		# if only one direction matched, use that, otherwise use the nearest\n\
		if (backwardSearchResult == -1)\n\
		    matchStart = forwardSearchResult\n\
		else if (forwardSearchResult == -1)\n\
		    matchStart = backwardSearchResult\n\
		else {\n\
		    if (keyStart - backwardSearchResult <= forwardSearchResult - keyEnd)\n\
		    	matchStart = backwardSearchResult\n\
		    else\n\
		    	matchStart = forwardSearchResult\n\
		}\n\
		\n\
		# find the complete word\n\
		matchEnd = search_string(scanString, ">", matchStart, "regex")\n\
		completedWord = substring(scanString, matchStart, matchEnd)\n\
		\n\
		# replace it in the window\n\
		replace_range(startScan + keyStart, $cursor, completedWord)\n\
	}\n\
	Fill Sel. w/Char:::R: {\n\
		if ($selection_start == -1) {\n\
		    beep()\n\
		    return\n\
		}\n\
		\n\
		# Ask the user what character to fill with\n\
		fillChar = string_dialog("Fill selection with what character?", "OK", "Cancel")\n\
		if ($string_dialog_button == 2 || $string_dialog_button == 0)\n\
		    return\n\
		\n\
		# Count the number of lines in the selection\n\
		nLines = 0\n\
		for (i=$selection_start; i<$selection_end; i++)\n\
		    if (get_character(i) == "\\n")\n\
		    	nLines++\n\
		\n\
		# Create the fill text\n\
		rectangular = $selection_left != -1\n\
		line = ""\n\
		fillText = ""\n\
		if (rectangular) {\n\
		    for (i=0; i<$selection_right-$selection_left; i++)\n\
			line = line fillChar\n\
		    for (i=0; i<nLines; i++)\n\
			fillText = fillText line "\\n"\n\
		    fillText = fillText line\n\
		} else {\n\
		    if (nLines == 0) {\n\
		    	for (i=$selection_start; i<$selection_end; i++)\n\
		    	    fillText = fillText fillChar\n\
		    } else {\n\
		    	startIndent = 0\n\
		    	for (i=$selection_start-1; i>=0 && get_character(i)!="\\n"; i--)\n\
		    	    startIndent++\n\
		    	for (i=0; i<$wrap_margin-startIndent; i++)\n\
		    	    fillText = fillText fillChar\n\
		    	fillText = fillText "\\n"\n\
			for (i=0; i<$wrap_margin; i++)\n\
			    line = line fillChar\n\
			for (i=0; i<nLines-1; i++)\n\
			    fillText = fillText line "\\n"\n\
			for (i=$selection_end-1; i>=$selection_start && get_character(i)!="\\n"; \\\n\
			    	i--)\n\
			    fillText = fillText fillChar\n\
		    }\n\
		}\n\
		\n\
		# Replace the selection with the fill text\n\
		replace_selection(fillText)\n\
	}\n\
	Quote Mail Reply:::: {\n\
		if ($selection_start == -1)\n\
		    replace_all("^.*$", "\\\\> &", "regex")\n\
		else\n\
		    replace_in_selection("^.*$", "\\\\> &", "regex")\n\
	}\n\
	Unquote Mail Reply:::: {\n\
		if ($selection_start == -1)\n\
		    replace_all("(^\\\\> )(.*)$", "\\\\2", "regex")\n\
		else\n\
		    replace_in_selection("(^\\\\> )(.*)$", "\\\\2", "regex")\n\
	}\n\
	C Comments>Comment Out Sel.@C@C++:::R: {\n\
		selStart = $selection_start\n\
		selEnd = $selection_end\n\
		replace_range(selStart, selEnd, "/* " get_selection() " */")\n\
		select(selStart, selEnd + 6)\n\
	}\n\
	C Comments>C Uncomment Sel.@C@C++:::R: {\n\
		sel = get_selection()\n\
		selStart = $selection_start\n\
		selEnd = $selection_end\n\
		commentStart = search_string(sel, "/*", 0)\n\
		if (substring(sel, commentStart+2, commentStart+3) == " ")\n\
		    keepStart = commentStart + 3\n\
		else\n\
		    keepStart = commentStart + 2\n\
		keepEnd = search_string(sel, "*/", length(sel), "backward")\n\
		commentEnd = keepEnd + 2\n\
		if (substring(sel, keepEnd - 1, keepEnd) == " ")\n\
		    keepEnd = keepEnd - 1\n\
		replace_range(selStart + commentStart, selStart + commentEnd, \\\n\
			substring(sel, keepStart, keepEnd))\n\
		select(selStart, selEnd - (keepStart-commentStart) - \\\n\
			(commentEnd - keepEnd))\n\
	}\n\
	C Comments>+ C++ Comment@C++:::R: {\n\
		replace_in_selection("^.*$", "// &", "regex")\n\
	}\n\
	XMidas>+ Comment@Midas Macros:::R: {\n\
		replace_in_selection("^.*$", "!! &", "regex")\n\
	}\n\
	XMidas>+ Comment(!?)@Midas Macros:::R: {\n\
		replace_in_selection("^.*$", "!\\? &", "regex")\n\
	}\n\
	C Comments>- C++ Comment@C++:::R: {\n\
		replace_in_selection("(^[ \\\\t]*// ?)(.*)$", "\\\\2", "regex")\n\
	}\n\
	C Comments>+ C Bar Comment 1@C:::R: {\n\
		if ($selection_left != -1) {\n\
		    dialog("Selection must not be rectangular")\n\
		    return\n\
		}\n\
		start = $selection_start\n\
		end = $selection_end-1\n\
		origText = get_range($selection_start, $selection_end-1)\n\
		newText = "/*\\n" replace_in_string(get_range(start, end), \\\n\
			"^", " * ", "regex") "\\n */\\n"\n\
		replace_selection(newText)\n\
		select(start, start + length(newText))\n\
	}\n\
	C Comments>- C Bar Comment 1@C:::R: {\n\
		selStart = $selection_start\n\
		selEnd = $selection_end\n\
		newText = get_range(selStart+3, selEnd-4)\n\
		newText = replace_in_string(newText, "^ \\\\* ", "", "regex")\n\
		replace_range(selStart, selEnd, newText)\n\
		select(selStart, selStart + length(newText))\n\
	}\n\
	XMidas>- Comment@Midas Macros:::R: {\n\
		replace_in_selection("(^[ \\\\t]*!! ?)(.*)$", "\\\\2", "regex")\n\
	}\n\
	XMidas>- Comment(!?)@Midas Macros:::R: {\n\
		replace_in_selection("(^[ \\\\t]*!\\\\? ?)(.*)$", "\\\\2", "regex")\n\
	}\n\
	Make C Prototypes@C@C++:::: {\n\
		if ($selection_start == -1) {\n\
		    start = 0\n\
		    end = $text_length\n\
		} else {\n\
		    start = $selection_start\n\
		    end = $selection_end\n\
		}\n\
		string = get_range(start, end)\n\
		nDefs = 0\n\
		searchPos = 0\n\
		prototypes = ""\n\
		staticPrototypes = ""\n\
		for (;;) {\n\
		    headerStart = search_string(string, \\\n\
			    "^[a-zA-Z]([^;#\\"'{}=><!/]|\\n)*\\\\)[ \\t]*\\n?[ \\t]*\\\\{", \\\n\
			    searchPos, "regex")\n\
		    if (headerStart == -1)\n\
			break\n\
		    headerEnd = search_string(string, ")", $search_end,"backward") + 1\n\
		    prototype = substring(string, headerStart, headerEnd) ";\\n"\n\
		    if (substring(string, headerStart, headerStart+6) == "static")\n\
			staticPrototypes = staticPrototypes prototype\n\
		    else\n\
		    			prototypes = prototypes prototype\n\
		    searchPos = headerEnd\n\
		    nDefs++\n\
		}\n\
		if (nDefs == 0) {\n\
		    dialog("No function declarations found")\n\
		    return\n\
		}\n\
		new()\n\
		focus_window("last")\n\
		replace_range(0, 0, prototypes staticPrototypes)\n\
	}\n
nedit.bgMenuCommands: \
	Undo:::: {\n\
		undo()\n\
	}\n\
	Redo:::: {\n\
		redo()\n\
	}\n\
	Cut:::R: {\n\
		cut_clipboard()\n\
	}\n\
	Copy:::R: {\n\
		copy_clipboard()\n\
	}\n\
	Paste:::: {\n\
		paste_clipboard()\n\
	}\n
nedit.highlightPatterns: C:Default\n\
	C++:Default\n\
	Java:Default\n\
	JavaScript:Default\n\
	Ada:Default\n\
	Fortran:Default\n\
	Pascal:Default\n\
	Lex:Default\n\
	Yacc:Default\n\
	Perl:Default\n\
	Python:Default\n\
	Awk:Default\n\
	Tcl:Default\n\
	Sh Ksh Bash:Default\n\
	Csh:Default\n\
	Makefile:Default\n\
	SGML HTML:Default\n\
	LaTeX:Default\n\
	PostScript:Default\n\
	SQL:Default\n\
	Matlab:Default\n\
	VHDL:Default\n\
	Verilog:Default\n\
	X Resources:Default\n\
	NEdit Macro:Default\n\
	Midas Macros:2:0{\n\
		Comment:"^[*!]":"$"::Comment::\n\
		keyword:"<([Aa][Nn][Dd]|aux+ *|status|STATUS|stat|STAT|[Bb][Ee][Ee][Pp]|CALL|[Cc][Aa][Ll][Ll][Pp ]|CLOSE|[Cc]lose|[Gg][Ee]|CONTINUE|xtc_files|XTC_FILES|[Cc]ontinue|DATA|eqs|EQS|[Dd]ata|DELETE|[Dd]elete|DO|[Dd]o|ELSE|[Ee]lse|ELSEIF|switch|SWITCH|[Ee]lseif|ENDDO|[Ee]nd[Dd]o|[Ee][Nn][Dd][Ll][Oo][Oo][Pp]|END ?FILE|[Ee]nd *[fF]ile|ENDIF|[Ee]nd[iI]f|ENDWHILE|[Ee]nd[wW]hile|END|[Ee]nd|[Ee][Qq]|eqs|EXIT|[Ee]xit|GO *TO|[Gg]o *[tT]o|[Gg][Tt]|IF|[Ii]f|[Ff][nN][aA][mM][eE]|[Ff][Ee][Xx][Ii][Ss][Tt][Ss]|[Kk][Ee][Yy]* *|message|MESSAGE|SUBS|KEYWORD* *|keyword* *|subs|[Nn]subs|NSUBS|STARTMACRO|ENDMACRO|STARTCONTROLS|ENDCONTROLS|[Nn][Ff][Ee][Xx][Ii][Ss][Tt][Ss]|calc* *|CALC* *|jump|JUMP|label|LABEL|[Rr][Ee][Ss][Uu][Ll][Tt]*|import|IMPORT|ENV|env|import|IMPORT|PARSE|parse|[Xx][Pp][Ii][Pp][Ee]|PROCEDURE|[Xx][Cc][Oo][Nn][Tt][Rr][Oo][Ll]* *|[Xx][Cc][Aa][Ll][Ll]|procedure|[Ll][Ee]|[Ll][Oo][Cc][Aa][Ll]|[Ll][Oo][Oo][Pp]|[Mm][Ee][Ss][Ss]* *|[Nn][Ee]|[Nn][Ee][Qq][Ss]|[Oo][Ff][Ff]|ON|[Oo]n|[Oo][Rr]|PAUSE|[Pp]ause|[Rr][Ee][Mm]* *|RETURN|[Rr]eturn|[Rr][Ee][Ss]* *|[Rr][Ss][Mm]|[Ss][Aa][Yy]|[Ss][Ee][Dd][Ii][Tt]|STOP|[Ss]top|SUBROUTINE|[Ss]ubroutine|THEN|[Tt]hen|TYPE|[Tt]ype|WHILE|[Ww]hile|WRITE|[Ww]rite)>":::Keyword::\n\
	}\n\
	NeXtMidas Macros:1:0{\n\
		Comment:"!":"$"::Comment::\n\
		NXM_CARET:"\\^([A-Za-z0-9_.])+(\\^\\{[A-Za-z0-9_.]+\\})*":::NXM_CARET::\n\
		NXM_CARET_CURLEY:"\\^\\{([A-Za-z0-9_.])+(\\^\\{[A-Za-z0-9_.]+\\})*\\}":::NXM_CARET_CURLEY::\n\
		NXM_STRING:"""":""""::String::\n\
		NXM_CARET_2:"\\^([A-Za-z0-9_.])+(\\^\\{[A-Za-z0-9_.]+\\})*":::NXM_CARET:NXM_STRING:\n\
		NXM_CARET_CURLEY_2:"\\^\\{([A-Za-z0-9_.])+(\\^\\{[A-Za-z0-9_.]+\\})*\\}":::NXM_CARET_CURLEY:NXM_STRING:\n\
		NXM_IF_TEST:"<(?ithen|n?gt|n?lt|n?ge|n?le|n?eq|ne|n?eqt|n?anybits|n?allbits|n?eqs|n?eqss|n?subs|n?fexists|n?dexists|n?rexists|n?pexists|n?isnull|n?istrue|n?isfalse|n?feq|n?oeq|n?seq|n?typeof|n?instanceof|n?contains|\\>|\\<|\\>=|\\<=|==|and|or|not)>":::NXM_IF_TEST::\n\
		if_then_else:"^[ ]*<(?iif|else|elseif|endif|while|endwhile|foreach|endfor|do|enddo)>":::if_then_else::\n\
		keywords:"^[ ]*<(?istartmacro|endmacro|procedure|subroutine|return|pipe)>":::Keyword::\n\
		Primitives:"^[ ]*[A-Za-z0-9_]+":::NXM_SYS_PRIMS::\n\
	}\n\
	CSS:Default\n\
	Regex:Default\n\
	XML:Default
nedit.languageModes: 	C:.c .h::::::".,/\\`'!|@#%^&*()-=+{}[]"":;<>?~":\n\
	C++:.cc .hh .C .H .i .cxx .hxx .cpp::::::".,/\\`'!|@#%^&*()-=+{}[]"":;<>?~":\n\
	Java:.java:::::::\n\
	JavaScript:.js:::::::\n\
	Ada:.ada .ad .ads .adb .a:::::::\n\
	Fortran:.f .f77 .for:::::::\n\
	Pascal:.pas .p .int:::::::\n\
	Lex:.lex:::::::\n\
	Yacc:.y::::::".,/\\`'!|@#%^&*()-=+{}[]"":;<>?~":\n\
	Perl:.pl .pm .p5 .PL:"^[ \\t]*#[ \\t]*!.*perl":Auto:None:::".,/\\\\`'!$@#%^&*()-=+{}[]"":;<>?~|":\n\
	Python:.py:"^#!.*python":Auto:None:::"!""#$%&'()*+,-./:;<=>?@[\\\\]^`{|}~":\n\
	Tcl:.tcl .tk .itcl .itk::Smart:None::::\n\
	Awk:.awk:::::::\n\
	Sh Ksh Bash:.sh .bash .ksh .profile .bashrc .bash_logout .bash_login .bash_profile:"^[ \\t]*#[ \\t]*![ \\t]*/.*bin/(sh|ksh|bash)"::::::\n\
	Csh:.csh .cshrc .login .logout:"^[ \\t]*#[ \\t]*![ \\t]*/bin/csh"::::::\n\
	Makefile:Makefile makefile .gmk:::None:8:8::\n\
	SGML HTML:.sgml .sgm .html .htm:"\\<[Hh][Tt][Mm][Ll]\\>"::::::\n\
	LaTeX:.tex .sty .cls .dtx .ins:::::::\n\
	PostScript:.ps .eps .epsf .epsi:"^%!":::::"/%(){}[]<>":\n\
	SQL:.sql:::::::\n\
	Matlab:.m .oct .sci:::::::\n\
	VHDL:.vhd .vhdl .vdl:::::::\n\
	Verilog:.v:::::::\n\
	X Resources:.Xresources .Xdefaults .nedit nedit.rc:"^[!#].*([Aa]pp|[Xx]).*[Dd]efaults"::::::\n\
	NEdit Macro:.nm .neditmacro:::::::\n\
	Midas Macros:.txt .SCRYPT .key:::::::\n\
	NeXtMidas Macros:.mm:::::::\n\
	CSS:css::Auto:None:::".,/\\`'!|@#%^&*()=+{}[]"":;<>?~":\n\
	Regex:.reg .regex:"\\(\\?[:#=!iInN].+\\)":None:Continuous::::\n\
	XML:.xml .xsl .dtd:"\\<(?i\\?xml|!doctype)"::None:::"<>/=""'()+*?|":
nedit.styles: 	Plain:Gray65:Plain\n\
	Comment:#cc3300:Plain\n\
	Keyword:LightSkyBlue:Plain\n\
	Storage Type:LawnGreen:Plain\n\
	String:Orange:Plain\n\
	String1:DarkOrange:Plain\n\
	String2:OrangeRed:Plain\n\
	Preprocessor:Coral:Plain\n\
	Preprocessor1:LightCoral:Plain\n\
	Character Const:LightSteelBlue:Plain\n\
	Numeric Const:LightBlue:Plain\n\
	Identifier:Green:Plain\n\
	Identifier1:SpringGreen:Plain\n\
	Identifier2:SteelBlue:Plain\n\
	Subroutine:Turquoise:Plain\n\
	Subroutine1:Cyan:Plain\n\
	Ada Attributes:White:Plain\n\
	Label:red:Italic\n\
	Flag:LimeGreen:Plain\n\
	Text Comment:darkGrey:Plain\n\
	Text Key:Khaki:Plain\n\
	Text Key1:PaleGoldenRod:Plain\n\
	Text Arg:beige:Plain\n\
	Text Arg1:wheat:Plain\n\
	Text Arg2:tan:Plain\n\
	Text Escape:chocolate:Plain\n\
	LaTeX Math:DarkGreen:Plain\n\
	if_then_else:coral:Plain\n\
	NXM_IF_TEST:PaleGreen:Italic\n\
	NXM_CARET_CURLEY:red:Plain\n\
	NXM_CARET:red:Plain\n\
	NXM_SYS_PRIMS:white:Plain\n\
	Pointer:#660000:Bold\n\
	Regex:#009944:Bold\n\
	Warning:brown2:Italic
nedit.smartIndentInit: 	C:Default\n\
	C++:Default\n\
	Python:Default\n\
	Matlab:Default\n\
	JavaScript:	--End-of-Macro--\n\
	return cFindSmartIndentDist($1)\n\
	--End-of-Macro--\n\
	--End-of-Macro--
nedit.smartIndentInitCommon: Default
nedit.autoWrap: None
nedit.wrapMargin: 0
nedit.autoIndent: Auto
nedit.autoSave: True
nedit.openInTab: True
nedit.saveOldVersion: False
nedit.showMatching: Delimiter
nedit.matchSyntaxBased: True
nedit.highlightSyntax: True
nedit.backlightChars: False
nedit.searchDialogs: False
nedit.beepOnSearchWrap: False
nedit.retainSearchDialogs: False
nedit.searchWraps: True
nedit.stickyCaseSenseButton: True
nedit.repositionDialogs: True
nedit.autoScroll: False
nedit.appendLF: True
nedit.sortOpenPrevMenu: True
nedit.statisticsLine: True
nedit.iSearchLine: False
nedit.sortTabs: False
nedit.tabBar: True
nedit.tabBarHideOne: True
nedit.toolTips: True
nedit.globalTabNavigate: False
nedit.lineNumbers: False
nedit.pathInWindowsMenu: True
nedit.warnFileMods: True
nedit.warnRealFileMods: True
nedit.warnExit: True
nedit.searchMethod: Literal
nedit.textRows: 24
nedit.textCols: 80
nedit.tabDistance: 8
nedit.emulateTabs: 2
nedit.insertTabs: False
nedit.textFont: -adobe-courier-medium-r-normal--14-*-*-*-*-*-*
nedit.boldHighlightFont: -adobe-courier-bold-r-normal--14-*-*-*-*-*-*
nedit.italicHighlightFont: -adobe-courier-medium-o-normal--14-*-*-*-*-*-*
nedit.boldItalicHighlightFont: -adobe-courier-bold-o-normal--14-*-*-*-*-*-*
nedit.textFgColor: #ffffff
nedit.textBgColor: #000000
nedit.selectFgColor: #ffffff
nedit.selectBgColor: #4c59a6
nedit.hiliteFgColor: white
nedit.hiliteBgColor: red
nedit.lineNoFgColor: white
nedit.cursorFgColor: white
nedit.smartTags: True
nedit.prefFileRead: True
nedit.titleFormat: {%c} [%s] %f (%S) - %d
