IT-Edit (Integrated Terminal Editor)

_images/IT-Edit_icon1.png

Files

You can start IT-Edit from a terminal with a space separated files list, as arguments which will be opened in the editor at start.

To know for files mamaging:

  • Open a new empty file use the menu item, the button or the shortcut: Ctrl + n.
  • Open a file by selecting it with a file selector, use the menu item, the button or the shortcut: Ctrl + o.
  • You can open a recent file by selecting it in the list from the menu item.
  • Save the current editor content use the menu item, the button or the shortcut: Ctrl + s.
  • Save all open files use the menu item, the button or the shortcut: Ctrl + Maj + S.

Edition

To know about edition:

  • Undo use the contextual menu or the shortcut: Ctrl + z.

  • Redo use the contextual menu or the shortcut: Ctrl + Maj + Z.

    NOTE: The menu items from Undo and Redo doesn’t not work well.

  • Cut use the contextual menu, the menu item, the button or the shortcut: Ctrl + x.

  • Copy use the contextual menu, the menu item, the button or the shortcut: Ctrl + c.

  • Paste use the contextual menu, the menu item, the button or the shortcut: Ctrl + v.

  • Duplicate the selection or the line at cursor position, use the menu item, the button or the shortcut: Ctrl + d.

Edition buttons images

Cut button image:

_images/edit-cut1.png

Copy button image:

_images/edit-copy1.png

Paste button image:

_images/edit-paste1.png

Duplicate button image:

_images/distribute-vertical-bottom1.png

Editor

  • Go to line number use the menu item, the button or the shortcut: Ctrl + g.

    Enter an valid line number and press Enter or the Apply button to move the editor to the wanted line, which will be highlight.

  • Search and replace functionnality.

    You can show | hide the search and replace bar by using the toggle button.

    The search and replace bar has folowing functionnalities:

    • Search button: this will highlight all the matching occurence from the search term and moving the editor to the first occurence position.

    • Next button: highlight the next matching occurrence from the search term.

      Pressing Enter wenn the search entry field has the focus has the same effect.

      The search will start at the beginning of the file per default.

      If you select some text with the mouse and use the shortcut Ctrl + f or Ctrl + r.

      The search field will contains the selected text as search term and the search will start at your selection.

    • Previous button: highlight the previous matching occurence from the serach term.

      The search will start at the end of the file per default.

      If you select some text with the mouse and use the shortcut Ctrl + f or Ctrl + r.

      The search field will contains the selected text as search term and the search will start at your selection.

    • Replace button: replace the current matching occurence, which is highlight, with the content of the replace field.

      NOTE: If this don’t work simply hit the Next or Previous button, this occur if you never make a search before: a search must be done before replacing.

    • Replace all button: replace all the matching occurrence in the current file.

      NOTE: If this don’t work simply hit the search button, this occur if you never make a search before: a search must be done before replacing.

    • Mode: You can select how your search term(s) will be interpreted.

      • Raw text: all search terms matching.
      • Word boundary: The search term must be a complete word, not a part but an variable with separators like underscores or points will work too.
      • Regular expression: Perl compatible regular expression (REGEX).
    • Close button: hide the search and replace bar and clear the highlight.

    NOTE: if you select some text with the mouse and use the Ctrl + f or Ctrl + r shortcut.

    • The search and replace bar will be show.
    • The search field will be filled with your selection.
    • The search will begin at your selection position if oy hit the Next or Previous button.

Actions

  • Terminals show | hide: use the menu item, the toggle button or the shortcut: Ctrl + t.

  • Command execution: use the menu item, the Cmd button or the shortcut: Ctrl + e.

    This will display a little toplevel in which you can enter a command.

    Then press the Enter key or the Apply button to execute the command in a terminal include in a toplevel window (so you can resize, minimize, maximize and close the window).

    NOTE: The command is execute with your default shell, if it does not support the ‘-c’ option, this will fail.

    After the execution from the command the toplevel terminal is yours so can continue to enter commands and use it.

  • File Handler: use the menuitem or the shortcut: Ctrl + h.

    For using this features you must register files from the Files handler manager tab interface reachable through the settings->Configure program menu item.

    For registering a file you must give it a title which will appears as the button text in the File Handler window and selecting the corresponding file.

    Then wenn you press the button in the File Handler window, the file will be launched with the default application for this filetype.

    This features was thinking for fast access to offline html documenation but it’s being expanded to any filetype, so you can consult pdf documenation too, but not only, this features can be use for any use you want.

    The registered files can be removed from the File handler list through the same interface with which you add it.

  • Application launcher: use the menu item or the shortcut: Ctrl + a.

    This will display an application chooser. By selecting an application you will launch it.

Settings

  • Syntax highlight: use the menu item.

    To set the syntax highlight on, on the current edited text from the supported language.

  • Editor schemes: use the menu item.

    To set the appearance from the text editor.

    Currently they are 8 differents schemes available:

    • Classic.
    • Cobalt.
    • Dark.
    • Kate (default).
    • Oblivion.
    • Solarized-dark.
    • Solarized-light.
    • Tango.

    Each time you change the scheme your choice is registered so that you don’t have to change it every time you start IT-Edit.

    NOTE: The application use a personnal set of schemes files: the set from the latest version from the gtksourceview-3.0 library.

    Because the schemes files set available from my packet manager is not the latest version from the gtksourceview-3.0 library and they are more schemes available in the latest version.

    This mean if the gtksourceview-3.0 library add new schemes the application will not adapt to provide it. But i maybe will fix this in the future.

  • Configure program: use the menuitem.

    To access to the program configuration window which is divide into 3 part:

    • Editor settings:

      • Font (Monospace 10 per default).
      • Display lines numbers (Enabled per default).
      • Display TABS characters (Enabled per default).
      • Use auto-indent (Enabled per default).
      • Indent width (2 per default).
      • Use spaces instead of TABS (Enabled per default).
      • TABS width (2 per default).
      • Create a backup file by saving (Enabled per default).
    • Terminal settings:

      • Font (Monospace 11 per default).
      • Cursor shape (Block per default).
      • Background color (Black per default).
      • Foreground color (White per default).
      • Use an image as background (Enabled per default).
      • Use a texture as background (Enabled per default).
      • 20 textures available.
      • Use a personnal image (Disabled per default).
    • File handler manager:

      Here you can add and remove files for the File handler feature.

Shortcuts memo

Shortcut functionnality Mnemonic
Ctrl + n New file n = new
Ctrl + o Open file o = open
Ctrl + s Save file s = save
Ctrl + Maj + S Save all files S = Save
Ctrl + z Undo None
Ctrl + Maj + Z Redo None
Ctrl + f Search f = find
Ctrl + r Replace r = replace
Ctrl + g Go to line number g = go to
Ctrl + x Cut None
Ctrl + c Copy c = copy
Ctrl + v Paste None
Ctrl + d Duplicate text d = duplicate
Ctrl + e Execute command e = execute
Ctrl + t Show | Hide terminal t = terminal
Ctrl + h File handler h = handler
Ctrl + a Application launcher a = application

Knows bugs

IT-Edit cannot open Makefile.am files, i think it comes from the libgtksourceview library.

If you try to open a Makefile.am file the program will crash, but you can open, edit and save Makefile files without problems.

Motivation for writing IT-Edit (the Terminal Integrated Editor)

They are 2 sort of programmer in their habits to writing programs:

  • They who use an IDE with full integrated functionnalities.
  • They who use an text editor to write their programms and a terminal to compile, debug or launch them and other tools separately.

Because i’am an programmer from the second category and because i remark that i use an additional web client for consulting html offline documentation most of the time and sometimes even other tools.

I decide to write my own text editor program which provide me all the functionnalities that i need to get a developpment environement fully adapt to my requirement.

The little history from IT-Edit

IT-Edit provide a text editor with syntax highlight, line numbering and with the basics text editing functionnalities:

  • Cut, Copy Paste.
  • Duplicate a line or the selected text.
  • Undo/Redo functionnalities.
  • Search and replace functionnalities.
  • Jump to the given line number.

And an files managing interface for:

  • Open a new empty file.
  • Open the file you want.
  • Open an recent file.
  • Save the editor content.
  • Save the editor content as the filename you want.
  • Save all open files.

IT-Edit provide 2 terminals in the same window as the editor which can easy show, hidden and resized.

For executing commands like compilation, debugging, launching direct from the editor.


I intend to implement an manpage reading interface, in an toplevel terminal window (so it can be resize, minimize, maximize and closed),

but i remark by implementing it that i restrict the command to execute the “man [section] page” command.

So i decide to provide the same functionnality but without restricting it to the manpage displaying, to expand it to execute any command you want in an toplevel terminal.


I intend to launch registered offline html documentation in a toplevel window,

but i remark by implementing it that i restrict it to offline html pages.

So i decide to provide the same functionnality with registering any file you like.

The registered files are launch with the default program for this filetype.

Additionnaly i implement an application launcher to launch the application you want direct from the editor.

[!] All this functionnalities are available through shortcuts so that you get fast access to it.

Notes for C programmers

I don’t have implement the usual reload file functionnality present in editors:

To display the possiblity to reload the file content if the file was modified by another application.

My wish for programmers who are interest in the IT-Edit project.

My wish is that you implement the functionnalities you use in your favorite editor which are not present in the actual implementation.

So that you get an developpment environement fully adapt to your requirement even based on the IT-Edit implementation, and so improve the IT-Edit editor.

In the spirit of the 4 foundations of free-softwares.

  • The freedom to use the software for the purpose you want.
  • The freedom to redistribute the software to help your neighbor.
  • The freedom to modify the software (This imply that the cource code must be available).
  • The freedom to redistribute your modify version from the software (This imply that the cource code must be available).

Finally the biggest problem was and maybe still the search and replace functionnality which have crash the application several times during development in certains circumstances.


I have make some assertions functionnalities:

The search test functionnality, must be done with 3 fixed files and some others, for which i create an array of 5 words:

  • 3 matching words contains in the 3 files.
  • one empty string.
  • and a missmatch word which is not contains in the 3 files.

The test function select first randomly a widget from the array of the Search, Next and Previous widgets or not (the current widget still unchange).

Then select randomly a word from the 5 words array or not (The search term still unchange, you will sea why.) and copy it into the search entry widget,

then switch or not randomly from a notebook page to another.

And finally emit the clicked signal from the current selected widget.

This process is repeat 1024 * 5 times in a loop.

The Replace test functionnality work similar by adding the Replace and Replace all widget to the widgets array and

as search and or replace term: generate a 2 characters word (so it is easy to have some matches).

Else it work’s like the search test function and the process is repeat 1024 times.


If you want to sea the words highlight or replaced in actions simple compile the program with the preprocessor flags -DDEBUG and -DDEBUGBUT.

Add the required files to the editor and press the news buttons called Search debug or Replace debug to sea the effect...


Credits

Author:Eddie Bruggemann
Contact:<mrcyberfighter@gmail.com>
License:GPLv3.
corrector:Thank’s to Gerald Dumas for his hard rereading of the source code which permit the correction of some imperfections in the source code from IT-Edit.
bugfix:Thank’s to Mickaël S <mickael@jmsinfo.co> for his little bugfix with big effects and the trailing spaces auto-removing idea.

Thank’s to my beloved mother, my family and to the doctors.

Stay away from drugs: drugs destroy your brain and your life.