Download HbEdit, 03.05.2024 (v2.4-92): (Windows) (Ubuntu 18.04 64-bit) (Ubuntu 18.04 64-bit, gthwg) MAgent plugin Hbedit on Github |
HbEditConsole multiplatform text editor |
Hbedit is my attempt to make a perfect text editor. Perfect for me - everyone has their own ideas about the ideal. I am aware that even by limiting the task to my preferences, the ideal result is not achieved - that's why it is an ideal, it is always somewhere over the horizon. But to strive for it is necessary, and I am trying to do this.
The ideal editor should provide all the necessary functions, but not be overloaded with excess. It should combine the best features of the best editors, but this connection should not be eclectic. There must be a system, a harmonious connection of all parts, intuitive, logical interface.
Of course, it must be cross-platform. Must be flexible, customizable, should provide the ability to connect additional modules (plug-ins) for additional functionality.
As a basis was taken the editors that I usually use: Far's (Windows) and Midnight Commander's (Linux) built ib editors, and Vim. Of course, I never set a task to implement all Vim possibilities, or even most of them. This is too much work at first, and secondly, it is simply unnecessary. It is enough, in my opinion, to implement the main, most used functions - those that I use myself or guess someday use. And I wanted to expand the capabilities of the editing mode and, thereby, minimize switching from one mode to another.
- It can be used under Windows, Linux/Unix, remotely via the ssh connection.
- It can be used as a built-in editor for your Harbour application or as a separate application - a fairly powerful text editor.
- Multimode - besides the main editing mode, there are selection mode, Vim-like mode, which supports a limited set of Vim commands, and command mode.
- Support for different encodings, incl. Utf-8.
- An ability to open an arbitrary number of windows.
- Syntax highlighting, including highlighting of paired brackets.
- Support for bookmarks, search, go to the specified line and position in the line, transition to pair brackets.
- Vertical blocks support.
- Support for up to 26 Clipboard buffers.
- Unlimited Undo.
- Comparing of files or selected file fragments.
- Support for plugins, written in Harbour and assembled as hrb files.
- An ability to compile and add plugins to the editor directly from the editor, and it does not require Harbour or another compiler on the computer.
- An ability to mark plugins as intended for a specific type of file.
- An ability to run the Harbour code directly from the editor.
- Built-in two-panel file manager - HbCommander.
Hbedit is a multi-mode editor, it supports four modes: two main (edit mode and Vim-mode) and two additional (selection mode and command). defmode option in OPTIONS section of hbedit.ini determines which of the two, the editing mode (defmode = 0) or Vim-mode (defmode = 1) will be the default. Another option is possible when the editing mode is not only the main one, but the only one (defmode = -1) - while switching to Vim mode is impossible. This makes sense if the user is um ... not very qualified and accidental switching to Vim mode may be a shock to him.
Switching between modes depends on which one is selected in as the default (primary). If this is an editing mode, then switch to Vim mode occurs when you press Ctrl-Q, back - ESC (or one of the Vim commands: i, a, ...). If the Vim mode is selected as the main one, then switching back and forth is carried out in the same way as done in Vim: i, a, and so on - in edit mode, ESC - back to Vim. And more: if the main is the edit mode, then you can close the current window by pressing ESC, for Vim this will not work.
Editing mode is a familiar to most users way of working in text editors. If you wish, you can use this mode only. The convenience of Hbedit is that it does not impose on your specific work model.
The Vim mode is the main mode in the Vim editor. The keys in this mode do not serve to enter text, but to perform certain commands. Hbedit supports a subset of the Vim commands, you can see the full list in the next section.
To selection mode you switch automatically by starting to select text. It can be done in several ways. In edit mode you can, as in most Windows editors, use Shift + movement keys, to select a vertical block - Shift-Alt + movement keys. In Vim mode, press v to start normal selection, V - select lines, Ctrl-v - highlight vertical block. In both modes you can use F3 (as in Midnight Commander) to start the normal selection, Ctrl-F3 - selection of the vertical block, and then - movement keys. I consider selecting as a separate mode, because a key assignment is changed. In most Windows editors, when you click, say, f, during the selection process, you will delete the selected text and a f symbol will be inserted in its place. I do not see a big benefit in such an operation. In Hbedit, when you press a key, if it is a selection mode command, a certain action will be performed - in most cases this is the a corresponding Vim command. For example, when you click u, the selected text will be converted to lower case. Full list of selection mode commands is here. By pressing F9 or m you call a special menu for selection mode with a number of additional commands. So, you can add a given text to the left or right of each line of selected text, sort lines of text by selected vertical block, calculate the sum of the numbers in the selected vertical block. The list of such operations may be extended, using a special plugin, plug_selection.hrb
Command mode is also borrowed from Vim. Switching to it is made from Vim-mode, using Ctrl-Q (for convenience, if you switch to Vim from edit mode using Ctrl-Q) or, as is customary in Vim, Shift-:. You go to the command line where you can enter and run on execution of various commands. The set of these commands is so limited by compared to Vim, which makes me even embarrassed to talk about this mode. This is q, q!, e, w, set (with a very limited set of parameters), bp, bn, ls, ! - Vim users know what it is.
Keys fot both editing and Vim modes:
F10, Esc | Exit; |
F9 | main menu; |
F1 | help; |
F2 | save file; |
Shift-F2 | save file as...; |
F3 | block selection; |
Ctrl-F3 | vertical block selection; |
F4 | file open dialog with a list of recent files; |
Ctrl-F4 | file open dialog; |
Shift-F4 | new window; |
F7 | search; |
Shift-F7 | search for the next entry; |
Alt-F7 | search for the previous entry; |
Ctrl-F7 | search / replace; |
F8 | enable / disable syntax highlighting; |
Shift-F8 | select code page; |
Alt-F8 | go to the specified position (line,position); |
F11 | plugins list; |
F12 | list of open files; |
Ctrl-Q | change current mode; |
Ctrl-Z или Alt-BS | Undo; |
Ctrl-Tab, Shift-Tab | switch buffer (opened file)/window; |
Ctrl-v, Shift-Ins | paste text from the clipboard; |
Ctrl-p | paste text from any of clipboard buffers; |
Alt-m[a...z] | set a bookmark; |
Alt-'[a...z] | go to the bookmark; |
Alt-'. | go to the last edit position; |
Ctrl-b | go to the pair bracket; |
Alt-b | Return to the previous position (after search, goto, ...) |
Ctrl-w,s | split window horizontally and open the same file in readonly mode; |
Ctrl-w,v | split window vertically and open the same file in readonly mode; |
Ctrl-w,w | switch window; |
Ctrl-w,c | close window; |
Ctrl-w,o | open window fully; |
Ctrl-C или Ctrl-Ins или y | put text into the system buffer; |
F3 | put text into one of 10 internal buffers (0th is system); |
Del или d | delete the text; |
Shift-Del или Ctrl-X | put in the system buffer and delete; |
c | delete the text and switching to edit mode; |
u, U | convert, respectively, to lower or upper case; |
>, < | increase / decrease indent; |
. | repeat the last operation with a selected region; |
m или F9 | menu for a selected region; |
o | continue selection from opposite end; |
r[x] | replace all chars in selected text with x; |
i[w,W] | select a word under the cursor; |
i[",'] | select a text between quotes (double or single); |
i[b,(,)] | select a text in parentheses; |
i[ | select a text in square brackets; |
i[B,{,}] | select a text in braces; |
is | select a sentence; |
ESC | cancel selection. |
Vim-mode keys:
h,j,k,l | cursor left, down, up, right; |
w, W | the next word (big word); |
e, E | end of the word (big word); |
b, B | the beginning of the word (big word); |
0 | beginning of line; |
^ | the beginning of the first word in the line; |
$ | end of line; |
gi | go to the last edit position; |
gg | go to the beginning of the file; |
[1...9]gg | go to the specified line; |
[1...9]G | go to the specified line; |
G | go to the end of the file; |
H | go to the first line on the screen; |
M | go to the middle of the screen; |
L | go to the last line on the screen; |
Ctrl-b | PgUp |
Ctrl-f | PgDn |
% | go to the matched bracket; |
f[x] | find next char x; |
F[x] | find previous char x; |
* | find a word under cursor; |
# | find a word under cursor (backward); |
/ | search from the command line; |
v | switch to selection mode; |
V | switch to lines selection mode; |
Ctrl-v | switch to vertical block selection mode; |
p, P | insert text from the buffer; |
yy | put acurrent line into the clipboard buffer; |
yi[w,W] | put a word into the clipboard buffer; |
yi[",'] | put a text between quotes into the clipboard buffer; |
yi[b,(,)] | put a text in parentheses into the clipboard buffer; |
yi[ | put a text in square brackets into the clipboard buffer; |
yi[B,{,}] | put a text in braces into the clipboard buffer; |
yis | put a sentence into the clipboard buffer; |
"[a...z,-] | set a register for a next operation; |
i | switch to edit mode at the current position; |
a | switch to edit mode after the current position; |
I | switch to edit mode from the first word of the line; |
A | switch to edit mode from the end of the line; |
cc | delete the current line and go into edit mode; |
c[w,W] | delete before the beginning of the next word and go into edit mode; |
c[e,E] | delete the end of the word and go into edit mode; |
c[b,B] | delete a word before the start and go into edit mode; |
сi[w,W] | delete a word and go into edit mode; |
сi[",'] | delete a text between quotes and go into edit mode; |
ci[b,(,)] | delete a text in parentheses and go into edit mode; |
ci[ | delete a text in square brackets and go into edit mode; |
ci[B,{,}] | delete a text in braces and go into edit mode; |
o | insert a line after the current one and switch to editing mode; |
r | replace one character; |
R | replace few characters; |
~ | invert character case; |
>> | indent the current line right; |
<< | indent the current line left; |
dd | delete the current line; |
d[w,W] | delete before the next word; |
d[e,E] | delete to the end of the word; |
d[b,B] | delete a word before the start; |
di[w,W] | delete a word; |
di[",'] | delete a text between quotes; |
di[b,(,)] | delete a text in parentheses; |
di[ | delete a text in square brackets; |
di[B,{,}] | delete a text in braces; |
x | delete a char; |
. | repeat the last operation; |
m[a...z] | set bookmark; |
'[a...z] | go to the bookmark; |
'. | go to the last edit position; |
u | undo; |
ZQ | close all buffers without saving; |
ZZ | close all buffers, save updated; |
q[0...9,a...z] | recording macro; |
@[0...9,a...z] | playing macro; |
@@ | playing last used macro; |
[0...9]@[0...9,a...z] | playing macro specified number of times; |
The number entered before the move command (h, j, k, l, w, w, e, E, b, B) or before dd, dw, dW, db, dB, de, dE, cc, cw, cW, cb, cB, ce, cE, yy forces appropriate action to be done a specified number of times. For <<, >> commands this number sets the quantity of lines to be indented.
hbedit [-f iniFileName] [-gN] [-xy=xPos,yPos] [-size=nCols,nRows] [-ro] [files...]
- -f iniFileName - the name of the ini file used instead of the standard hbedit.ini;
- -m - start program in file manager mode (hbCommander);
- -gN - is the string N from which to start editing; If N is less than 0, then this is the number of lines before the end of the file;
- -xy = xPos, yPos - the starting position of the editor window in pixels (for Windows only);
- -size = nCols, nRows - the number of columns and rows in the editor window;
- -ro - open files as read only;
- -d - open two files side-by-side in diff mode;
- files ... - list of files.
hbedit.ini - editor configuration file. When starting up hbedit, it is searched first in the current directory, and then, if not found, in the directory where the executable file hbedit is located. On Linux/Unix systems, after the current directory, it is also searched in the home directory (~/hbedit/hbedit.ini). The path and name of the configuration file can also be specified on the command line when hbedit is called.
SCREEN section
Sets the size of the editor window, the font and the default code page.
- fontname is the name of the font, it must be from the family of monospace (Courier New, Dejavu Sans Mono, Liberation Mono, Lusida Console, Terminal);
- fontheight - font size (height);
- fontwidth - font width;
- screen_width - the number of columns in the editor window;
- screen_height - the number of lines in the editor window;
- cp is the default codepage (the list is in the Code Pages section);
START section
- plugin - the starting plugin that will be executed at the start of the program, before opening the files;
- maximize - editor window opens at a full screen at start;
- files - the list of files that will be opened when the editor starts - can be useful, if the ini file is in the current directory or specified on the command line.
OPTIONS section
- defmode - the default mode: 0 - editing mode, 1 - Vim, -1 - editing mode without the ability to switch to Vim;
- incsearch - enable / disable incremental search in command mode;
- autoindent - enable / disable auto-indent when ENTER is pressed;
- autocomplete - enable / disable autocompetion mode;
- autodelay - a number of seconds before a hint appears in autocompetion mode (0 - the hint appears after a pressing Tab only);
- syntax - enable / disable syntax highlighting;
- savehis - 0 - do not save history (files, files, commands), 1 - save in the directory of the executable file, 2 - save in the current directory;
- cmdhismax - the number of commands stored in the history file;
- seahismax - the number of search lines stored in the history file;
- edithismax is the number of file names stored in the history file;
- eol - End of Line separator: 0 - leave as is, 1 - Unix, 2 - Dos;
- trimspaces - remove trailing spaces when exiting;
- palette —the default color scheme, one of those defined in the PALETTE sections;
- tablen is the length of the tab;
- tabtospaces - convert tab characters to spaces;
- langmap_cp - the code page in which this ini-file is made;
- langmap_upper - the map of the transformation of the keys of the national keyboard into the Latin (large letters);
- langmap_lower - a map of the conversion of keys of a national keyboard into a Latin one (small letters);
- keymap - redefinition of keys, for example, Ctrl-N => Shift-F4, Ctrl-O => Ctrl-F4 assigns Ctrl-N instead of Shift-F4 (create a new empty file) and Ctrl-O instead of Ctrl-F4 (open file);
- sele_plugin - the name of the plug-in for expanding the actions menu for the selected block;
CODEPAGES section
The codepages used in the work are listed here (the full list is in the Codepages). Each codepage is in a separate line: cp1 = RU866, cp2 = RU1251, ... p>
- cp1
- cp2
- ...
PLUGINS section
Here are listed the plugins used in the work. Each plugin is in a separate line: p1 = ..., p2 = .... A plugin is a file with the .hrb extension in the plugins/ directory. In each line, separated by commas, there are a file name, a file type, a name that will be displayed in the menu, and, if you need a keyboard shortcut associated with this plugin (Alt-L, for example, in this case the plugin will be called when you press Alt-l).
The file type is one of the languages, defined in hbedit.ini (prg, c, go, ...). This is done for when you call the list of plugins (F11), only those, created for the language of the file in the current window are displayed. If the plugin file type is not specified (empty), then it appears in the list for any file.- p1
- p2
- ...
HILIGHT section
The colors for the default color scheme are defined here, they are specified in Harbour color format, TextColor/BackColor. BackColor can be a value from the following list:
N, B, G, BG, R, RB, GR, W - in the default color scheme these are, respectively, black, blue, green, cyan, red, purple, brown, light gray.
TextColor - one of the BackColor list or
N+, B+, G+, BG+, R+, RB+, GR+, W+ - in the default color scheme, respectively dark gray, bare, light green, light cyan, light red, light purple, yellow, white. p>
In a different color scheme, solarized, for example, the indicated letters may correspond to completely different colors.
- colormain - primary color (BG+/B - light cyan on a blue background);
- colorsel is the highlight color;
- colorpane - the color of the status bar;
- colorbra - the color of the highlighted brackets;
- colormenu - the color of the menu and lists;
- colormenusel - the color of the selected line in the menu or list;
- colorwb - white on black;
- colorwr - white on red;
- colorget —special color for use in dialogs:
- keywords1 - highlighting a list of keywords:
- keywords2 - highlighting a list of keywords:
- keywords3 - highlighting a list of keywords:
- keywords4 - highlighting a list of keywords:
- quotes - highlight text in quotes;
- scomm - highlight a single-line comment;
- mcomm - multi-line comment highlighting;
- startline - highlighting the lines defined by the first character of the conditional compilation, for example;
PALETTE sections
There may be several of these sections, they should have different names beginning with PALETTE: PALETTE_1, PALETTE_2, ...
- name is the name of the color scheme;
- colors - list of colors - 8 BackColors and 8 TextColors;
- colormain , colorsel , ..., startline - see the description of a HILIGHT section;
LANG sections
These sections contain options related to a specific file type. Section name - LANG_<type>, where <type> - file type: LANG_PRG, LANG_C, LANG_GO, LANG_XML, ...
- ext - file extensions;
- keywords1 is a list of keywords;
- keywords2 is a list of keywords;
- keywords3 is a list of keywords;
- keywords4 is a list of keywords;
- scomm - definition of single-line comments;
- mcomm - definition of multi-line comments;
- startline -
- case - On, if the syntax is case sensitive;
- brackets - On if pair brackets are required;
- plugin - a plugin called when opening a file of this type;
- palette — the color scheme used for this type.
Hbedit supports all codepages, which Harbour have: BG866, BGISO, BGMIK, BGWIN, BIG5, CP950, CS852, CS852C, CSISO, CSKAMC, CSWIN, DE850, DE850M, DEISO, DEWIN, DK865, EL437, EL737, ELISO, ELWIN, EN, ES850, ES850C, ES850M, ESISO, ESMWIN, ESWIN, FI850, FR850, FR850C, FR850M, FRISO, FRWIN, GBK, HE862, HEWIN, HR646, HR852, HRISO, HRWIN, HU852, HU852C, HUISO, HUWIN, IS850, IS861, IT437, IT850, IT850M, ITISB, ITISO, ITWIN, LT775, LTWIN, NL850, NL850M, NO865, PL852, PLISO, PLMAZ, PLWIN, PT850, PT860, PTISO, RO852, ROISO, ROWIN, RU1251, RU866, RUISO, RUKOI8, SK852, SK852C, SKISO, SKKAMC, SKWIN, SL646, SL852, SLISO, SLWIN, SR646, SR646C, SRWIN, SV437C, SV850, SV850M, SVISO, SVWIN, TR857, TRISO, TRWIN, UA1125, UA1251, UA866, UAKOI8, UTF8.
You may include those, which you need, in hbedit.ini, CODEPAGES section.
- plug_android_project.prg
- plug_c_init.prg - init plugin for C;
- plug_go_init.prg - init plugin for Golang;
- plug_go_build.prg - Golang: build project or compile current file;
- plug_go_fmt.prg - Golang: format current file;
- plug_go_run.prg - Golang: execute current file;
- plug_go_spis.prg - Golang: list of functions;
- plug_hbp_init.prg - A plugin for hbp-files (hbmk2 project files), which provides a navigation via project files and building the project.
- plug_java_init.prg - init plugin for Java, provides list of functions, compiling, executing, autocompletion;
- plug_lisp_init.prg - init plugin for Lisp;
- plug_php_init.prg - - init plugin for Php;
- plug_prg_init.prg - Harbour init plugun: provides online info about Harbour and HwGUI functions, list of functions, autocompletion;
- plug_prg_compile.prg - Harbour: compile current file to hrb;
- plug_prg_run.prg - Harbour: execute current file;
- plug_prg_run1c.prg - Harbour: execute current file with connecting to 1C via appropriate COM-object;
- plug_py_spis.prg - list of functions for Python;
- plug_bat_init.prg - init plugin for bat files;
- plug_sh_init.prg - init plugin for sh scripts;
- plug_chartable.prg - Characters table;
- plug_calculator.prg - Calculator;
- plug_selection.prg - Implementation of additional operatios on a selected region;
- plug_webservices.prg - Few web services support;
- plug_vcs.prg - An integration with Git and Fossil systems;
- plug_gm_chess.prg - Chess (game);
- plug_gm_life.prg - The Game of Life (a game by John Conway);
- plug_gm_tetris.prg - Tetris (game);
- plug_gm_sokoban.prg - Sokoban (game);
- plug_gm_strek.prg - Star Trek (game);
- plug_gm_sudoku.prg - Sudoku (puzzle)
- plug_gm_ugolki.prg Ugolki (game)
Your name:
Email address:
(not be shown publicly)
  |