Closed Gavin-Holt closed 2 years ago
Hi,
I have been trying to get cut copy and paste to work in "modeless" mode and use Autohotkey to call some scripts (mapping does not work in modeless mode!) - I can report some success:
# ed.cfg &Edit menu
menuitem "Cu&t Ctrl+X" <CTRL_K>\h\xso mod\\cut.vi \n
menuitem "&Copy Ctrl+C" <CTRL_K>\h\xso mod\\copy.vi \n
menuitem "&Paste Ctrl+V" <CTRL_K>\h\xso mod\\paste.vi \n
autoexec section for "Open Watcom vi"
^c::Send !ec
^x::Send !et
^v::Send !ep
As you can see below I have had to dip my toe into the modal world of vi! Using the z copy buffer as a "single" clipboard:
# Copy.vi
set nomodeless
execute "zyr
set modeless
echo ""
# Cut.vi
set nomodeless
execute "zdr
set modeless
echo ""
# Paste.vi
set nomodeless
execute dr
execute "z\<SHIFT_INS>
set modeless
echo ""
Hopefully this will make the editor more useful for those of us in "modeless" mode.
Kind Regards Gavin Holt
NB.
Achievements so far:
Blind alleys:
Hi
I am having fun exploring console Vi.exe in "modeless" mode under windows (i.e. vi.exe from binnt or binnt64). The speed is addictive :)
This version of vi.exe does not have access to the system clipboard, but does offer and . However, the expected modeless single clipboard workflow does not seem to work as one might expect:
<CTRL_X>
<CTRL_C>
work as expected in the edit window.<CTRL_V>
will insert text from buffer 1 in the edit window if there is none selected. But if there is some selected text this command seems to cut the selected text to buffer 1 - and then insert it back again!<BS>
and<DEL>
will work normally if there is no selection. However, if there is some text selected in the edit window both these functions cut the selected text to buffer 1 - and pollute the single clipboard.I have some custom menu entries that select text for deletion e.g.
Unfortunately the text deleted replaces the contents of the "clipboard". I suspect this is not what the designer of the "modeless" mode intended.
For others interested in exploring I have attached my ed.cfg and the autohotkey script to drive it!
Kind Regards Gavin Holt
ed..txt OWVI..txt