Q. TSE: Vi: Mode: Emulator: vimode.s
A.
[kn, ri, su, 24-10-2010 17:55:50]
> VI
I was browsing yesterday a bit further on that text editors org pages,
and came across a description of the advantages of VI (which is
currently also the current favorite text editor of the author of those
pages).
===
One of the interesting feature of VI was that it was multi-platform.
---
But most of all that you should be able do everything on a ((very)
limited) keyboard only.
===
Basically only the alphanumeric keys and the <CTRL> key can be used.
---
No mouse (maybe handy when working with a laptop (everywhere), keeping
your fingers all the time on the keyboard only.
---
No extended keys like cursor up, cursor down, cursor left, cursor right, Home,
PageUp,
PageDown, ..., F1, F2, ...F12.
---
Because built and having its origin in the days of terminal keyboards
where no mouse and extended keyboards were available.
---
Regarding moving your fingers and hands as little as possible (e.g.
from keyboard to mouse or extended keys) this should be one of the most
minimal designs.
---
What you do in VI is constantly switching between 2 modes, command mode and
insert mode.
===
The <Escape> key always switches to command mode.
---
In VI you will constantly be changing between command mode and insert mode by
pressing the
<Escape> key.
---
In VI 'Command mode' you type commands
E.g. in that command mode typing keyboard character
'd' will 'd'elete,
'c' will change,
'f' will find or thus search
'w' represents a word
'^' represents begin of line
'$' represents end of line
typing 2 characters 'yy' will copy.
You can also create combined commands.
E.g. typing the 2 character 'dw' will 'd'elete the current 'w'ord.
You can also inform how many times you want to do that operation.
E.g. '3dw' will delete 3 words.
---
How to do such a things in TSE?
The equivalent actions in TSE are as usual typing combinations
of <CTRL>, <ALT>, <SHIFT> and the other keyboard characters
and or mouse buttons.
You could if you want change the default behavior by changing the keyboard
bindings
(which you can change in your .ui file (e.g. tse.ui or win.ui located in the \ui
directory)
then recompile that file in order to make the changes permanent).
E.g.
'd' in Vim would be typing the <Del> character in TSE or thus running the
command DelAnyChar() (= delete (a character))
'd$' in Vim would be pressing the <F6> character in TSE or thus DelToEol()
(=delete to end of line)
To emulate the behavior, you could create a tiny interpreter, as usual
using GetKey(), PressKey() to intercept the pressed keys, then
using CASE ... WHEN ... ENDCASE to check that keys and do something.
I plan to create a similar Vi mode macro some time.
===
Are there already VI mode macros created for TSE?
But checking if already something like that existed, it showed
there exist already two earlier created TSE macros
1. the macro 'vimode' created by Arnold Hennig from 1995.
After a few changes I could run this macro also in TSE v4.4
2. and another vi mode macro created by Charlie Harris.
But this macro was not found anymore anywhere.
===
Question: Anybody knows where to find this VI mode TSE macro from Charlie
Harris???
---
The other VI mode is 'Insert mode'
(where you are able to type your text and insert it in the current buffer as
usual).
It is a bit confusing when you start working with VI, because you will be by
design in 'Command mode' first.
And then when you type characters they might not be inserted as usually in your
text, and nothing seemingly happens because you are in command mode and
the characters are interpreted in another way.
---
So depending on the VI mode the *same* keyboard characters have
different meaning. E.g. typing 'd' in command mode means you want to
delete the current character, and typing 'd' in insert mode will just
insert the character at the current cursor position).
---
But there must be something in this VI mode of working, as many have
praised the capabilities of VI (and VIM which I have installed) to very
fast and efficiently and possibly optimal do your text editor actions.
So probably worth looking at the philosophy and implementation of this,
to use for your own possibilities to do the same things even better
then before.
At the end of the day VI is in this regard a special case of a command
driven text editor, using a minimum set of keys, and this commands you
can also combine in sophisticated ways (probably a bit like you combine
single commands into multiple commands in Forth)
---
But thus TSE is still my number one rated and most used program overall.
Rock solid, very reliable, very fast, handles very large files,
regular expressions, completely configurable, create your own
macros via the TSE virtual machine to do almost any text editor action and
beyond (e.g. via Microsoft Windows DLLs), ...
File corruption almost never happens, and when it happens it is not in TSE
control (e.g. because of operating system
actions, like pulling a USB while the file is saving), and crashing of TSE
happens only very rarely.
There are not much other text editors which can claim a similar record.
----
Emacs and SlickEdit are also very interesting editors. Only SlickEdit
would be usable for me though, as I work with very large files (growing
towards half a gigabyte), and default (GNU) Emacs complains about such
a large files. I plan to have a look at MicroEmacs also.
I saw some interesting demonstration of Scite about column editing on
YouTube, but that behavior could very probably also be macro programmed
into TSE if wanted.
What happened with e-Text editor? Have you used it? I bought it at the
time, and have the latest version running.
[note: e-text editor stopped being sold years ago [kn, ri, tu, 03-06-2025 16:00:54]]
There might be some things missing or not present in TSE
1. -Version control, but that you can thus e.g. create a workaround by
e.g. using Tortoise SVN and TSE macros.
Works really fun for me.
2. -Folding (I used it in e.g. IBM Lotus Notes, but it never convinced
me personally. Opening when you wanted it closed, and closing when
it was open). So not a must for me at all. Never used it really
until now.
3. -Unicode (workaround would be to load/copy/paste/save in other text
editors when that should occur). Interesting, but certainly not a
must for me personally, as I only rarely have to use it.
4. -Regarding multi-platform (e.g. Linux), there should exist TSE beta
versions, which should work pretty OK. I work sometimes on Linux,
Unix, Solaris, and should work sometimes on AIX. But then I
probably would use VI because that is default installed on most of
them.
5. -Workspace and project
6. -Intellisense
Wine is another way, tried it a few times, but I think it has its restrictions
(e.g. not all Microsoft Windows programs run in it).
So better running the full operating system.
Otherwise as a workaround of still running TSE on Microsoft Windows, while
having to work in another operating system (like Linux)
I would install Oracle Sun Virtual Box on the Linux host machine and run
Microsoft
Windows with TSE in it.
You could then e.g. exchange information as usual using copy/paste or file
sharing.
Or the other way around, install Oracle Sun Virtual Box on the Microsoft Windows
host machine, and run one or
more Linux versions (like Ubuntu, Red Hat, Suse, ...) in it.
You can connect e.g. from you own computer to the remote computer e.g. using
Microsoft Remote Desktop if applicable.
Or otherwise in general using different VNC clients. Supplying the IP address of
the remote (virtual machine) computer only.
You might have to install a VNC server on the remote operating system if not
default present.
with friendly greetings,
Knud van Eeden