📄 readme
字号:
seems ridiculous that this should happen in the face X11's thorough key definition standard. The new X11R6.3 for Linux does seem to interpret keys properly and all the keys should work as expected on the PC; so there should be no need to redefine keys under Linux. You can however eas- ily emulate another editor as you like.)SPELL CHECK AS YOU TYPE As of version 3.10.0, Cooledit spell checks typed words on the fly, placing the traditional wavy red line under miss- spelled words. This works by feeding typed words through ispell and placing them amidst the syntax highlighting rules if ispell returns a non-match. These rules expire after 60 seconds - which mean they won't stay underlined indefinitely. Word feeding is initiated by most key presses and applies only to the word under the cursor. To look up a word, merely move the cursor over it.UNICODE, UCS AND UTF-8 SUPPORT As of version 3.15.0, Cooledit has Unicode support. What kind of unicode support it has, and what unicode, UCS and UTF-8 are is explained as follows: 27 October 2001 10cooledit(1) cooledit(1) UCS stands for Universal Character Set. UCS is like ASCII (see ascii(1)) but instead of storing only 128 english specific characters, UCS goes up to 65535 characters and covers every known non-fictional language as well as sci- entific and mathematical symbols etc. UCS theoretically goes beyond 65535 (for example defining the very useful Klingon character set). However, it is likely that most implementations will keep to a 2 byte size requirement. Cooledit supports up to 131072 (1FFFFh) characters. UCS is also called Unicode and is officially ISO standard 10646. So wherever you see ISO-10646 it means Unicode. (Actually, Unicode is a standard to define fur- ther things like typographical layout, but for here, they are taken to mean the same thing.) 2 bytes (for UCS) instead of 1 byte for ASCII posses a problem for most programs. For example, the average C pro- gram uses a string function every few lines (that assumes a 1 character per byte format). To solve this we have UTF-8. UTF-8 stands for UCS Transformation Format. It is an encoding scheme that says that any byte encountered by an application that has a value below 128 is to be treated as ordinary ascii characters, but a byte with a value above 128 means that a sequence of bytes is forthcoming that represents some character in the range 128 to 65536 (or above). This enables a stream of single bytes to rep- resent the UCS character set, albeit with some ineffi- ciency. More information can be had from http://www.uni- code.org. Hence pure ASCII text is already in UTF-8 format. At the time of this writing, I am not quite sure precisely what an application has to be able to do to be classified as "Supporting Unicode". For instance: what about insert- ing characters? Don't input methods produce tradition charset encodings? And why are characters displayed by X's Xmb* and Xwc* functions? At the moment Cooledit can display Unicode characters if: (1) the "UTF8 Interpretation" is on, (2) the "Display Characters outside locale" is on, (3) you are using a non-"fontset" type font - when loading you get an error message "Font set not loaded", and (4) if the font is a Unicode font - i.e. ending in the font name iso10646-1. This may involve you having to install Unicode fonts. See http://www.cl.cam.ac.uk/~mgk25/unicode.html and http://czyborra.com/unifont/. For instance cooledit --utf8-interpretation --all-characters --no-fontset -font -gnu-unifont-*-*-*--*-*-*-*-*-*-iso10646-1 works. The GNU Unicode font is an attempt at supporting 27 October 2001 11cooledit(1) cooledit(1) the entire Unicode character set in one font. Most other fonts will support a limited range (such as omitting the 20000 Chinese ideographs). What Cooledit is supposed to do under a non-US locale I have no idea, so please give me a hint sometime. (Looking at the yudit documentation, it seems Gaspar also has my problems. Note that Cooledit does no character set translations whatsoever - maybe later versions will.THE INTERACTIVE GRAPHICAL DEBUGGER As of version 3.9.0, Cooledit features an interface to gdb(1) under the new Debug menu. This means that you can seamlessly debug C/C++ programs from within Cooledit just like you used to with your DOS Turbo Debugger. This is extremely cool. You can set and clear breakpoints (the line is bookmarked in red) and follow the program flow with the green cursor line. Please remember that this an interface to gdb: Cooledit has no debugging features of its own. If you do not have the correct version of gdb, then a warning will be displayed on startup. Interfaces are given to the common gdb commands. Any other commands can be executed with the Enter Command menu item. Automatic variable displays will soon be available though. When a program stops for some reason (either a breakpoint or a signal), Cooledit tries to determine the file and line number. If this cannot be done, a backtrace is dis- played. Backtraces do not contain full paths, hence files cannot be located if they are not already loaded. If the file is already loaded, then hitting enter on a file:line backtrace line will jump to the currect line number. Programs must of course be compiled with the -g option and preferably the -O0 option (without -O0 gcc's optimizations may make the program flow appear a little strange and some variables will not be accessible). Break-points are set and cleared from the menu or with Meta-F2. If you set a break point manually (with Meta-F1) it will not display in the edit window. Similarly if you clear a break point manually or close a window (thus clearing the breakpoints) there will be discrepancy between the book marks and the actual breakpoints. The same goes if you modify a file without restarting gdb. Variables can be displayed by selecting Display vari- able.... A listbox will show all the variables you have selected. Click on the listbox and press Del to delete from this list. Use Ins to highlight a variable - this 27 October 2001 12cooledit(1) cooledit(1) will cause a watchpoint to be inserted for this variable (i.e. the program will thereafter stop whenever the value of that variable changes). The listbox will also show an X in the second column if the variable has been altered since the last time the listbox was refreshed - this enables you to easily see which variable changes as you step through the lines of your program. Everything else you need to know is obvious from the menu. You would do well to read gdb's info pages if you have never used a debugger under Unix before.PYTHON MACRO PROGRAMMING As of version 3.8.0, Cooledit has a builtin Python inter- pretor. This means that Cooledit can execute arbitrary Python scripts from within its environment and bind scripts to keys and so forth. This is analogous to the way that Emacs uses a Lisp interpretor. Python is an object orientated scripting language like java, but with a much saner syntax. It is used for Rapid Application Develop- ment, and as a replacement for other intepretor languages like Perl, Tcl and Lisp. On startup, Cooledit reads the top level Python file lib/cooledit/global.py, and then the user's personal file ~/.cedit/global.py. Any Python code can go into these files. No other files are explicitely read, but the code within global.py will call other Python files. The loca- tion of the directory lib/cooledit/ is dependant on your installation and is added to the default search path for modules. To learn to program in Python, consult the tutorials and reference manuals that come with the Python sources. One of the reasons for the python interpretor is to enable emulation of other editors such as vi and Emacs. It is quite feasable to write python scripts that will emulate all of the functions of these editors, and have user dialogs and menu items to switch between different editor emulations... def get_ctrl_x_key(): status ("\034Press \030s\033\035") k, m = get_key () if m == 0: if k == "s": command (Save_As) key ("x", ControlMask, "get_ctrl_x_key()") The \034 and \035 means to draw a bevel around the enclosed text. The other escape characters cause colour 27 October 2001 13cooledit(1) cooledit(1) changes (1 - 26, 27 = black). Another powerful capacity is to have utilities specific to the particular file type that is being edited. When the type of an edit window is changed, the function type_change() from the global.py script is run. This func- tion must run an appropriate file for the given file type which defines keys and creates menu items in that window's Util menu. The following low level function are defined for manipu- lating the edit buffers. The functions operate on the cur- rent edit buffer. This is usually the one with the focus. move(int) Moves the cursor relative to its current position in units of one character. move_to(int) Moves the cursor to an absolute position in the buffer. move_lines(int) Moves the cursor relative to its current position up or down. int buffer_size() Returns the size in bytes of the edit buffer. insert(string) Types out the given string at the current cursor position. indent([int]) Inserts tabs and spaces according to the current half-tab and tab settings. The inserted margin copies the margin from the first non-blank line above the current line. If an argument is given, then it makes the margin bigger or smaller by this many tabs. i.e. insert ("\n"); indent (3) is like hitting Enter and then hitting Tab three times. insert_ahead(string) Inserts the given string ahead of the current cur- sor position. back_space(int) Deletes the given number of characters behind the cursor. delete(int) Deletes the given number of characters ahead of the cursor. 27 October 2001 14cooledit(1) cooledit(1) int current() Returns the current absolute cursor position. int current_line() Returns the current line number counting from zero for the first line. int bol(int) Returns the absolute offset of the start of the given line. int eol(int) Returns the absolute offset of the end of the given line. int find_forwards(int, string) Searches forward from the given offset and returns the absolute offset of the found string. int find_backwards(int, string) Searches backward from the given offset and returns the absolute offset of the found string. int line(int) Returns the line number of the given offset. Repeated calls to this function will be slow. string get_text([int[, int]]) Returns a string containing the characters between the given offsets. If the second argument is omit- ted, then this returns a string one character in length at the given offset. If both arguments are omitted then this returns the character under the cursor. string get_line([int[, int]]) Returns a string containing the characters between the given lines inclusive. If the second argument is omitted, then this returns a string containing the given line. If both arguments are omitted, then this returns the current line of the cursor. The trailing newline is not included. The following functions allow binding of arbitrary python code to menu items and keys:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -