Fork me on GitHub

Djynn

Introduction

The name Djynn is a play on words - like the name Geany; both being oriental spirits of mythology, but with a 'y' instead of 'ie'/'i'. Since it isn't a one-function-plugin but rather a set of various functionality, "Plugin manager" or similar wasn't appropriate in naming the project.

The Djynn plugin project can be found at Launchpad.

Features

  1. Project Manager
  2. Sort Lines
  3. Comments
  4. Encoding
  5. Keybindings
  6. Configuration
  7. Install

Project Manager

Djynn adds a simple projectmanager that integrates with the built in project handler of Geany IDE.

The project manager inserts a page in the sidebar with a tree for the project files. Files can be read from a directory or added manually in each project, there can be any number of files but the manager is not designed for gigantic numbers of files; order files and folders in any way you like by dragging and dropping.

Any number of workspaces can be created, and each workspace may contain any number of projects. Each project is stored in a separate config-file, and if two workspaces creates two projects of the same name the same project is shared between workspaces. Projects also integrates with the built in Geany projects, and for every Djynn project a Geany project is created automatically also.

To make it easier working with many projects, a session handler has been added, and you can add more sessions in the menu. Each session maintains its open documents. When switching between sessions, all documents of the previous session are closed, and all documents of the new session are opened with the cursor at the stored position.

Create new Projects, Workspaces and Sessions in the Project->Project Manager menu:

Sort Lines

Lines can be sorted in various ways, ascending, descending and reverse line order. If there is a selection, only the selected lines are sorted, otherwise the entire document.

Comments

The commenting differs slightly from the built in commenting of Geany. It toggles line- and block-commenting, and add javadoc/doxygen comments. A function for stripping comments is available for a subset of Geany's supported filetypes.

Line comments are placed at the beginning of the line, block comments at the beginning and end of the selected text - or if no selection, at the position of the cursor.

Javadoc/Doxygen comments have three formats depending on the selected text:

  1. When the cursor is at a function definition, a comment is inserted in this format:
    /**
     * @param a 
     * @param b 
     * @return 
     */
    int foo(unsigned char *a,int *b) {
    
  2. When a block of lines are selected starting and ending with one or more blank lines, a group comment is inserted:
    /** @name 
     * @{ */
    int foo(unsigned char *a,int *b);
    void bar(int c,const char *b);
    /** @} */
    
    
  3. When one or more lines are selected not starting and ending with a blank line, indented line comments are inserted:
    void foo(int a);	//!< 
    void bar(int b);	//!< 
    

Encoding

Mark the text to convert, or the entire document will be encoded/decoded, and select format in the menu.

  1. Hexadecimal Encoding: Chars are converted to and from hexadecimal, so ' ' (space) becomes '20' and 'abc' becomes '616263'.
  2. Base58 Encoding: Convert text between base58.
  3. Base64 Encoding: Convert text between base64.
  4. C String Escape: Escape characters in text, e.g. newline is replaced by '\n' etc. Also unicode characters are replaced by '\uXXXX'.
  5. HTML Encoding: Replace HTML-entities, e.g. '&' is replaced by '&amp;'.
  6. URL Encoding: Format text for a URL.

Keybindings

Keybindings have been added to some of the features. To set keybindings, in the menu select: Edit->Preferences->Keybindings and scroll down the list to the section Djynn.

Configuration

Configure the plugin to your liking:


Install

Ubuntu: Install from Launchpad's PPA

Run these commands in a terminal:

sudo su
add-apt-repository ppa:per-lowgren/repo
apt-get update
apt-get install geany-plugin-djynn
exit

Build from sources

Djynn uses CMake, so you will need to install this, and you will of course need to install GTK+, minimum 2.6. To build and install Djynn, open a terminal and enter the following commands:

Only Linux has been tested, though compiling for Windows with MinGW should work fine - provided all dependencies meet.

sudo su
apt-get update && apt-get install cmake build-essential libgtk2.0-dev libglib2.0-dev gettext geany
bzr branch lp:~per-lowgren/djynn/trunk /tmp/djynn
mkdir /tmp/djynn/build && cd /tmp/djynn/build
cmake ..
make
sudo make install
cd ../.. && rm -rf djynn
exit

Restart Geany and you should be able to see Djynn in your Plugin Manager.


Please, report any bugs!

The Djynn plugin project can be found at Launchpad.