![]() |
how to use VI xterm editor
Since I'm too lazy to learn VI properly, can someone tell me how to enter the following commands?
edit/open a readonly document, for example a repository list file delete text in a file (sorry, I'm stupid ;p) save changes made to a readonly file Of course once I start editing a readonly file it would mean converting the file to read/write... All in all, probably not hard to do but I'm still learning the ropes. Thanks in advance. |
Re: how to use VI xterm editor
Quote:
Quote:
Quote:
Also, in vi you can prefix most commands with numeric multipliers, so for example "12x" deletes the next 12 characters and "5dd" the next five lines. Quote:
|
Re: how to use VI xterm editor
|
Re: how to use VI xterm editor
Thank you kindly.
Yeah, the only reason I'm trying to edit a file I normally wouldn't touch is because the repository list has a bad dependency entry for one of the packages, which doesn't let me install the app. |
Re: how to use VI xterm editor
There are many right answers to questions like "how do I delete?"
No matter how lazy you are, in fact especially if you're lazy, you should look at a diagram of vi's "modes." You can see a good example at http://www.ostc.de/vi-overview-eng.pdf That is a six-slides-on-one-pdf-page intro to vi I just now found by googling vi modes. The second of the six slides is a diagram of vi's modes. I found plenty such diagrams by googling, but this was the best-looking. The other diagrams on that page are also really good. The most confusing thing about vi for newbs is that it behaves differently depending on which mode it's in. You have to be able to go from one mode to another to be sure that any hint will work (or just say, "well, I *assumed* you'd be in edit mode!" and roll your eyes). Most of the hints given in this thread assume you're in "command mode" in the above-mentioned diagram. Looking at the diagram, you can probably see that pressing the escape key puts you in this mode or does nothing if you're already in this mode. So if the hints behave unexpectedly, you may want to hit the escape key (the back button on my N800) first. |
Re: how to use VI xterm editor
FWIW, vim 7.0 is in Extras-devel.
I'll be promoting it to Extras when the launch script and menu item is integrated into the package: at the moment you have to open X Terminal before using it. (It's one of the packages I'm using to test the re-invigorated mud-builder - in this case, directly from the upstream source tarball) |
Re: how to use VI xterm editor
yep, I'll be spending some time going thru those modes. In the meantime, its nano...
very off topic, but where in the file system are the folders that appear in the built-in file manager? I tried checking /home/user/mydocs and other logical folders but no dice. |
Re: how to use VI xterm editor
Nope, they're in MyDocs. They're hidden files (UNIXly, files starting with '.' are hidden) so that they don't show up in the file manager. Instead an entry is faked in, with a properly internationalized name, while the actual directories keep the same names.
Code:
ls -a /home/user/MyDocs/ |
Re: how to use VI xterm editor
Maybe I'm doing it wrong, but the Xterm vi doesn't really seem that complicated for minor edits.
After launching "vi [file name]", I guess you start off in command mode. The D-pad moves the cursor, x deletes characters. Press "i" for insert mode where you can type whatever text you want to insert into the original file. Esc returns to command mode where you can use ":wq" to save and quit if you're confident that you did everything right, or ":q!" to quit without saving if you're afraid your messed something up. I'm sure there's way more to it, but the above commands work for my minor modifications. |
Re: how to use VI xterm editor
That was a nice vi doc!
The trouble with vi or vim on a tablet, though Ii use it, is that the whole rationale is supposedly that it minimizes finger movement. That kinda falls apart when you are typing everything with one finger, which is what you are doing with a stylus. |
All times are GMT. The time now is 22:36. |
vBulletin® Version 3.8.8