📄 faq.xml
字号:
cursor is already there.</p></a></qna><qna id="N474"><q>I'd like to see more than 8 files in the file selection dialogs (Open,Save As, etc.)</q><long-q><p>I'd like to see more than 8 files in the file selection dialogs (Open,Save As, Include, etc.). I've tried to set the X-resources likenedit*XmList.visibleItemCount: 20, but this did not work.</p></long-q><a><p>The only effective way I've found to control the number of items inthe highly temperamental Motif FileSelectionBox widget is through theheight resource:</p><blockquote><p><tt>nedit*FileSelect.height: 900</tt></p></blockquote><p>The X resource line above will make the file selection box 900 pixelstall.</p></a></qna><qna id="N496"><q>I am trying to do key bindings such that, for example, Find is Alt+F ratherthan Ctrl+F, but this clashes with the find menu mnemonic</q><long-q><p>I am trying to do key bindings such that, for example, Find is Alt+F ratherthan Ctrl+F. However, this clashes with the find menu mnemonic. I realizethat the menu mnemonics can be changed to any letter, but they are alwaysbound to Alt-letter. I would like to just remove all menu mneumonics. Isthere any way to do this in an .Xdefaults file?</p></long-q><a><p>You can turn mnemonics off by setting them to the ascii null character, forexample:</p><blockquote> <p><tt>nedit*fileMenu.mnemonic: \0</tt></p></blockquote></a></qna><qna id="N515"><q>I have a PC-style 2-button mouse and I would like to switch the 2nd and 3rd(emulated) mouse buttons</q><long-q><p>I have a PC-style 2-button mouse. Can I switch the 2nd and 3rd mousebuttons so the more important functions like secondary selection are onthe right button instead of the middle (which is emulated by pressing 1+3buttons simultaneously under Linux), like they were in version 4?</p></long-q><a><p>It's somewhat involved and hard to figure out from the documentation, butyes you can. You have to reverse the translation table bindings for mousebuttons 2 and 3, AND reset the bgMenuButton resource. The translation tablebindings can either be found in the source file source/text.c, or by addingand activating a temporary translation to the text widget for dumping thetranslation table itself (XtDisplayTranslations()).</p><p>What it boils down to, though, is just add the following lines to your Xresource file (.Xdefaults or .Xresources depending on your system):</p><pre> NEdit*text.Translations: #override \n\ <Btn3Down>: secondary_or_drag_start()\n\ Shift Ctrl Button3<MotionNotify>: \ secondary_or_drag_adjust("rect", "copy", "overlay")\n\ Shift Button3<MotionNotify>: secondary_or_drag_adjust("copy")\n\ Ctrl Button3<MotionNotify>: secondary_or_drag_adjust("rect", "overlay")\n\ Button3<MotionNotify>: secondary_or_drag_adjust()\n\ Shift Ctrl<Btn3Up>: move_to_or_end_drag("copy", "overlay")\n\ Shift <Btn3Up>: move_to_or_end_drag("copy")\n\ Alt<Btn3Up>: exchange()\n\ Meta<Btn3Up>: exchange()\n\ Ctrl<Btn3Up>: copy_to_or_end_drag("overlay")\n\ <Btn3Up>: copy_to_or_end_drag()\n\ Ctrl~Meta~Alt<Btn2Down>: mouse_pan()\n\ Ctrl~Meta~Alt Button2<MotionNotify>: mouse_pan()\n\ <Btn2Up>: end_drag() nedit.bgMenuButton: ~Shift~Ctrl~Meta~Alt<Btn2Down></pre></a></qna><qna id="N537"><q>How can I make a shell command prompt me for input?</q><long-q><p>I'd like to send mail directly from my nedit window, but there's no goodway to make a shell command prompt me for input (for entering the recipientand subject).</p></long-q><a><p>Use a macro command instead to do the prompting:</p><pre> to = string_dialog("Send mail to: (enter name below, along with any\n" \ "additional Unix Mail command parameters, -s for subject)", \ "Send", "Cancel") if ($string_dialog_button == 2 || $string_dialog_button == 0) return if ($selection_start == -1) body = get_range(0, $text_length) else body = get_selection() cmdOutput = shell_command("Mail " to, body) if ($shell_cmd_status != 0) dialog("mail command returned failed exit status\n" cmdOutput) else if (cmdOutput != "") dialog(cmdOutput)</pre></a></qna><qna id="N556"><q>How I can set the foreground color for selectedtext when syntax highlighting is applied?</q><long-q><p>How I can set the foreground color for selectedtext to be always say grey1 even when syntax highlighting is applied?</p></long-q><a><p>There's no equivalent to the<tt>nedit*text.selectForeground</tt> resource when you turn onsyntax highlighting. You just have to choose a selection color thatis compatible with all of your highlighting colors.</p></a></qna></section><section id="sect_features"><title>Features</title><qna id="N578"><q>Why NEdit does not support drag and drop?</q><long-q><p>I'm a little confused about what happend to drag and drop.I thought drag-N-drop was supported by the Motif library.</p></long-q><a><p>NEdit no longer uses the Motif text widget, so all of the functionalityhad to be duplicated in the new widget. Drag and drop between windows gotleft off due to time pressure of getting out the new release, but it willbe back some day.</p></a></qna><qna id="N593"><q>Why don't you integrate Max Vohlken's / Yunliang Yu's versions into theofficial release of NEdit</q><a><p>Many of their changes will eventually find their way in to the "official"version, but some will not. Max has really done quite a lot of stuff.I appreciate it, and I think it's kind of neat to have a "bleeding edge"version of NEdit around to try out new features. </p><p>I can't just apply Max's patches to our version and release it. Some ofthem break the VMS version, some interfere with existing commands thatare important to other users, and some are just customizations that Idon't particularly agree with. Mostly, I want to do a lot of testing tomake sure the changes are safe on all platforms, and I just don't havetime right now. (Mark Edel)</p><p><strong>Update as of NEdit version 5.2RC1:</strong> The forthcomingNEdit version 5.2 contains several functionalities of Max's patches.</p></a></qna><qna id="N611"><q>Is it possible to use NEdit on windows 95 or NT?</q><long-q><p>I really like nedit and it would be nice to use on windows 95 or NTinstead of word or notepad. Is this possible?</p></long-q><a><p>There is an NT version of NEdit, available at<site>http://nedit.org/download/win32.shtml</site>. A mini-FAQ is alsoavailable.</p></a></qna><qna id="N644"><q>Why aren't there pre-entered default values in text fields of dialogs?</q><long-q><p>A feature which is found in in some Macintosh and PC programs, which Ilike, is to provide pre-entered default values in text fields. For example,the find and replace dialogs could show the last search/replace string, orthe currently selected text. These programs select the text, so simplytyping in the field automatically replaces the default without any extrawork from the user.</p></long-q><a><p>X has a strict convention that there can be only one selection ata time on the whole display. This means that some of the tricks usedin PC and Macintosh programs don't work in X. On PCs and Macs,programs can fill in default values in text fields, and select thetext that they have inserted such that If the user types over theselection, it will automatically be erased. Under X, there is aprice to pay for making an automatic selection. The selection mustbe "stolen" from some other window, maybe some other program. If theuser's intent was to paste a selection that existed before the dialogpopped up, once the automatic selection is made, they are out ofluck.</p><p>If NEdit automatically transferred the selection to the Find or Replacedialog, it would either have to steal the selection, or users wouldhave to click or drag the mouse over the text to delete it before theycould type anything different. Instead, NEdit has a "Find Selection"command, as well as various methods of pasting and copying theselection into dialog fields. It also allows you to recall of previoussearch strings in the Find and Replace dialogs via the up-arrow anddown-arrow keys.</p></a></qna><qna id="N662"><q>I would like to use (multiple fonts, special symbols) in my file, butNEdit seems to allow just one single font.</q><a><p>NEdit is a plain text editor, not a word processor. Plain text files haveno font or formatting information contained in them, they are just a stringof ascii characters. While you might find a font with limited symbols andgreek letters, your troubles would just be beginning. You'd still havetrouble getting the printer to agree and print out the characters as theyappeared in NEdit. For anything involving font changes or special symbols,you need a word processor, such as Microsoft Word, or a textformatting program like LaTEX.</p></a></qna><qna id="N677"><q>Auto-wrap doesn't work well</q><long-q><p>Auto-wrap doesn't work very well. When I type in the middle of a line, Ican push the end of the line beyond the right margin, and when I delete,It doesn't keep the right edge of the text lined up.</p></long-q><a><p>You probably want continuous wrap mode (Preferences -> Wrap-> Continuous).</p><p>Because NEdit is not a word processor, it is stuck with the limitsof the plain text format. In the default, auto-newline, wrappingmode, nedit does wrapping by inserting newline characters. Becausethere is only one newline character, NEdit can't distinguish anewline which can be "unwrapped" from one which the user intended tobe permanent. While it might be possible for NEdit to temporarilymake that distinction, for example while the cursor is on aparticular line that the user is typing, ultimately, NEdit will haveto forget this information, because there is no way to save it in thefile. Users who work in auto-newline wrap mode tend to make liberaluse of the Fill paragraph command.</p><p>In continuous wrapping mode, you can intentionally leave out thenewlines within paragraphs, and lines will be wrapped as needed tofit within the page. When you edit in the middle of a paragraph, thetext will be continuously adjusted. However, continuous wrap modehas it's limitations too. All paragraphs must be lined up againstthe right margin to take advantage of continuous wrapping, and Unixsystems have limited support for files of that format. You may havetrouble printing and viewing the files outside of NEdit.</p></a></qna><qna id="N698"><q>NEdit scrolls too fast when I extend a selection by dragging the mouseoutside of the window.</q><a><p>NEdit features proportional auto-scrolling, where thespeed is controlled by how far your mouse is beyond the edge of thewindow. If you want it to scroll slower, bring the mouse back closerto the text.</p></a></qna><qna id="N713"><q>Is there a special symbol that represents the selected text,usable in shell commands?</q><long-q><p>Is there a special symbol (as % for filename in the shell commands)that can be used to represent the text that is selected, which can thenbe used as an argument to a command? For instance, I want to feed theselection to a script so that it can be used as the expression to a'grep' command. Is there any other way that I can accomplish this goal?</p></long-q><a><p>Below is an example from the NEdit discussion list (from David L. Paterline)of a "Find All" command implemented by using the selection as an argument tothe grep command:</p><blockquote> <p>I set up a command to list all lines in a file which contain the highlighted selection as follows, using the Preferences -> Shell Commands menu:</p><pre> Menu Entry: all <selection> Command Input: selection Command Output: new window Save file before: yes Shell Command: grep -n -- "`cat -`" %</pre> <p>The <code>cat -</code> portion of the command echoes the selected text to the <code>grep -n</code> command, which lists the lines containing the selection with line numbers. The output of the command appears in a new window; I can then highlight a line number in the new window and use the Search -> Goto Selected menu in the original window to jump to the line in the original file.</p></blockquote></a></qna><qna id="N741"><q>How can I print highlighted text on my printer as it appears in NEdit.</q><a><p>In the current version, that's not possible, but there are external toolsfor highlighting, which are specifically designed for printing, includinga2ps, enscript, and genscript.</p></a></qna></section><section id="sect_server_mode"><title>Server mode and nc</title><qna id="N763"><q>I want to use <code>nc</code> as an externaleditor from my mailer, but my mailer doesn't wait for the editorto finish</q><long-q><p>I use a mailerwhich can invoke an external editor, but if I use nc, the mailer process
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -