! Preferences file for NEdit ! (User settings in X "application defaults" format) ! ! 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.6 nedit.shellCommands: \ jikes compile:Alt+A:m:DS:\n\ jikes %\n\ java run:Alt+R:m:DS:\n\ Eterm -e /usr/scripts/nedit-java %\n\ java compile/run:Alt+B:m:DS:\n\ jikes % && Eterm -e /usr/scripts/nedit-java %\n\ spell::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:Alt+S: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\ # This macro attempts to complete the current word by\n\ # finding another word in the same document that has\n\ # the same prefix; repeated invocations of the macro\n\ # (by repeated typing of its accelerator, say) cycles\n\ # through the alternatives found.\n\ # \n\ # Make sure $compWord contains something (a dummy index)\n\ $compWord[""] = ""\n\ \n\ # Test whether the rest of $compWord has been initialized:\n\ # this avoids having to initialize the global variable\n\ # $compWord in an external macro file\n\ if (!("wordEnd" in $compWord)) {\n\ # we need to initialize it\n\ $compWord["wordEnd"] = 0\n\ $compWord["repeat"] = 0\n\ $compWord["init"] = 0\n\ $compWord["wordStart"] = 0\n\ }\n\ \n\ if ($compWord["wordEnd"] == $cursor) {\n\ $compWord["repeat"] += 1\n\ }\n\ else {\n\ $compWord["repeat"] = 1\n\ $compWord["init"] = $cursor\n\ \n\ # search back to a word boundary to find the word to complete\n\ # (we use \\w here to allow for programming "words" that can include\n\ # digits and underscores; use \\l for letters only)\n\ $compWord["wordStart"] = search("<\\\\w+", $cursor, "backward", "regex", "wrap")\n\ \n\ if ($compWord["wordStart"] == -1)\n\ return\n\ \n\ if ($search_end == $cursor)\n\ $compWord["word"] = get_range($compWord["wordStart"], $cursor)\n\ else\n\ return\n\ }\n\ s = $cursor\n\ for (i=0; i <= $compWord["repeat"]; i++)\n\ s = search($compWord["word"], s - 1, "backward", "regex", "wrap")\n\ \n\ if (s == $compWord["wordStart"]) {\n\ beep()\n\ $compWord["repeat"] = 0\n\ s = $compWord["wordStart"]\n\ se = $compWord["init"]\n\ }\n\ else\n\ se = search(">", s, "regex")\n\ \n\ replace_range($compWord["wordStart"], $cursor, get_range(s, se))\n\ \n\ $compWord["wordEnd"] = $cursor\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)\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=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=$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\ 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\ Make C Prototypes@C@C++:::: {\n\ # simplistic extraction of C function prototypes, usually good enough\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\ # remove all C++ and C comments, then all blank lines in the extracted range\n\ string = replace_in_string(string, "//.*$", "", "regex", "copy")\n\ string = replace_in_string(string, "(?n/\\\\*.*?\\\\*/)", "", "regex", "copy")\n\ string = replace_in_string(string, "^\\\\s*\\n", "", "regex", "copy")\n\ nDefs = 0\n\ searchPos = 0\n\ prototypes = ""\n\ staticPrototypes = ""\n\ for (;;) {\n\ headerStart = search_string(string, \\\n\ "^[a-zA-Z]([^;#\\"'{}=>"::Identifier::\n\ html spec chars:"\\&[-.a-zA-Z0-9#]*;?":::String1::\n\ html comment:"\\