Disclaimer

This information HAS errors and is made available WITHOUT ANY WARRANTY OF ANY KIND and without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. It is not permissible to be read by anyone who has ever met a lawyer or attorney. Use is confined to Engineers with more than 370 course hours of engineering.
If you see an error contact:
+1(785) 841 3089
inform@xtronics.com

Diakonos

  1. Disclaimer
  2. Diakonos
    1. Install on Debian
    2. Help files
      1. about-help
      2. Clipboard
      3. Close file
      4. Colors
        1. Language Definitions
      5. Column-markers
      6. config
      7. Cursor-Stack
      8. Delete
      9. Extensions
      10. File-type
      11. Key Mapping
      12. Line Numbers
      13. Macros
      14. New File
      15. Open File
      16. Quit
      17. Resizing
      18. Ruby
      19. Save File
      20. Scripting
      21. Shell
      22. Speed
      23. Support
      24. Switch Buffers
      25. Tabs
      26. Undo
      27. Uninstall
      28. Welcome
      29. Word Wrap



Turn off colors

F4

Install on Debian

apt-get install libncurses5-dev ruby-dev ruby-curses
gem install diakonos

Help files

about-help

# Diakonos Help

Welcome to the Diakonos help system!  To learn more about how to use Diakonos,
type in some keywords as if you were searching the Internet.  Diakonos will
show the titles of matching help documents.  Use the arrow keys to choose a
document, and press Enter to read it.

If you're not sure what keywords to type, you can type a partial word and
press <Tab> to see a list of tags that start with what you typed.  Or,
advanced users can prefix the search with a slash (/) and a full-document,
regular expression search will be performed.  Type a slash by itself to see a
list of all help documents.

The documentation is written using the default key chords and sequences.  As
such, please be aware that the documentation may not correspond to your
actual setup if the keyboard configuration has been changed (by you, or
someone else, such as a system administrator).

When you are finished reading a document, close it with the close file key
chord, <Ctrl-W>.

To abort your search for help and close the help system, press <Esc> twice.

## Diakonos Help Files

The help documents are normal files, and are opened just like other files in
Diakonos.  You can copy code examples and configuration lines out of them
and paste them in other buffers.  You can even create your own files (with a
.dhf extension) and place them alongside the default help files.

Tags: diakonos help usage support

Clipboard

# The Clipboard

To select text, press <Ctrl-space>.  This marks (or "anchors") one end of the
text you wish to select.  Use any movement keys (such as the arrow keys) to move the
cursor to the other end of the text you wish to select.  As you do so, you will see
the selection grow, being highlighted in a different colour.  To work with the
selection, press one of the following key chords:

<Ctrl-C>  to copy
<Ctrl-X>  to cut
<Ctrl-V>  to paste
<Alt-U>   to unselect the text

Diakonos also lets you cut one or more lines of text without needing to
delineate a selection.  Pressing <Ctrl-K> once cuts the current line and
places it in the clipboard.  You can press <Ctrl-K> more times to cut and add
more lines.

<Ctrl-Alt-K> will cut from the cursor to the end of the current line.

Diakonos also supports synchronization with Klipper, the KDE clipboard
manager.  This requires DCOP to be installed.  Uncomment the indicated line
in the configuration file.  Alternatively, synchronization with the X
clipboard can be accomplished with xclip (third-party software).  Uncomment
the xclip line for xclip usage.

## Block Selection

Diakonos supports block selection.  This allows you to select and work with
rectangular highlighted areas instead of selecting text the usual way (as a
left-to-right flow of characters).

To change to block selection mode, press <Alt-Shift-M,B>.  The status line will
indicate "block" mode.  To change to normal selection mode, press
<Alt-Shift-M,N>.  Mnemonic: M for Mark, B for Block, N for Normal.

## Advanced Selection

Press <Alt-space> to select the current code block.  That is, the lines which
are at the same depth of indentation as the current line.  Press <Alt-space>
more times to select each successive parent block (i.e., lines at shallower
levels of indentation).


Tags: clipboard copy cut paste kde klipper dcop select selecting selection selected unselect unselecting mark marking highlight eol line block column

Close file

# Closing a File Press to close the current file. Help documents and error messages are also files, and are closed with . Tags: close closing file files buffer buffers

Colors

Note:  color is a synonym for colour.


