20.9.16

Acme (editor / IDE / command shell) hints and gotchas

Here are hints to you, after decades of drabbling and a week of semi-active Acme use in Plan9port/Linux:

A good mouse and a good mouse pad helps. A wheel as a middle button tends to move the cursor in an annoying way, especially when it escapes the tag line. (But that's all I have.) Disable the touchpad so you don't touch that accidentally (Fn+F5 on my Dell). You CAN use the touchpad only, but that makes acme a torture ;-)

First see the Russ' tutorial on Youtube and other tutorial videos there and read the README.

Some hints and gotchas:

Learn the beautiful logic in scrolling. Right button raises a line to the the top of the window, left click is exactly opposite. Learn the logic of the window control boxes,

Then read the man page carefully.

Learn the mouse and the chords. You will copypaste with B1+B2, B1+B3 every minute. Double click anywhere after a command line to select it, click B2 at the same spot to execute it. (At least with a bad mouse that is easier than dragging with B2). A trick: put commands inside parentheses to make selecting them easy in the tag line. Do like ( iwlist scanning|grep ESSID ) and select with a double-click after the opening parentheses, then B2.

Learn B3 for context sensitive abstract "finding". For some reason B3 on acme(1) does not work in Plan9Port, and the "man" output with terminal escapes is not nice for acme. Use "man acme | col -b" , for example, to get pure ASCII. Understand that external commands always ADD to +Errors window. If you want to blank it, just delete it, and the next command will create a fresh one.

One strangish thing is, that if you want to select everything in a long text without extensive mouse drag and scrolling you have to B2 click "Edit ," That's a comma there. (You will learn ;-) )

Understand that the Linux directory you start in is global to acme. All new windows have that as a working directory. "Finding" directories with B3 creates new windows in deeper directory context. Usually you don't have to write directory names or paths ever. You can "move up" (or open windows in upper directories) in a bit strange ways: shorten the tag line path or write and B3 click "..".

Note: all commands work in their own window and directory. You can not "Edit s/Bob/Alice/g" from one window to another, even if you have a selection in another window. (I find that stupid. The only thing Rob and folks have ever done that I dare to question ;-) ) You can use B2-B1chord though: see that the last selected text ("s/Bob/Alice/g", anywhere) is what you need, press B2 on Edit  in a desired window where your selection is, click B1, release B2. Now you get  arguments from the selected text. But usually it is easier to have often used window specific commands copied and edited from a scratch to a needed window tag.

Learn to use infinite Undo, which allows you to experiment wildly. While programming, feel free to delete 90% of code and modify problems spots to debug, then Undo it all back when you know what to fix (This I learned from The Practice of Programming).

To create new files create a window, edit there, and add a name to the tag line. Then "Put".  For moving/linking/naming/deleting files I usually just edit the output of an "ls" or similar, adding the commands needed. Moving icons and windows is the primary operation of regular window systems, here icons don't exist and file manipulation commands are considered just...commands.

Keep a scratch file for the commands you need. Soon you find you have 99% of commands that you ever need there, when using them just overwrite or copy-paste the parameters that you want to change. There will be little use of the keyboard for commands. Learn to use "Dump project1" and "Load project1".

Note that "sudo", as an interactice dialog, benefits from a trick. If you have a timestamp configured, open a "win" and use sudo there once. Then it will work silently in normal acme windows. Anyway, if I really need root commands, e.g. troubleshooting Linux system stuff (always...) , I usually start acme as root. E.g. set up root Plan9port paths, do "sudo -i", then start acme.)

That's all, folks, for now. Perhaps a video following...

Ei kommentteja: