QE -- PE2 under U*nix
---------------------
1. About QE
QE is a PE2 clone editor program under U*nix (PE2 is an editor software under
PC-DOS), I named it QE for the reason that the P is followed by Q :-)
QE is a macro-definable full-screen editor software for U*nix, users can
benefit from this feature...
The homepage of QE:
http://www.cc.ncu.edu.tw/~center5/product/qe/
and also the English introdution homepage of QE is on "Linux for Taiwan"
http://members.xoom.com/linux4tw/qe/
2. Installation
The QE source is developed under C++, the source code can be downloaded
http://www.cc.ncu.edu.tw/~center5/product/qe/
and please make sure you have following software to make executable
binary:
g++: GNU C++ Compiler
reference version: gcc-2.8.1.tar.gz
libstdc++-2.8.1.1.tar.gz
ncurses: GNU Curses
reference version: ncurses-4.2.tar.gz
Steps:
untar the file you've downloaded, edit the Makefile if you want to change the setting,
then run the following commands:
make
make install
3. Environment setting
The default executable binary of QE will be installed under
/usr/local/bin, configuration (qe.pro) and help (qe.hlp) files is under
/usr/local/etc if you didn't change the default Makefile setting.
The "qe.pro" hold the public setting of QE and key definition, also the
macro. or you can use private one under HOME directory named ".qerc".
for now, key definition under qe is as same as under PE2, press F1 under QE
will retrieve the "qe.hlp" file for help. you can check the PE2 manual
as well.
QE support color display, but the behavior of some terminal emulator
have to be changed to support color display. If the console or
terminal emulator under Linux/FreeBSD support color display, you have to
change the TERM to xterm-color or color_xterm or rxvt (depends on system) as
following:
under csh or tcsh:
setenv TERM xterm-color
under sh, bash, ksh:
TERM=xterm-color
export TERM
Or, you can use the command line option to change the TERM setting:
qe -t xterm-color
but, this will not work in some platform.
So, to simplify the setting, you can use the shell script as follow (named it pe2
or whatever you like):
--------------------------------------
#!/bin/sh
t=$TERM
TERM=xterm-color
export TERM
qe "$@"
TERM=$t
export TERM
-------------------------------------
4. command line options
-h Help (available option list)
-t Setting Terminal Type
(e.g qe -t xterm-color)
-p use profile (.pro) instead of ~/.qerc
(e.g qe -p ~/myqe.pro)
5. Bug report
Please send bug report to center5@cc.ncu.edu.tw
6. profile file (.pro) and temporary setting (in command line)
SET commands
set blankcompress on/off (compress the blank)
status query: run the [?b] on command line
set searchcase exact/any (ignore the case or not when search or replace)
status query: run the [?s] on command line
set searchcase exact exact the same
set searchcase any any
set big5 on/off/auto (Chinese mode in Big5)
status query: run the [?5] on command line
set big5 on yes, Chinese mode
set big5 off English mode
set big5 auto Auto detect (by LANG environment setting, zh_TW for Chinese, others for English)
set history-key none/up/down/both (the key to choose the histories in command line)
set history-key none close
set history-key up key UP
set history-key down key DOWN
set history-key both both key UP and DOWN
set dir-sort-by name/time/size (sorting as reading the directory)
set dir-sort-by name by filename
set dir-sort-by time by the time of files
set dir-sort-by size by the size of files
set ctrl-k on/off
set ctrl-q on/off
set ctrl-x on/off
因於 UNIX 上可利用的鍵少很多,因此 QE 允許使用者以
Ctrl-K (參考 joe 或 WordStar) 或 Ctrl-Q (參考漢書) 或
Ctrl-X (參考 Emacs) 搭配其它鍵。搭配的鍵可以是英文字母或
數字,分別以 k- q- x- 表示。如 k-q 代表 Ctrl-K Q
而 def k-q = [quit] 則可以將 QE 定義如 JOE 一般的功能,
但要 set ctrl-k on,但會失去 ctrl-k 的原有功能。
在命令要查詢目前這些功能開關狀況可分別以 [?k]、[?q] 及 [?x]
查詢,也可在 Editing 狀態下直接修改。
DEF series
def or d is used for macro command definition on keys, e.g.
def enter=[il][up][fn][down]
you can define it on the command line directly, but it won't be kept for next time you
run qe (so you can keep it on the profile file qe.pro)
7. commands in command line
1. open file: e filename or edit filename
2. save file: save (not support: save filename)
3. save and quit: file
4. quit: quit or q or [quit]
5. rename: n filename or name filename
6. dir: dir or dir path
use the lightbar to choose the file after the command dir
7. Shell: shell to you SHELL, and exit from SHELL to go back to QE
8. jump to line: run line 110 will jump to LINE 110
9. temporary macro: 一般而言,巨集指令都是定義在功能鍵上,但也可在命令列直接下巨集指令
10. 臨時定義鍵: 在命令列臨時修改某功能鍵的定義,如將 enter 鍵的功能
改為不插入一行,直接跳到下一行的開頭,可下
def enter=[down]
另外定義功能鍵也可直接以鍵碼來定義,比方說,原本您預期
用 Ctrl-Z 來刪行,但按了 Ctrl-Z 出現
key code: [ 26 ] is not defined,則您可以下
d 26=[dl] 來達到目的,這種功能特別適合於一些 function
key: f1 ~ f12, home, end, pgup, pgdn 不 work 時。
11. 臨時修改環境: 用 set 指令可修改環境,如寫 Makefile 一定要
set blankcompress on
12. 搜尋: l/abc/ 、 /abc 、 /abc/ 往下搜尋有 abc 字串的地方
l/def/- 、 /def/- 往上搜尋有 def 字串的地方
lak/a 、 l\k/\ 往下搜尋有 k/ 字串的地方
^ ^ ^ ^
l/abc/m 、 /abc/m 往下搜尋在標記區有 abc 字串的地方
l/abc/m- 、 /abc/m- 往上搜尋在標記區有 abc 字串的地方
13. 搜尋/取代: c/abc/def/ 往下搜尋有 abc 字串改為 def
c#ab/#d\b# 往下搜尋有 ab/ 字串改為 d\b
^ ^ ^
c/abc/def/- 往上搜尋有 abc 字串改為 def
c/abc/dev/m 往下搜尋標記區有 abc 字串改為 def
c/abc/def/-m 往上搜尋標記區有 abc 字串改為 def
搜詢到後,會出現如下的訊息 (這個部份和 pe2 不同)
confirm change [y/n/q/a]:
Yes 按 y 表要 change,然後找下一個
No 按 n 表不改,然後找下一個
Quit 按 q 表不改,也不再找了
All 按 a 表全改,不要再問了
如果想在命令列下指令改全部而不要一個一個詢問,則在
最後要加 * ,如:
c/abc/def/*
注意: 目前搜尋都是大小是否區分,由 searchcase 決定 !!!!
8. supported macro commands
PE2 compatible macro commands:
---------------------------------------------------------------------
command abbreviation description
---------------------------------------------------------------------
[backtab word] [bw] 往回跳上個字
[beep] [bp] 發出 beep 聲
[begin line] [bl] 到行的開頭
[begin mark] [bm] 跳到 mark 區的開頭
[begin word] [wb] 跳到字的開頭
[bottom] [bo] go bottom of the file
[bottom edge] [be] 跳到螢幕最下一行
[center line] [cl] 將游標所在位置調整在中間
[command toggle] [cg] 命令區和資料區的切換
[copy from command] [cf] 將命令列的資料拷貝到資料區
[copy mark] [cm] 將標記區的資料拷貝到游標所在位置
[copy to command] [ct] 將游標所在資料區的內容拷貝到命令列
[cursor command] [cc] 跳到命令列
[cursor data] [ca] 跳到資料區
[delete char] [dc] 刪除一個字元
[delete line] [dl] 刪除一行
[delete mark] [dm] 刪除標記區
[down] [down] cursor up
[edit] [e] edit file
[end line] [el] cursor end of line
[end mark] [em] 游標移到標記區的最後
[end word] [we] 游標移到字的結尾
[erase begin line] [eb] 刪除游標以後的資料
[erase end line] [ee] 刪除游標以前的資料
[execute] [ex] execute command line commands
[fill mark] [fm] 將標記區填入一個字
[first nonblank] [fn] 跳到游標所在行第一個非空白的字元
[insert line] [il] 插入一行
[insert mode] [im] 輸入模式切換成插入模式
[insert toggle] [it] 切換輸入模式
[join] [jo] join next line to the end of this line
[left] [left] cursor left
[lowercase] [lc] lowercase the data in the marked block area
[mark block] [mb] mark block
[mark line] [ml] mark lines
[move mark] [mm] move the marked block to cursor position
[overlay block] [ob] 用複蓋的方式複製 block 形式的標記區
[page down] [pd] 跳下一頁
[page up] [pu] 跳上一頁
[pop mark] [po] 從堆疊取出標記區
[push mark] [ps] 將標記區放進堆疊
[replace mode] [rm] 輸入模式切換成取代模式
[right] [right] cursor right
[rubout] [ro] delete the one character on the left of the cursor
[scrolldown] [scrolldown] 螢幕上捲
[scrollup] [scrollup] 螢幕下捲
[scrollleft] [scrollleft] 螢幕左捲
[scrollright] [scrollright] 螢幕右捲
[shift left] [sl] 將標記區資料往左推一格
[shift right] [sr] 將標記區資料往右推一格
[split] [sp] 將游標後的資料移到下一行
[tab] [tb] 跳到下個定位點
[tab word] [tw] 跳到下一個字
[top] [to] 跳到檔案的開頭
[top edge] [te] 跳到螢幕最上一行
[undo] [ud] 還原錯誤的輸入
[unmark] [um] 取消標記區
[up] [up] cursor up
[uppercase] [uc] uppercase the data in block
[?b] query the status of blankcompress setting
[?s] query the status of searchcase setting
[quit] [quit] quit (won't save the file)
[clear marks] [ck] clear the marks
---------------------------------------------------------------------
QE macro commands:
---------------------------------------------------------------------
command abbreviation description
---------------------------------------------------------------------
[kill line] [kl] delete the data behind the cursor,
if the cursor is in the end, then join the next line
[search] [search] QE style data searching
[menu] [menu] pulldown menu
[history] [history] list the history
[quit all] [quit all] close all files, and quit the QE (won't be ask to save the files)
[file all] [file all] save all files, and quit the QE
[?k] query the status of Ctrl-K
[?q] query the status of Ctrl-Q
[?x] query the status of Ctrl-X
[?5] query the status of Chinese message
8. not supported macro commands (my todo list)
[backtab]
[center in margins]
[clear message]
[demo end]
[demo fast]
[demo slow]
[escape]
[left edge]
[left margin]
[mark char]
[next view]
[next window]
[paragraph margin]
[print]
[print mark]
[redraw]
[reflow]
[right edge]
[right margin]
[split screen]
[zoom window]
Press ESC (or Alt-ESC) key twice to switch between DATA area and COMMAND LINE area,
you can define this function to other keys, the macro command is [cg]
               (
geocities.com/soho/nook/1813)                   (
geocities.com/soho/nook)                   (
geocities.com/soho)