(thumbnail)

 Colour Definitions

 colour <integer greater than 7> <foreground colour> <background colour> <bold >

 For a list of colour names, see the list of format codes in the
 Language Definitions section, below.
 <format codes> can be any subset of:
     normal black red green brown blue magenta cyan white standout underline inverse blink dim bold
 With this colour command you can set a different background colour than the
 terminal default.


default blk on light yellow
colour 32 black 195 bold

#double quote string red on aqua
colour 14 196 14 bold

Language Definitions

 Language Definitions  -  For syntax highlighting and indentation.

 lang.<language>.tokens.<any name>[.case_insensitive] <regexp with one pair of parentheses identifying the token>
 lang.<language>.tokens.<any name>.format <format codes>
 <format codes> can be any subset of:
     normal black red green brown blue magenta cyan white standout underline inverse blink dim bold

An example helps:

lang.?????      ;prefix  is a language file command
lang.dhf.????  ; says this is for .dhf files
lang.dhf.tokens.keys <(.+?)>  ;Looks for things like <TAB>
lang.dhf.tokens.keys.format 14 ;This says to use the 14 color definition
;(see colors section above - which says this is red on aqua in bold)

The numbers of colour pairs (as defined by the configuration command "colour" [see above])  can also be used as format codes.


 indent.roundup: If a line's indentation is not evenly divisible by the  indent.size, and indent.roundup is true, then the non-integer indentation
 level will be rounded up.  If indent.roundup is false, then it will be  rounded down.

 e.g. given an indent.size of 4, and a line with 6 spaces, indent.roundup
 true will make Diakonos consider the line indented 2 levels.  With
 indent.roundup false, it will be considered indented 1 level.

 The filemask can also be used to specify specific filenames which  don't conform to the standard extensions for a language.



Column-markers

# Column Markers

You can define column markers using the view.column_markers.* settings.  You
might use a column marker as a visual cue to help you not exceed a certain line
length.  You can set up as many column markers as you like.

## Example of a column marker

view.column_markers.margin.column 80
view.column_markers.margin.format 9

Adding these lines to your configuration would set up a column marker named
'margin'.  The name 'margin' is arbitrary; use whatever string you want for your
markers.  The 'margin' marker would highlight the 80th column using the format
code 9 (white on red in the default 16-colour configuration).

config

# Configuring Diakonos

## Personal configuration

Press <F12> to open your personal Diakonos configuration file, which is
~/.diakonos/diakonos.conf .  Read the comments in the file for information on
the individual settings.  Edit the file as you like.  When you save the file,
your changes take effect immediately in your current session.

Your personal configuration remains separate from the system-wide
configuration, located elsewhere.  Your personal settings take precedence over
system configuration where there is any difference or discrepancy.

## Saving configuration changes

Since configuring Diakonos is nothing but editing and saving the configuration
file, to stop configuring, simply switch buffers or close the configuration
file (with <Ctrl-W>).

## Configuration file format

Each line in the configuration file has a setting identifier and the value of
the setting, for example:

lang.text.format.default white

The identifier and the value are separated by one or more spaces.
Previous versions of Diakonos used a semicolon to separate; this is still
permitted, but may not be in future versions.

