|
General Help
The best way to learn the editor is to use it. ZionEdit is designed to be inituitive so you don't have to spend a lot of time learning it. An editor is just a tool to help you achieve your real purpose, which is to create great code.
The editor likes to get out of your way, but be close at hand when you need it's powerful features. Hence, there is a heavy reliance on the context menu (the menu that pops up when you right-click).
- The most frequently used functions are available with just a right-click.
- You may want to keep the statusbar visible at all times.
The status bar displays:
- Menu hints/Explanations
- Line number of last find
- Various other status and diagnostic messages
- Menu hints are VERY useful. Click on "File" and try sweeping through the menus, hovering above menu items and watching the status bar for hints.
- Many, menu commands are "Selection Aware" in that their behavior will change intelligently to the function intended. Most noteable are the C++, C#, Perl and Java special menu "if", "for" and "else". Normally you will get the if or for with an empty body (what's within curly braces), but if a block ( one or more lines) is selected, the function will automatically place the block within the body of the conditional statement, properly indented!
- The Line Number margin is also useful to leave visible as it also acts as a selection margin. For example, you can select multiple lines by dragging in the line number margin. If you choose not to use the line number margin, you can still quickly select a line by triple-clicking (left button) in that line (or do Ctrl+Alt+N). A double click in the line will select the current word
Configuration Files
zion.ini should be placed in the same directory or folder as zion.exe, but if zion.ini isn't found, one will be created for you (normally) in the same folder as zion.exe. [Advanced: you can specify a separate folder for zion.ini by using the -i option. See the Startup Options section.]
[Warning: ] do not start ZionEdit from the system path as zion.exe may not know where it was started from. Start it from an icon or only with a full or relative path when started at a command line. history.ini should be found in the same location as zion.ini. If not, the editor will ask to create one.
Both history.ini and zion.ini can be edited directly as long as care is taken to maintain the existing format.
- There must always be a blank line between sections
- Do not use comments within a section. Comments starting with # can be used outside of a section are fine.
- In history.ini it is okay to delete a line containing a file or directory path. That will remove it from the corresponding menu.
- To completely delete a directory entry in history.ini, first remove the entry from the [RECENTDIRS] section. Then, delete the entire section corresponding to that directory entry. Remember to leave a blank line between remaining sections.
- If after editing an .ini file, you start to get lock-ups, try removing the suspect section in the .ini file. If that still does not work try copying over from a known good .ini file. You could also delete the .ini file altogether and let the editor re-create it, but you will lose your particular settings.
Run Command
The Run Command menu option is quite powerful and there are a number of options to explore.
- Run via Cmd.exe – will process the command through cmd.exe, allowing environment variable lookup and translation - particularly the PATH. Run Specific File will call up that program directly.
- Replaceable parameters – are 2 character entities that are translated by the editor before passing to the operating system.
Examples:
- dir #p — Gives a listing of the Current Working Directory of the editor
- #Z -r myFile.c — will open a new edit window on the right-side of the screen with myFile.c loaded. The full path to zion.exe is specified with a #Z.
Install Help
Since ZionEdit starts up with half screen width, it is perfect for opening up
two ZionEdit windows side-by-side. Here's how to set that up.
Drag a shortcut of zion.exe to the Quick lauch bar, twice.
Right-Click on the leftmost icon and select "Properties".
In the "Target" field append " -L" . (There is a space before the -L).
Example:
D:\Apps\Zion\zion.exe -L
Click OK.
Do the same for the rightmost icon, but this time append " -R".
Found an issue in Windows XP: When the path name includes spaces the whole path is quoted. This causes XP to not recognize command-line arguments separate from the executeable name and will not allow the command line args. Therefore it is best to use a simple program directory name without spaces like Apps.
Hot Keys
Hot key combinations are listed in the menus. Take a look at them before you click. Hot keys are the fastest way to activate a menu action. It's worth learning them.
Most general menu actions are available with Ctrl+[key]. A few others with Ctrl+Alt+[key].
Ctrl+Shift+[key] has generally been reserved for the Mode (i.e. Computer Language mode) specific menus.
For example: Ctrl+Shift+M will create a comment all modes except Plain Text.
Other Notable Hot Keys:
Home – On the first press, the Home key will take you to the first non-whitespace char. on the line. On the second press, it will take you to the beginning of the line.
Indentation can be increased or reduced by pressing [TAB] or [SHIFT-TAB] respectively. To affect multiple lines, select those lines first.
Ctrl+D quickly duplicates the current line if there is no selection. If there are a number of lines selected, then that block will be duplicated – very convenient!
Vertical Selection – Pressing the ALT key BEFORE the start of a drag (left mouse button) will activate vertical selection mode. To vertically select purely with the keyboard do ALT+SHIFT+Arrow Keys.
F11, F12 – Zooms In and Zooms Out respectively. Ctrl+ (Numpad) + , - also zooms in and out respectively. If you get carried away with zooming and forget where "normal" is then press Ctrl+ Numpad / .
A default startup Zoom Level can be set in the Global Options tab of the Settings Dialog. With Auto Zoom on, "normal" will be the startup Zoom level. For right now Auto Zoom will be enabled only when Wrap Lines if OFF.
Finding and Replacing
For convenience, all strings that are searched for are saved in that window. Each time a new string is saved that "Find String" is propagated to other open windows. The entire history is not sent, so as to reduce clutter. Ditto for replace.
The find history is available from all Find Dialogs.
For all find functions, if a string was previously selected, that string will become the new find string.
The button labeled F<=>R in the Find/Replace Dialog (Ctrl+R), is a synchronize button. It synchronizes find and replace histories within the local window.
With a string selected, pressing F2, F3 and F4 will give a Super Quick Find. That is, the input dialog will be bypassed.
F2 – Find all occurences in the current file. The search can be "tweaked" from the Find All Results dialog by changing the text in the text field at the top and pressing Enter in the text field, or by clicking on a "Find Flag" FindAll also has a handy replace mode available. Double click an occurence in the upper listbox to replace it with a string entered in the replacement field. If you have made other changes to the file since the appearance of the FindAll Results dialog, you should first refresh the list by pressing enter in the upper text entry field (ie. the "find" field). Also, it is a good idea to single-click to verify the highlighted string is what you want, before the double click to replace.
F3 – Find the next occurence in the current file ( Will wrap ).
F4 – Find the previous occurence in the current file (Will not wrap).
F6 – Find in All Files is perhaps the most powerful feature of ZionEdit. Find In All Files will search for a string in all files of known extension starting from a specified directory and recursing downwards through the directory tree.You can preselect a string to preload the dialog. The list of known extensions is specified in Options | Settings | Ext. Map (Tab).
A powerful Global replace feature is available from the Find in All Files results dialog. Options should be self-explanatory, but noteable: Tweak on flags will give you the option of making fine adjustments on the search before the replace. From the global replace feature, we can replace ALL matching occurrences in a particular file. If you desire finer control to pick and choose which occurences to replace [safer!], click on a file in the Find in All Files dialog which will open up a FindAll Results dialog. Remember that changes in a global replace cannot be undo'd and so may not be easy to reverse because the file is saved and closed immediately after changes are made.
If all these options seem confusing, remember that you will learn them as you use them. They will be there when you are ready to do some powerful editing.
What is Preserve Replaced Case anyway?
Preserve Replaced Case tries to maintain the case of the string about to be replaced – that is, it temporarily changes the case of the replacement string to match what is being replaced.
The alogrithm makes a decision on case based only on a few conditions.
In the string to be replaced,
- If the first char is lower case, the replacement is set to all lower case. unless there is an upper case char in the rest of the string, then the replacement is used unchanged. (Mixed case is assumed as in: myString )
- If the first char is uppercase, the first char of the replacement is set to uppercase.
If the second char is uppercase, the rest of the replacement is set to uppercase.
Settings Tips
Settings are changed permanently only from the Settings Dialog with the exception being Html Tag Autocomplete. For example, if you want fold margins on by default in C++ mode, you can check the checkbox for Show fold margin under C++ General Options in the Settings Dialog.
Changes made in the Toggles Menu are per session only. A session lasts in an edit window until the Programming Language Mode is changed, for example, you change from C++ to Ruby, or settings are saved in any window.
Changing Fonts and Colors - Styles
- A "style" is pretty much Scintilla's (the core edit module's) way of rendering a programming language element. That is, fonts, colors and other text attributes.
- Styles can be changed quickly by right-clicking on the element and selecting "Change Style". From the dialog you can change other styles and settings. This is actually the Master Settings Dialog. You can also get this by going to Options | Settings
- Styles can also be changed, if you are a glutton for torture in zion.ini . Colors are represented in the hex. form: RRGGBB just like html, but without the #.
Style elements must be separated only by a comma. No spaces are allowed between elements. Descriptions may have spaces between words though (Descriptions are not read back to the editor, they are only output for the user's benefit). After making changes to zion.ini, select Options | Reload from zion.ini to incorporate your changes.
Auto Complete
By default Autocomplete is turned on. It will automatically try to complete a word from the internal list of language keywords plus any user keywords/functions.
Autocomplete settings can be changed under Settings | Global Options.
If Autocomplete is turned off you can still manually complete a word by pressing Ctrl-J.
Startup Options
- Options are entered on the command line separated by spaces.
- Options cannot be combined together, but must be entered singly,
each starting with a dash (- ).
- If an option takes a parameter, there must be no space between the option letter and the parameter. If the parameter must contain spaces, the parameter must be surrounded with quotes.
- Options are themselves are not case-sensitive.
Note: zion.exe should not be placed in the system path and run without a path on the command line. The editor needs to know the directory it was launched from.
|
filename | Opens the specified file |
-nnnn | Opens the specified file to line number nnn |
-qnnn | Opens the specified file to row number nnn. Must be specified in conjuction with the -n option |
-t | Opens a window in the top half of the screen |
-b | Opens a window in the bottom half |
-l | Opens a window in the left half |
-r | Opens a window in the right half |
-tl | Opens a window top left of the screen |
-tr | Opens a window top right |
-bl | Opens a window bottom left |
-br | Opens a window bottom right |
-c | Opens a window centered on the screen |
-m | Opens a maximized window |
-xnnn | Sets window position nnn pixels from left |
-ynnn | Sets window position nnn pixels from top |
-wnnn | Sets window width |
-hnnn | Sets window height |
-pstring | Must be combined with the -f option. Replace all occurences specified in the find string with this string. Save and automatically close the window. If the file is already opened writeable in another window, this will popup a dialog then exit. This is used by the Global Replace feature of Find In All Files |
-estring | Run specified command, capturing output to the current window |
-dstring | Set string as the working directory |
-fstring | Find all occurences of the string on startup |
-gnnn | Decimal search flag to use with the above search
Match Whole word | 0x2 |
Match Case | 0x4 |
Preserve Case | 0x01000000 |
Regex | 0x00200000 |
|
-ipathname | Sets the startup folder/dir for zion.ini - ZionEdit's startup file |
-lexnnn | Sets a lexer for startup |
HTML Tips
To place a pair of tags around a string or block just select it first then choose a tag from the HTML menu. The majority should work like that including anchors.
You can turn off "Tag Auto Complete" from the HTML menu (when in HTML mode) by unchecking the menu item. This change will be made persistent, so the HTML window must have a Style Lock. (See the IPC section).
You can bypass Tag Autocomplete for the tag you are about to close by pressing Ctrl+Shift+> before pressing the final Shift+>.
Ctrl+K will skip the current position to just past the next > Ctrl+Shift+K will skip to the left, in front of the next <
Ctrl+Enter will give a <BR>, but if you are typing a lot of formatted sentences, you may want to turn on "Auto <BR>". You don't want to leave it on for too long as it could get annoying.
Inter Process Communication (IPC)
One window (usually the first one you start up) acts as a server and all other windows are clients.
Clients must contact the server before making most permanent changes. The server coordinates requests to write to zion.ini, so that there are no multiple unexpected updates and that all other client windows know about updates when they do happen.
If your server tells you that "Another window has the lock for style changes" then look for the window with the process id given and save settings in that window. If that still doesn't work, click Help | IPC Status and see if there are any windows showing to have "Style Lock". Close them and try again. If all else fails, close all windows and reopen as needed.
The number in the title-bar is the process id of the current window and is used as an identifier in IPC.
Just f.y.i., if the server window is closed, a reconvergence takes place and another window is selected to be server. If you'd like to know which one became server check Help | IPC Status in any window.
Whenever a window is switched out of Read Only to Writeable, the file is automatically reloaded so that the editor buffer is current. This is very helpful when you are editing between windows of the same file. Care is still needed when editing a single file through multiple windows.
Known Issues
You mean human beings have flaws?
Currently there are no major outstanding bugs that I know of. If you do find a bug or even a minor issue, please do send me a quick Bug Report from Help | Bug Report/ Comment. It is with the help of a community of users that software can become very robust.
Brace highlighting also counts braces in comments. Hope to find a fix for that soon. 'Til then just make sure you don't leave a hanging brace or parenthesis in your comments.
There is an internal issue with the wxSTC class as used in this program: When "line wrapping" is on and styles are reloaded, scintilla may cause an assertion, then lock-up. ZionEdit addresses this problem by setting up a fresh edit buffer with the chosen lexer set, then reloads the file into that buffer. This is not necessary ( and isn't done ) when line wrapping is off. The fix has been working for many months with HTML line wrapped, but was never applied to any other mode. That has been fixed, and you should not have any lock-ups under any condition.
It is good practice though, in any editor, to do a "save" before scrolling away from an edited position. Right-Click, then select "save" at the bottom of the menu.
A Little History
It's true. ZionEdit was started after working through the David Beech Tutorial in September 2005.
I was planning on learning Python, then thought I needed a good GUI Toolkit for that, so I started to investigate wxPython.
The examples I saw seemed a bit cumbersome with the DOS window and all – and then the thought of the GUI being interpreted! Uhhh! So I thought, how hard would it be to learn wxWidgets straight up.
I had toyed a little with the Fox Toolkit under Linux and was hoping one day to really get into it deep. It just didn't happen. When I started to check out David's tutorial, I was in for a BIG SURPRISE! WxWidgets was easier to learn than the Fox Toolkit and the documentation, oh yes, the documentation is WORLD CLASS!!! WxWidgets superior documentation was one big reason I was able to progress this fast and this deep into wxWidgets. Also after a year and half of working with wxWidgets I found only one minor bug (in a listbox refresh, ver. 2.6.1) that was fixed in version 2.6.3.
Reality Check: Indeed there is a LOT of hype out there concerning scripting languages and other esoteric tools, but C++ is one powerful, beautiful and simple language that will be around for a long, long, time! Take it from a guy who never really did anything more than a paragraph of C++ code before Sept. 2005!
Why the Name Zion? Okay, I am not a Jew, just a Christian. The name Zion was chosen for it's biblical roots: "By the rivers of Babylon, there we sat down, yea, we wept, when we remembered Zion." — Psalms 137:1
Zion is a place of refreshing, a place we long to get back to, a place where God is.
Created with ZionEdit
|
|