On 4/5/2016 02:40, Anselm Lingnau wrote: > Ian Shields wrote: > >> In general. I agree with the sentiment that vi should cover only basic >> commands. I think you need to know at least the following: >> 1) How to get in and out of vi >> 2) Enough about modes to know that there is a command mode and an insert >> mode and pressing esc will get you out of insert mode if you're in it. >> 3) How to move your cursor up, down, right and left and maybe to >> end/beginning of line >> 4) How to scroll a page in either direction >> 5) How to search forward and backward for a string >> 6) how to insert, edit and delete text. >> 7) How to save or quit a file without saving. > Sounds reasonable to me. (Given that the arrow keys and Page-up/down do what's > printed on them, that leaves “i”, “x”, “/”, “?”, “ZZ”, and “:q!”. We probably > have to throw in “dd” and “J” because of the brain-damaged way vi deals with > lines.) If the arrow keys don't happen to do what's printed on them (as I've seen by default on some *IX) systems, you probably need an editor to set up some customization. Particularly if you can't get the network working either so you can't SCP or otherwise copy definitions from somewhere else. If your editor of choice isn't installed (and nano isn't usually installed on my Fedora systems), you will probably resort to vi. And you may need to know how to navigate without the arrow keys. Sure it's ugly. Sure it has warts all over it. Sure it smells to high heaven. But it works and I think your list of commands is too minimal for LPIC-1. I'm no vi guru and have no great desire to become one. > >> I'm curious as to how you downgrade vi to a weight 1 objective and still >> know enough to use it. I don't think most other weight 1 objectives >> require this much skill. > You can learn the above in a quarter of an hour using something like vimtutor, > especially because you can immediately see what happens. I think you need a bit more than you do, but that's my opinion. > > Quotas are a weight-1 objective and they take longer than that if you actually > configure them and convince yourself that they do what they claim. That > includes some reasonably non-trivial stuff like soft and hard quotas, compared > to which the basic vi command set outlined earlier is easy-peasy. (Although > I'm secretly convinced quotas are weight-1 so it doesn't matter too much if > you skip them altogether – I don't think I've seen a Linux system in the wild > that was actually running quotas. Perhaps people still use them at > universities.) Hmm. I ran into quite a few quotas on systems when I worked at IBM. I agree that the weight of 1 is not proportionate to the amount you need to know. > >> Did you ever ask anyone how they might do things if they had to operate >> on a 2400, 4800, or 9600bps glass teletype instead of a fiber optic >> internet connected graphical device with more pixels than old-timers >> probably ever imagined possible? > Nano presumably runs over a 2400bps connection about as well (or badly) as vi > does. (I'm assuming you don't mean the real “glass teletypes” where you only > get to add stuff at the bottom of the screen and where vi is forced into ex > mode, because LPIC-1 doesn't cover ex. Which I hope we can all agree should > stay that way.) > > In any case I don't think what people used to do back in the days of 2400bps > glass teletypes should constrain what we're allowed to do now. Around that > time, people also used to use the C shell, but fortunately LPIC-1 gives that > program's strange and wonderful history-editing mechanisms, as carried over > into bash, only very light coverage now that we can actually edit the command > history like reasonable people, using arrow keys. Nobody seems to argue that > we should all be using the Bourne shell (which doesn't have the concept of a > command history) because it is the agreed standard for sysadmins, has been > around forever, and (unlike bash) exists everywhere, even on traditional Unix > – but yet something very similar appears to be the key argument in favour of > vi. > > In the 1980s I used to use MicroEmacs on serial text terminals and that was > just fine as far as I was concerned. The point of my question was simply to help folks who may never have used such ancient equipment understand why vi might seem so arcane. Check out https://www.youtube.com/watch?v=X9dpXHnJXaE for a live demo of Wikipedia on a 300 baud acoustic modem (the kind in a wooden box where you dialed the number on a phone handset and then put the receiver in the box). I used one like that in the early 1970's.
If nano or some other editor becomes the universally available standard that is installed as part of every minimal install then I'd be all for ditching vi. Meantime, understanding some if it's historical context makes it a bit easier to comprehend why someone might ever design such an editor. And that makes it a bit easier to learn IMHO. > >> Generally agree. Except that there are a few other commands that assume >> vi, such as visudo, vipw and vigr that assume vi as their default >> editor. > All of these use whatever editor the EDITOR variable says they should use. On > my Debian system, they default to nano. They may have “vi” in their name but > ultimately that doesn't mean a lot. Yep, Debian uses nano. Lots of distros still use vi. I don't think you can ever know how to use too many editors. :-) > > Anselm _______________________________________________ lpi-discuss mailing list lpi-discuss@lpi.org http://list.lpi.org/cgi-bin/mailman/listinfo/lpi-discuss