Kaa is very easy to learn in spite of its rich functionality. Only thing you need to remember is “To display menu, hit F1 key or alt+’m’ key”. Most of basic features could be accessed from fancy menus by hitting underlined character in the menu items. You can use kaa as easy as you are with Notepad on MS-Windows.

Kaa is a CUI editor that runs on most of modern UN*X flavor operating systems like Linux or Mac OS X. Kaa requires Unicode friendly environment both platform running kaa and terminal emulator/console to interact with kaa.

Cygwin environment on Windows platform is not supported at this time, but will be tested after they provide Python 3.3 package.

Development files for Python 3.3. For recent Debian/Ubuntu, you can install required libraries by

$ sudo apt-get install python3-dev

If your Python installation is not system-supplied package but built by yourself, please ensure you have installed ncurses library with wide character support before you built Python. Consult documentation of your platform for details. For recent Debian/Ubuntu, you can install required libraries by

$ sudo apt-get install libncursesw5 libncurses5-dev libncursesw5-dev

After theses packages are installed, rebuild Python installation to take effect.

Kaa can use system clipboard. To use clipboard on Unix platform, xclip command should be installed. For Ubuntu Linux, following command installs xclip command.

To display menu, type F1 key or alt+m (type ‘m’ key with alt key). Each items in the menu has one underlined character. The menu item is executed by typing the underlined key with or without pressing alt key.

Typing escape key hides menu.

File menu

New

Create new file.

Open

Open existing file.

File info

Show file information. Also update per file
settings of tab or indentation.

View Diff

Show difference between original file and current
buffer.

Save

Save current file.

Save As

Save current file as new file.

Close

Close current frame.

Save all

Save all current files.

Close all

Close all frames.

[Recently]

Show recently used files menu.

Quit

Terminate kaa.

Recently used files menu

Recently used files

Show list of recently used files.

Recently used dirs

Show list of recently used directories.

Edit menu

Cut

Cut selected text.

Copy

Copy selected text.

Paste

Paste from clipboard.

Paste History

Paste from clipboard history.

Undo

Undo last modification.

Redo

Redo last undo.

Search

Search text.

Replace

Replace text.

Complete

Word completion.

[Convert]

Show text convert menu.

Text convert menu

Upper

Convert selected text to upper case.

Lower

Convert selected text to lower case.

Normalization

Convert selected text to Unicode Normalization
Forms(NFKC).

Full-width

Convert alphabet and numbers in the selected text
to full-width character.

Code menu

Code menu differs among file types. Following items are typical in programming languages.

Comment

Insert line comment character at top of lines in
selected region.

Uncomment

Delete line comment character at top of lines in
selected region.

Table of
contents

Show table of contents to move cursor.

Macro menu

Start record

Start macro recording.

End record

End macro recording.

Run macro

Run last macro.

Tools menu

Grep

Search text from disk.

Paste lines

Insert lines of text without auto indentation.

Shell command

Execute external shell command and insert the
output.

Make

Run make to compile source files and capture
error messages. Use f9/10 key to traverse errors.

Spell checker

Run English spell checker.

Python console

Start python console.

Python debugger

Start Python debugger.

Python debugger
server

Wait for external debugger connection.

Window menu

Frame list

Show list of frame windows. Use left/right
arrow key to change active frame.

When regex button is checked, Replace string is also regular expression string. In this case, special characters like \t or \n are converted to tab character and newline character. Also, back-reference character will be replaced to sub-string matched group in the search string. For example, when search string is ‘(a+)(b+)’ and replace string is ‘\2\1’, matched string ‘aabb’ will be replaced to ‘bbaa’.

Grep dialog has three input field. Search is a plain text or regular expression string to search. Directory is a directory to start searching. If Tree button was checked, files are searched recursively. Filenames is space separated list of file spec in shell-style wild-cards (e.g., *.txt *.py *.doc). Up arrow key displays history of each input field.

In the grep result window, use F9 and F10 key to traverse matches forward/backward.

You can type Python script as normal Python interpreter. To execute script, you should hit enter key at very last of the script. Otherwise, newline character is inserted as text editor. You can move cursor upper or below to edit multiline script.

Kaa can be used as front-end of Python debugger module(bdb) running in another process. Although kaa itself requires Python 3.3 or later, you can use Python 2.6 or later in the target process.

Starting debugger

There are three ways to start debugger.

kaadbg.run module

Kaadbg package executes your Python script with Python debugger connected to debugger window of kaa. Usually, kaadbg is Python package installed as a part of kaa. To use another Python interpreter than kaa installed, you can install kaadbg separately.

set_trace

You should start activate kaa remote debugger by menu [Tools]|Python debugger server and enter port number to connect debugger(default 28110).

To connect kaa remote debugger, open your target script and insert following lines of code.

importkaadbg.debugkaadbg.debug.set_trace()

If you need use other port than 28110, you should provide port number to set_trace().

importkaadbg.debugkaadbg.debug.set_trace(29000)

Now you can start your target script. Kaa remote debugger will be opened when kaadbg.debug.set_trace() is hit.

Run child process

You can run your target script as child process of kaa to debug.

To start child process, select [Tools]|Python debugger in kaa menu and specify command line as follow.

python2.7 -m kaadbg.run myscript.py arg1 arg2

Command line should starts with Python interpreter you use and -m kaadbg.run. Name of target script and arguments follows.

Note that kaa doesn’t capture standard output and standard error of target process, so you cannot see outputs of the target script. Also, standard input of the target process is closed just after command started.

Breakpoints

To set/unset breakpoints, select [Code]|Toggle Breakpoint in menu in editor. By default, f8 key is bounded to this menu item.

While debugger window is opened, you can suspend the debugger window by escape key. After you finish to update breakpoints in editor window, select [Tools]|Python debugger menu again to resume debugger. To view list of current breakpoints, select breakpoints button with alt+E key.

Inspect variables

To see value of variables, select Expr on the debugger window by pressing alt+E key and enter Python expression you want to inspect like self.spam.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.