Comments can be placed in the file by starting a line with an octothorpe
character (#).

## Including other configuration files

You can create and include custom configuration files which remain distinct
from your standard default configuration file.  You can place these files
wherever you like, but it is recommended to put them in ~/.diakonos.  Then,
place a line like this at the bottom of the default configuration file:

include ~/.diakonos/extra.conf

If a setting is specified again (whether in the same file, or an included
file), it overrides the previous setting given higher up in the configuration
file(s).  Note that editing and saving custom configuration files which reside
outside of ~/.diakonos will not cause the changes to be automatically loaded
like they are with configuration files in ~/.diakonos.  To reload all
configuration files, quit and restart Diakonos, or press <Shift-F2> and type
"load_configuration".

## Configuration inheritance

Configuration settings can be inherited (cascaded).  Simply use an equals sign
(=) to set one setting to the value of another.

one.setting = another.setting

For an example, have a look at the Ruby language definition in the default
configuration file.  See how the shared settings are defined earlier in the
file, then used later on in the Ruby language configuration.

Inheritance will work for any setting, not just formatting.  The important
thing to remember is that Diakonos will parse configuration files top to
bottom, and visit each included file in the order the include directives are
encountered, with a depth-first strategy.  So you should define ancestor
settings before descendant settings.


Tags: diakonos config configure configuration configuring setup setting settings options option preferences

Cursor-Stack

# The Cursor Stack

The cursor stack is just like the Back and Forward functionality of your web
browser.  Diakonos semi-intelligently keeps track of the places where you do
work.  Using the cursorReturn command (<Ctrl-J>), you can return to previous
work areas.  Use <Ctrl-L> to go forward through the stack.

Here is an example of a common scenario:

1. you are editing in some location
2. you need to examine some other code (such as the definition of a method)
   elsewhere in the file
3. you page through the file, or search for text
4. after examining the code there, possibly copying material to the clipboard,
5. you press <Ctrl-J> and return to the exact location you were working in prior
   to your search


Tags: cursor stack move movement jump jumping moving remember previous position next back forward browser web bookmark bookmarks bookmarking webbrowser page file search return clipboard

Delete

# Deleting Text

## Common Deletion

Diakonos behaves just as you would expect when you press <Delete> or
<Backspace>; they delete the current and previous character respectively.

When text is selected, pressing <Delete> or <Backspace> will delete the
selected text.  Selecting text and then typing (or pasting) will also delete
the selected text (and then process what was typed or pasted).

## Deleting a Line

<Ctrl-K> will delete the current line, regardless of where on the line the
cursor is.

## Deleting Part of a Line

<Ctrl-Alt-K> will delete all the text from the cursor to the end of the current
line.

You can delete from the cursor up to a certain character by pressing <Ctrl-D-T>
(mnemonic: "Delete Till").  Diakonos will prompt you for a character, and then
delete everything from the cursor to the first instance of that character to
the right of the cursor.  For example, pressing <Ctrl-D-T-.> will delete up to
the next period.

You can delete all text in between a pair of the same character by pressing
<Ctrl-D-I> (mnemonic: "Delete Inside" or "Delete In Between").  Diakonos will
prompt you for a character, and then delete between the closest pair of that
character.  For example, situating the cursor inside a string inside some
source code, then pressing <Ctrl-D-I-"> will deleted the contents of the
string.  That is:

  my_string = "this is a string"

would become

  my_string = ""

Tags: delete deleting text deletion remove removal removing line

Extensions

# Extending Diakonos

Diakonos has a simple but powerful extension system.  Extensions are written in
Ruby (http://www.ruby-lang.org).


## Installing and Uninstalling Extensions

### Unpack/Clone

Extensions are installed in ~/.diakonos/extensions/.  Each extension should
have its own subdirectory under there.  Extension tarballs or repository clones
should be unpacked or cloned under there.

### Load

Once an extension is installed into ~/.diakonos/extensions/, you activate it
by adding a command to your configuration:

  load_extension name_of_the_extension

Diakonos will load extensions at startup, and will reload extensions whenever
the Diakonos configuration is updated.

### Unload

To deactivate an extension, simply remove (or comment out) all load_extension
directives from your configuration which load the extension.

### Uninstall

Extensions can be removed cleanly by deleting the extension's subdirectory out
of ~/.diakonos/extensions/.


## Extension Format

### Directory Structure

A Diakonos extension consists of a directory (or directory tree) of files:

  info.yaml
  *.conf
  *.rb

The simplest extension will have nothing but an info.yaml file.  This "empty"
extension will do nothing useful, though, of course.

Diakonos will parse and load all configuration files (*.conf) in the root of
the extension's directory.  All Ruby files (*.rb) found in the extension's
directory, or any subdirectory underneath it, are loaded and executed at
startup, and on configuration change.  Typically, an extension will only have
one configuration file, but it may have any number of Ruby files.

### Information File

To be valid, an extension must have a properly-formatted info.yaml file.  As
the filename suggests, info.yaml is a YAML file.  It consists of several keys,
and a few arrays, described below.

The diakonos key is required.  It is strongly recommended to have name, uris
and version keys.  The other keys are optional.

name: (recommended) The name of the extension.

description: (optional) A brief, one-line description of the extension.

author: (optional) Several subkeys provide information about the extension's author.
    name: The author's name or nickname.
    email: The author's email address.
    uri: A URI associated with the author.  This might be a homepage, or a blog.

version: (recommended) The version of the extension.

uris: (recommended)
    homepage: The website giving more information about the extension.
    repository: The URI of the extension's source code repository.  This should
      be a URI that can be used with version control software, and so might
      begin with "svn://" or "git://".

licence: (optional) The licence of the extension's source code.

requirements: (required) Several subkeys tell diakonos about what versions of
      things the extension works with.
    diakonos: (required) Several subkeys tell Diakonos about what versions of
          Diakonos the extension works with.
        minimum: The minimum version of Diakonos required for the extension to
          function properly.
        tested: A list of Diakonos versions which the extension is known to run
          under.
    gems: (optional) If the extension needs any gems to function, they should be
          listed here, with their minimum and tested versions given.

notes: (optional) Longer text describing the extension, its capabilities and
  its usage.  For multiple paragraphs, use the YAML syntax "notes: >", and
  indent the paragraphs to the same level.


## Extension Code

Extension code is any valid Ruby code.  See
  http://rdoc.info/projects/Pistos/diakonos
for source code documentation for Diakonos, and
  http://github.com/Pistos/diakonos/tree/master/extensions/dk-hello-world
for an example of an extension.

To have code execute on keypress, define a method in the Diakonos::Functions
module.  All methods in Diakonos::Functions are exposed to the keying system,
any method name can be referred to by the key directive in configuration files.

Methods of Diakonos::Functions are run within the context of the main
::Diakonos::Diakonos object.  In this context, you get access to all of the
instance variables.  Some variables of note:

  @current_buffer
  @diakonos_home   String containing the user's Diakonos dir (usually ~/.diakonos)
  @buffers         A BufferHash holding all the open buffers
  @status_vars
  @settings        A Hash containing all settings from all configuration files

When not within a method of Diakonos::Functions, main ::Diakonos::Diakonos
object can be referred to by using the global variable $diakonos.


Tags: script scripts scripting program programming language ruby extend extension extensions plugin plug-in plugins plug-ins addon addons add-on add-ons package packages format layout structure load loading unload unloading activate deactivate activating deactivating install installing installation

File-type

# File Type

The language (or type) of a file is shown in the status bar between
parentheses.  For example, the file type of this help document is "dhf".

Diakonos can usually guess a file's language correctly.  To do so, it
considers the filename and, if present, the "bang" line at the top of the
file.  The bang line takes precedence over the filename.

If Diakonos was wrong in its automatic determination of the file type, you can
force it to assume a certain file type by pressing <Alt-Shift-T> and typing in
the file type (e.g. java, ruby, html, xml, and so on).

The configuration settings (available by pressing <F12>) which affect
Diakonos' guessing are a language's filemask and bangmask settings.  These
settings are regular expressions.  For example:

lang.perl.filemask \.(?:pl|pm)$
lang.perl.bangmask perl

These configuration lines tell Diakonos to think a file is a Perl file if its
extension is .pl or .pm, or if the bang line has the word "perl" in it.

Tags: file files lang language languages programming type mode types modes

Key Mapping

# Key Mapping

## Executive Summary

<Alt-Shift-K>       key mapping exploration mode
<Alt-K>             key printing mode
<F12>               edit configuration file

Example configuration line:

key alt+b alt+!     addNamedBookmark 1

## Customizing the Diakonos key mapping

Diakonos' key mapping is extremely customizable.  You can map any Diakonos
function to nearly any key chord or key sequence (as long as your terminal
can produce the chord or sequence).

To change the key mapping for a function, or to change the function mapped to
a key mapping, you need to know what function you want performed, and what key
chord or sequence you want to press in order to perform that function.
Diakonos can help you determine these.

## What does this key do?

Press <Alt-Shift-K> and Diakonos will enter a special mode.  In this mode, any
key chord or sequence you press will make Diakonos report the function (and
any function arguments) which are mapped to what you pressed.  Try it now!
When you are finished exploring, press <Enter> to exit the key mapping
exploration mode.

Here is an example of what the key exploration mode might display.  This is
seen when you query what <Ctrl-S> does:

  ctrl+s  ->  saveFile(  )

This indicates that the keychord (ctrl+s) executes the saveFile function.  The
empty parentheses tell us that the saveFile function is not given any
arguments.

It is worth noting that some keys or chords may have strange-looking key
sequences, depending on your terminal.  For example, the <Home> key may not be
a single keycode, but rather a sequence, like "esc [ 1 ~".  There's nothing
wrong with this, but you should be aware of it when customizing your keyboard
layout.

## What do I need to press to _____?

One way to determine the current key mapping for a given feature or function
is to press <F1> to enter the help system, and then type some search keywords
to search the help system for documentation describing the feature.  All help
documents have relevant key mappings described.  Once you determine the key
mapping for the function you're interested in, use <Alt-Shift-K> to get the
actual name of the function.

Not all features may be documented at this time, though.  If you can't find
the key mapping for a function, the alternative is to open the configuration
file (with <F12>) and move down to the key configuration section.  This
section has many lines starting with the word "key", such as these lines:

key left;cursorLeft
key esc [ D;cursorLeft
key right;cursorRight
key esc [ C;cursorRight

## How do I specify a keychord or sequence?

Diakonos has another built-in function to help you in mapping keys.  Press
<Alt-K>, and Diakonos enters a key printing mode.  In this mode, you can
press any sequence of keystrokes or key chords, and Diakonos will display
what string to use in the configuration file.  Press <Enter> when you have
completed your sequence.

Here are a couple of examples.

If you press <Alt-K> and then <Ctrl-D> and <Enter>, it will print the string
"ctrl+d" into the current buffer.

If you press <Alt-K> and then <Alt-L> and <Home>, and press <Enter>, it will
print something like "esc l esc [ 1 ~" into the current buffer (the exact
string may vary depending on your terminal).  Use these strings to configure
Diakonos' key mapping (see below).

## Setting a key mapping

Once you know the name of the function you want performed and the string for
the key mapping, press <F12> to edit the configuration file.  Add a new key
mapping line to the key configuration area.  It doesn't matter exactly where,
but you should try to keep your configuration file organized to make it easier
to adjust in the future.  A key mapping line looks like this:

key alt+b alt+!     addNamedBookmark 1

It has these components:
- the "key" configuration command
- one or more keystrokes or keychords, in order ("alt+b alt+!")
- two or more spaces
- the Diakonos function ("addNamedBookmark")
- any arguments to the function, separated by commas ("1")

For example, suppose you wanted to make the keychord <Alt-L> drop to the shell
and execute 'ls' and show the results.  You would set this up with a new line
in the configuration file.  Type 'key' and space:

key

then press <Alt-K>, <Alt-L> and <Enter> to print out the string Diakonos
expects for <Alt-L>. Your line will then be:

key esc l

Then add a few spaces, and the shell command.  Your final line will be:

key esc l     shell "ls"

Press <Ctrl-S> to save the configuration, and your new key mapping will be
ready for use.  Try it!

## Unsetting a key mapping

If other configuration files (such as the system-wide one) are introducing a
key mapping that you want to unmap, simply configure the key to have no
function.  For example:

key ctrl+g

Tags: key keys keyboard map mapping layout change config configure set different alternate function feature command unset unmap override shortcut shortcuts short cuts

Line Numbers

# Line Numbers

Diakonos indicates on the status line (at the bottom right of the screen) the
current line and column that the cursor is over.  For example:

  L  6/  8 C13

means that the cursor is on the 13th column of the 6th line of a file which is
8 lines long.

## Showing line numbers

Default keychord <Alt-Shift-L> can be used to toggle line numbering on and
off.  Line numbers appear in a left-side margin.  Enable line numbering
permanently by setting view.line_numbers to true in your config.  Set
view.line_numbers.width to the number of columns to use for the line numbering
margin.  view.line_numbers.number_format is the setting to use to define a
sprintf format for the line numbers.  Set the colour and brightness with
view.line_numbers.format.


Tags: line number numbers numbering sprintf format colour color config configuration set setting settings toggle show margin

Macros

# Macro Recording and Playback

Diakonos has a macro system that allows you to record nearly any series of
commands and play them back.  At the same time, advanced users may wish to
consider employing Diakonos' powerful Ruby scripting capabilities to leverage
their programming knowledge to manipulate text more directly.

## Recording a Macro

If necessary, move the cursor to the desired place before beginning to record.
Press <Alt-M> to begin recording a macro.  Type any sequence of keystrokes or
keychords.  When you are finished entering the sequence, press <Alt-M> again
to stop recording.

## Playing the Recorded Macro

After a macro is recorded, move the cursor to the spot where you wish to begin
executing the macro.  Press <F4> to play the recorded macro.

## Saving Macros

Diakonos currently has no facility to save macros for future playback.  If you
want this feature in Diakonos, please visit the Diakonos technical support
channel and voice your request.


Tags: macro macros record recording play playback playing script scripting key keys keystroke keystrokes command commands function functions

New File

# Creating a New File

Press <Ctrl-N> to open a new, empty buffer.  The buffer will have no filename
associated with it until it is saved.

Tags: create creating open opening new file files

Open File

# Opening a File

Press <Ctrl-O> to open a file in Diakonos.  You will be presented with a prompt
in which you can type in the path to the file you wish to open.  When entering
a file path, you can use the <Tab> key to complete partial paths, just as you
can in your shell.  Additionally, if a list of files is presented after
tab-completion, you can use the <Up> and <Down> arrow keys to select one of the
listed files, and press <Enter> to open the selected file.

You can also open files by passing one or more filenames as arguments to the
"diakonos" command.  For example:

  diakonos ~/.diakonos/diakonos.conf

Diakonos can also open all files in a directory tree matching a regular
expression, using the -m command line option:

  cd ~/project
  diakonos -m some_method_name

Tags: open opening file files new existing dir directory regex regexes regexen regexp regexps regular expression expressions match matching grep

Quit

# Quitting Diakonos

To quit (close) the Diakonos text editor, press <Ctrl-Q>.  If any open files
have unsaved modifications, you will be prompted about what further action you
would like to take.

Tags: quit quitting exit exitting leave leaving close closing

Resizing

# Resizing Diakonos

In most cases, Diakonos can automatically detect when the wrapping terminal or
console changes size (due to a window resize or font change), and redraw
itself.

On some systems, however, Diakonos cannot handle a terminal resize.  If your
system exhibits problems after resizing, try this bash command before starting
Diakonos:

  shopt -s checkwinsize

Read more about the shopt built-in command here:

  http://linux.about.com/library/cmd/blcmdl1_shopt.htm

Pressing <Ctrl-Alt-R> will force Diakonos to redraw itself.

Tags: bash size resize resizing window terminal console change draw redraw problem problems troubleshoot troubleshooting issue issues

Ruby

# Ruby Compatibility

## Ruby 1.9

Usage to date has shown that Diakonos is fully compatible with Ruby 1.9.
There are no known problems.  If you encounter any issues when running
Diakonos under Ruby 1.9, please report them in IRC or with the issue tracker.

## Ruby 1.8

Support for Ruby 1.8 was dropped as of Diakonos version 0.8.8.
0.8.9 is the last version of Diakonos to somewhat run under Ruby 1.8.
0.8.10+ are known not to run at all under Ruby 1.8.



Tags: ruby 1.9 1.8 19 18 compatible compatibility problems issues version


Save File

# Saving a File Press to save the current file. Press to save the current file under a different filename or path. The strip_trailing_whitespace_on_save setting controls whether trailing whitespace is removed from the lines of a file when a buffer is saved. The default configuration has this setting turned on. Tags: save saving file filename as save-as trailing white space whitespace

Scripting

# Scripting Diakonos

Diakonos has several features and mechanisms that allow you to manipulate it
using Ruby, a beautiful yet powerful programming language
(http://www.ruby-lang.org).

## Working with Selected Text

Select the text you wish to operate on (by pressing <Ctrl-space> and moving
the cursor).  You can then work with the text in one of three ways:

1. as a contiguous string of characters
2. iterating over each line
3. as an array of lines

### As a String

Press <Shift-F7> to work with the text as if it were one big string (multiple
for Ruby code that uses the variable "str".  For example, entering

  str.upcase

will convert the selected text to uppercase.

### Iterating Over Each Line

Press <F7> to iterate over each line of selected text.  You will be prompted
for Ruby code which will act as the body of a Ruby block which uses the
variable "line" and evaluates to a String.  For example:

  line.strip.squeeze( ' ' )

will strip off whitespace from the beginning and end of each line and then
collapse all consecutive sequences of spaces into single spaces.

### As an Array of Lines

Press <Alt-F7> to work with the text as if it were an Array of lines.  You
will be prompted for Ruby code which operates on the array variable "lines".
For example:

  lines.find_all { |l| /foo/ === l }

will replace the selected lines with the lines that match the regular expression
/foo/.

  lines.sort

will sort the selected lines.

## Startup Scripts

Any file placed in ~/.diakonos/scripts/ will be require-d (as Ruby code) when
Diakonos starts up.  Any valid Ruby code can be placed there.  Advanced users
can even manipulate Diakonos itself by referencing the $diakonos global
variable.

After the startup scripts are require-d, Diakonos evaluates any Ruby code given
with the -e command line argument.  Here is an example of using the -e argument
to initiate a search on startup:

  diakonos -e 'find "search expression", case_sensitive: true' filename

See also the documentation on extensions.

## Hooks

Diakonos provides a means for you to execute arbitrary Ruby code when certain
events occur.  In other words, you can "hook" code onto the events.  At
present, the following hooks are available:

  :after_buffer_switch
  :after_open
  :after_save
  :after_startup

To hook onto one of these events, place code into the ~/.diakonos/scripts/
directory.  Example hook code can be seen at

  http://github.com/Pistos/dk-git/blob/master/git-branch.rb

Your code should create a Proc object (possibly with a block parameter,
depending on the hook), and then register it with the following syntax:

  $diakonos.register_proc( my_proc, :after_open )

The register_proc method takes an optional third parameter: an integer
indicating the relative priority for your Proc.  Lower numbers are used for
greater priority (like the UNIX "niceness" level).  Procs registered for the
same hook are executed in order of priority.

Tags: script scripts scripting program programming language ruby select selected text manipulate manipulating operate operating change changing work working line lines adjust adjusting hook hooks hooking proc procedure block trigger triggers method function functions start up startup

Shell

# External Programs

Diakonos has several functions available that you can map to keys in order to
execute external programs, scripts and applications: shell, execute and
pasteShellResult. Each one takes an optional string argument, which is the
shell command to execute.  If no argument is given, the user is prompted for
the command to execute.

shell will run the command and show the results in a new buffer.  execute will
run the command, and allow you to interact with it, but discard the results.
pasteShellResult will paste the command's results at the current cursor
location.

The shell command also takes an optional second parameter which lets you
specify the file to which the shell results are to be written.

Press <F2> to specify an arbitrary command to run with 'shell'.
Press <F8> to specify an arbitrary command to run with 'execute'.

## Shell Variables

The command strings to these commands given can contain any of the following
variables:

$f  the current buffer's filepath
$d  the current buffer's directory
$F  all current buffer filepaths, space-separated
$i  a string obtained from user input
$c  temp file containing current clipboard text
$k  temp file containing current klipper (KDE clipboard) text
$s  temp file containing currently selected text

## Examples

The following examples are found in the default configuration file.


key ctrl+alt+c    shell "ruby -c $f"

Press <Ctrl-Alt-C> to check the Ruby syntax of the current buffer.


key esc d         shell "diff -U 5 -w -b $c $s", "clipboard.diff"

Press <Alt-D> to diff the current clipboard text against the currently selected
text, and write the result to a file named clipboard.diff.


key esc l         execute "aspell check $f"

Press <Alt-L> to interactively spell check the current file with the aspell
program.  (This keychord is not active in the default configuration.)


key f9            shell "cd $d; git diff --ignore-space-change -- $f", 'git.diff'

Press <F9> to see all changes made to the current buffer that have not been
committed to the git repository yet.

Tags: shell system exec execute spawn spawning executing shelling out external program programs application app apps applications variable variables substitute substitution spell spelling check git diff difference

Speed

# Speeding Up Diakonos

Diakonos is known to run a little slower on some less-powerful systems.  Here
are some of the things you can do to speed up Diakonos.  Each one involves a
tradeoff between editor features and speed.  You don't need to enact them all,
just do whatever you need or can sacrifice.

- Turn off the context line ("content.visible false" in the config file).

- After a successful find, unhighlight the found items, if you don't need to
see them any more (Ctrl-Alt-U by default).

- Turn off syntax highlighting by specifying a file type of "text"
(Alt-Shift-T to specify the type).  Alternatively, just reduce the number or
complexity of highlight definitions in the language you are using.  More
highlight definitions means more work for Diakonos during display.

- If you are using a graphical desktop (such as KDE or Gnome), change the size
of the window to something smaller, since this will mean fewer characters for
Diakonos to redraw.  Equivalently, for raw console (TTY) users, try a larger
font size for a similar effect.

Tags: slow diakonos speed speed-up speedup fast faster draw redraw screen font context line quick quicker syntax highlight highlighting

Support

# Support

You can chat about Diakonos in the ##pistos channel of the Libera IRC
network.

Go to the IRC channel for technical support, or to give feedback and commentary
about Diakonos.  It's the place go for bug reports, feature requests and tech
support.  Even if Pistos is not around, he will eventually read anything you
have to say.

If IRC is not your thing, you can file bug reports at the issue tracker:

  https://github.com/Pistos/diakonos/issues

Tags: help support technical tech contact email e-mail info information chat irc channel pistos author creator

Switch Buffers

# Switching Buffers

To switch between buffers, press Alt-number, with the number corresponding to
the index of the buffer you wish to change to.  For example, <Alt-1> will
switch to the first buffer, <Alt-3> will switch to the third buffer, and so on.

You can also browse through the buffers by pressing <Alt-minus> and <Alt-=>.

To bring up a list of the currently open files, press <Ctrl-Alt-B>.  There are
two ways to select a buffer from this list: Either type the number or letter
shown in the left column corresponding to the file you wish to switch to, or
use the <Up> and <Down> arrow keys to select a buffer, and press <Enter> to
switch to it.

Tags: switch switching buffer buffers file files change between list current currently open

Tabs

# Tab Characters

## Indenting with tab characters instead of spaces

By default, Diakonos indents with spaces.

To insert a single tab character, press <Ctrl-T>.

To make Diakonos always indent with tab characters, look for the indent
settings for the language whose behaviour you wish to configure.  For example,
to change the indentation of Ruby, add the following line to your configuration
file (<F12>):

lang.ruby.indent.using_tabs true

## Changing the width of tab characters

The width of a tab character depends on the language of the file.  To change
the width for a specific language, change the tabsize setting for the
language.  For example, to change the tab size of Ruby files, open the
configuration file by pressing <F12>, and look for a line like this:

lang.ruby.tabsize 2

Then change the number 2 to whatever number you desire, such as 4.

## Converting tab characters

Diakonos can convert tabs to spaces when files are opened.  Set the
convert_tabs configuration option to true:

convert_tabs true

By default Diakonos does not do this.

Tags: tab tabs indent indenting indentation insert space spaces whitespace char character characters width size number

Undo

# Undoing

Use <Ctrl-Z> to undo one or more of the most recent changes you've made to the
current file.  Each file has its own undo history.

Use <Ctrl-Y> to redo one or more changes that you've undone.


Tags: undo undoing mistake back revert redo

Uninstall

# Uninstalling Diakonos

To uninstall Diakonos, simply run diakonos with an --uninstall switch:

  diakonos --uninstall

Diakonos will list all the files and directories that will be removed from your
system, and prompt you for confirmation.  Diakonos does not install hidden
files that are not shown to you.

The only other Diakonos-related files on your system will be under your home
directory, inside ~/.diakonos . These are not uninstalled, to allow you to
upgrade Diakonos and preserve your settings and customizations.  The
~/.diakonos directory can be removed manually, or even edited if you are an
advanced user.


Tags: install installing installation uninstall uninstalling uninstallation remove removal removing

Welcome

# Welcome to Diakonos!

Hello, and welcome to Diakonos!  My name is Pistos; I am the author of Diakonos,
and I would like to thank you for trying the Diakonos text editor.

I have crafted Diakonos with ease of use in mind, so I hope you find it the
most easy-to-use console text editor available for Linux.  If you have any
suggestions, questions or comments, please share your thoughts in the ##pistos
channel of the Libera IRC network.

## Getting Started

Press <F1> at any time to activate Diakonos' interactive help system.

## Gnome Terminal

Gnome Terminal by default has several keyboard shortcuts which conflict with
Diakonos.  For a smoother Diakonos experience, you should disable as many of
these as you are comfortable with.  To edit Gnome Terminal's keyboard
shortcuts, go to the Edit menu, then select Keyboard Shortcuts.  Double click
a shortcut and press Backspace to disable it; repeat for each shortcut you
wish to disable.

## Removing the Welcome Message

To stop this welcome message from appearing, edit the configuration file (by
pressing <F12>), add the line "suppress_welcome true", and press <Ctrl-S> to
save your change.



Tags: diakonos welcome intro introduction getting started starting new newb newbie remove message

Word Wrap

# Word Wrap

Press <Alt-W> and Diakonos will perform basic word wrapping of the paragraph
under the cursor.  Paragraphs are considered to be delineated by empty lines
before and after.

The wrap_margin setting of a language controls the column at which word
wrapping will occur.  For example, to change the margin for text files, set
this setting:

lang.text.wrap_margin   80

where 80 is the maximum line length allowed.

Diakonos does not have any facility to do soft wrapping.

Tags: word wrap wrapping hard soft cr carriage return paragraph format formatting margin margins column line length conf config configure configuring set setting settings

Top Page wiki Index

Email

(C) Copyright 1994-2023
All trademarks are the property of their respective owners.