Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Help:Text editor support
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Lynx === [[Lynx (web browser)|Lynx]] allows editing text area content with an external editor. When the cursor is in the text area, one can type {{key press|Ctrl|X}} and {{key press|E}} — or {{key press|Ctrl|E}} and {{key press|E}} to invoke a text editor. In addition, Lynx accepts a user-definable key-binding (normally not bound) to invoke the external editor. Some packagers may assign a user-definable binding in Lynx's configuration file. ==== Do not wrap ==== After saving the file in an external editor, quitting it and returning to Lynx, answer "no" to the Lynx question "Wrap lines to fit displayed area? (n)" by pressing the {{key press|N}} key; answering "yes" will otherwise have Lynx wrap lines with normal carriage returns, which will break the document structure. Using article preview is strongly encouraged. ==== Line and paragraph breaking ==== Lynx built-in hard limits line length. In version 2.8.3, find this line in <code>LYGlobalDefs.h</code>: : #define MAX_LINE 1024 This can be modified to a longer length (e.g. 8192) and recompiled. If you are unable to recompile Lynx, the following are workaround suggestions. Lynx is prone to breaking lines longer than 1023 characters: When this happens, a large paragraph with lots of reference data may easily become broken, and articles saved like that may take at best a slightly inconsistent appearance; at worst, complex articles might lose their structure. The character length limit is dependent on maximum buffer length set for a line, the default size of which is 1023 characters; this behaviour can be observed when moving the cursor to a text area line exceeding the limit, whereby Lynx will issue an alert: "Form field value exceeds buffer length! Trim the tail." Even if a paragraph of article text on its face is not very long, it may still contain multiple references along with extensive amounts of related code and data for them, which makes an actual paragraph in article code much longer, and in some cases, well beyond the length of the 1023-character limit. When a line of text exceeds that limit and a text file is sent back to the Lynx textarea, Lynx will yield an error message: "Alert! Very long lines have been wrapped!". In such a case it's best not to save article content before such issues have been mitigated. Therefore, article editors should be careful to follow the character length of longer lines, and where (usually) possible, insert strategic linebreaks with carriage returns (not HTML <CODE><BR></CODE> tags): Advanced text editors, like vi or VIM, do typically show cursor position within a line in their status areas, and thus allow to gauge line length when the cursor is at the end of a line. In a longer paragraph of article code containing references, single linebreaks can be inserted within reference code, so long as parameter values themselves are not broken. *Some Wikipedia editors hold the practice of entering a linebreak before every reference parameter (as can be seen in examples of [[Wikipedia:Citation templates|Citation templates]]; Whether this is a good practice within text, is subject to debate); *Other editors choose not to interfere with a paragraph's visual consistency and enter a linebreak before a very long URL, one that is longer than the visual line in a terminal window, which is usually the length of 80 characters. If the situation in text necessitates, a linebreak can also be inserted before other parameters. Because URLs are typically long, placing these on a new line is handy for comparing article editions, as some textually non-breaking code prepended and/or appended to a URL may lie outside a comparison column's viewport, and this may hinder in discovery of changes made to an article. If a paragraph line is near the limit or exceeds it by just a few characters, then article editors can choose to optimize code or text: *By removing superfluous spaces: **the best practice with extensive template data (such as references) is to only separate the last character of a previous parameter value and the marker pipe of next parameter's name; **In plain text after a sentence-ending period, some article writers add two spaces instead of one, but browsers ignore this. *By refactoring template data into a shorter format: <CODE>date=26 February 2011</CODE> can be replaced with <CODE>date=2011-02-26</CODE> — Users with their own date preferences should then see dates in their favoured format when logged in; *By rewording a line without affecting the nature of the text within. *The above applies, even if a paragraph line does not contain breakable code. If a line paragraph still exceeds the 1023-character limit, but does not contain any reference code (or any other wikicode that would work with linebreaks), then users should consider logically breaking that paragraph into two for better legibility. ==== Encoding ==== If accented and international characters fail to show properly, use a terminal program that has support for Unicode (such as [[xterm|uxterm]]) and set the assumed and display character sets to UTF-8 or greater in Lynx options. Nevertheless, article content with any special characters — including non-standard Latin, Cyrillic, or other non-Latin languages — are seen in Lynx textareas in the UTF-8 <CODE>&#xXX;</CODE> format, which in that form are sent to text editors and then back. Beware that these UTF-8 glyph representations are not treated as one character, but as six (ΓΆ = <CODE>&#xF6;</CODE>), and these add to the 1023-character line limit. Such behaviour is a hindrance to editing non-Latin texts, and even Latin texts that are written in languages that may feature extensive amounts of accented characters.<BR> See [[#Dealing with special characters]] for more. ==== Lynx in Windows ==== In addition to above instructions, there are intricacies specific to Windows. If you want to use Wikimedia's secure servers, get a version of Lynx that supports SSL. To find out if yours already does, go to Options and see if the User-Agent header contains <CODE>OpenSSL</CODE>. The assumed character set should be <CODE>utf-8</CODE>, as this is also the default charset used by Wikipedia. The display character set can be different, such as <CODE>cp850</CODE>, but editable text will always be in <CODE>utf-8</CODE>. In Windows, the display font should be Lucida Console instead of 'Raster fonts', as Lucida Console supports a greater amount of characters. The display font can be changed in window properties: In Windows XP, click the Lynx window icon (to the left of the title), choose Properties, and switch to the Font tab, which typically lists only Raster fonts and Lucida Console. ===== Lynx configuration files ===== Configuration files for Lynx are simple text files and can be edited from any text editor that supports Unix linebreaks. In Windows 9x, the built-in text editor for this is [[WordPad]], because [[Windows Notepad|Notepad]] in these old Windows versions does not support the Unix Line Feed. '''<CODE>lynx.cfg</CODE>''' is the config file for Lynx; the global config file in Windows is always located in the same folder as the Lynx executable, wherever it has been installed to. A typical location is <CODE>C:\Program Files\Lynx</CODE>. If Lynx is installed in that folder, then Windows Vista and newer usually require administrator access to edit the file (via User Account Control). '''<CODE>lynx.rc</CODE>''' is a per-user Lynx User Defaults File saved from the Options page. Settings in it take priority over the global config file. In Windows Vista, the per-user User Defaults file can be in <CODE>C:\Users\''Username''\AppData\Local\temp\lynx.rc</CODE>. If the file is in the <CODE>temp</CODE> directory, care is advised when using automated cleanup tools like Disk Cleanup. Lynx Option file syntax is different between global (lynx.cfg) and per-user (lynx.rc) configuration files. <CODE>lynx.cfg</CODE> is extensive; very often, almost all options are placed into it, along with explanatory comments for each option. If it's not so, there's an official online version at [http://lynx.isc.org/lynx2.8.7/lynx2-8-7/lynx.cfg lynx.isc.org/lynx2.8.7/lynx2-8-7/lynx.cfg] — Keep in mind that if your Lynx version is different, change the numbers in the URL accordingly, as some options may be version-specific. The best way to find an option is by using the text editor's find feature. When not in active use, an option is commented out with a hash <CODE>#</CODE> and its default setting is on; To use an option, delete the hash character before it. The config file may occasionally not contain a specific option, but it can be added by the user. ===== Defaults to reconsider ===== The following options are often found as defaults in Lynx binaries compiled for Windows and might not meet formatting conventions used in Wikipedia. These options can be edited from <CODE>lynx.cfg</CODE> and are usually not specified in the Options page. Before editing, back up the file and rename it to <CODE>lynx.cfg.old</CODE>, for example. ====== Collapsed <NOWIKI><BR></NOWIKI> tags ====== The <CODE>COLLAPSE_BR_TAGS:</CODE> option should be set to <CODE>FALSE</CODE>, as in the example below: COLLAPSE_BR_TAGS:FALSE The reason is that some editors intentionally use more than one <CODE><NOWIKI><BR></NOWIKI></CODE> tag, especially in locations where conventional paragraph breaks are not allowed. ====== Justified text ====== Graphical browsers do not show this, since justification is not used. For this, set JUSTIFY:FALSE ====== Numbered links ====== As Wikipedia articles very often feature linked content in tables, the numbers in brackets before or next to links may be distracting. Set these following options: DEFAULT_KEYPAD_MODE:LINKS_ARE_NOT_NUMBERED NUMBER_LINKS_ON_LEFT:FALSE ====== Editing ====== The typical key combination to invoke an out-of-Lynx editor in Windows is Ctrl+x+e and not Ctrl+E+e like in Unices and elsewhere; this can be changed in the config file. Both an internal and external editor can be used, according to taste and preferences. Avoid Windows Notepad for reasons stated above. And only since Windows XP does WordPad have full Unicode support (with some reservations).<br> An example with Vim, configured to use the mediawiki syntax: SYSTEM_EDITOR:C:\Progra~1\Vim\vim73\vim.exe -c "setf mediawiki" Note the double quotes ^ ====== Colour issues ====== When using an in-window editor like Vim and after exiting back into Lynx, any colour theme Lynx uses is rendered inoperable (links and buttons not highlighted anymore), so the best practice is to never show colors in Options (in section Appearance), and save the settings.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)