Results 1 to 7 of 7

Thread: I need help with vim

  1. #1
    Junior Member
    Join Date
    May 2006
    Posts
    1

    I need help with vim

    Just how does this thing work!?

    I start it up with 'vim file'

    Then it would typically give me the
    Code:
    Found a swap file by the name ".file.swp"
    Then it would force me to scroll and read the senseless stuff.

    blah, blah, blah
    blah, blah, blah
    blah, blah, blah

    And at the end it says file crashed! WTF!?

    Anyways, I choose (R)ecover.

    More reading and have-to-scroll'ing.

    blah, blah, blah
    blah, blah, blah
    blah, blah, blah

    Then I would get looked in a circle of choices. Then finally, the editor opens. I type in some stuff. And try to quit by hitting ctrl+z, but I get the '^Z' entered instead! WTF!? Sometimes ctrl+z means quit, and sometimes it enteres '^Z'!

    Sometimes when it does quit, it does not ask me if I want to save or not! It just quits! There is no save control mentioned in the manual.

    Just how do I work this thing?

  2. #2
    Senior Member registered user
    Join Date
    Dec 2003
    Location
    Salt Lake City, UT, U.S.A.
    Posts
    1,338
    clirocks,

    First, may I suggest you use another editor, vi is not that "user intuitive" - possibly use mc 's editor, or kate, or kwrite, etc...

    If you continue to use vim, I have found some ways of getting around in it...

    Hitting the "Insert" key, will allow you to enter data into the file you are editting ( it places you into insert mode, and not edit mode )
    Hitting the "ESC" or escape key, will return you from insert mode back to edit mode
    Hitting the "colon" or ":" key, in EDIT mode, will allow you to type a command
    Hitting any key, other than ESCAPE in insert mode, will only enter the key into the editor data file

    Nice commands:

    ESCAPE then : then w then q -=- this places you into edit mode, tells vim you are going to enter a command, the "w" tells vim to WRITE or SAVE the file, and the q tells vim to quit editing the file and returns you to your CLI konsole

    ESCAPE then : then q -=- if this is done on a file that has been changed, vim will REFUSE to quit. It will report you either need to save the changed file, or FORCE the quit using the "!" in your quit command.

    If you are a long follower of Windows, and DOS, vim is just this side of better than the DOS editor edit line, which I think was last used in DOS 2 or possibly 3. It was replaced with just edit.

    I tend to use another editor, like kwrite, for all of my editing needs, and only cron job file editing, do I use vim for that.

    As for the "errors" or other information you are getting from vim, I have never come across these things, so I havent any clue on what, or why you are getting them...

    Hope this helps, even just a little,
    Ms. Cuddles

  3. #3
    Senior Member registered user
    Join Date
    Apr 2004
    Location
    Germany
    Posts
    100
    "just a little better than edlin?" Ms Cuddles, you owe me a cup of coffee which I
    just dropped

    Yes, vi can be more than confusing to the uninitiated, and it does take time to
    find one's way with it. It has that in common with the command line interface:
    difficult to master at first, but awesome raw power after that.

    For a first guided tour, type "vimtutor" at the command line.

    (ok, donning my asbestos underwear: let the editor flames begin!

  4. #4
    Senior Member registered user
    Join Date
    Dec 2003
    Location
    Salt Lake City, UT, U.S.A.
    Posts
    1,338
    angor,

    Sorry...

    I have to admit, vi is powerful, a lot better than edlin could ever have been, etc... but it doesnt compete with GUI based editors, though.

    VI's biggest strengths, is, it doesnt run in a GUI, which, comes in really handy when you have to work on editing files, while you are "stuck" in a text boot. It IS a good editor, and when you need something to edit, and CANT use a "nicer" editor ( nicer? yuck, bad English! ), it comes in very handy. I honestly think everyone should be "familiar", at least, with vi, and, at least be able to edit, change, and save files, using vi. It cant hurt. As a wise person once said, having more tools in your "arsenol" tool belt, can only help.

    So, once again, sorry angor, vi does have a purpose, it is functional, and necessary, and I shouldnt have flamed it so bad... I guess a better analogy is... vi is about as useful as... a EXCEL Spreadsheet is to an accountant... Better

    Ms. Cuddles

  5. #5
    Senior Member registered user
    Join Date
    Apr 2005
    Posts
    159

    Re: I need help with vim

    Quote Originally Posted by cuddles
    I have to admit, vi is powerful ... but it doesnt compete with GUI based editors, though
    Woah there! Define "compete", please ?!? A knowledgeable vi user beats any GUI-editor user hands down for advanced plain text editing. Really. I've used vi in DOS, windows, OS/2, BeOS, VMS, coherent. BSD, linux, SCO, AIX, SunOS, Solaris... On hign-end machines with a GUI and old systems on a 300 baud line over a modem. It worked in all settings, with the same (admitedly quirky) user interface. Learn it once, use it everywhere.

    Quote Originally Posted by clirocks
    Just how does this thing work!?
    Excellent advice was given to you: spend some time with the tutor, you won't regret it. For starters, this here editor is modal, learn the difference between "edit" and "insert" modes. Vi is awkward and hard to learn, very few people would argue with that. But it is powerful and ubiquitous. Mastering it is a traditional unix rite of passage of sorts. For the casual user, there are obviously easier alternatives; eg. "mcedit" on the CLI and "scite" for the GUI. Many people spend too little time learning "vi", and just keep hating it forever. Keep at it, let it become second nature and you'll never go back. Don' let vim's wealth of features overwhelm you though, and focus on vi compatible mode at first. The lighter "nvi" is worth trying, too.

    Quote Originally Posted by clirocks
    And try to quit by hitting ctrl+z, but I get the '^Z' entered instead! WTF!? Sometimes ctrl+z means quit, and sometimes it enteres '^Z'!
    I am not replying from knoppix (or even linux, shame on me) and cannot check right now, but this might explain your problem. Exiting"vi" can be obtained with "ZZ" or ":q". Ctrl-Z sends the editor to the background in a CLI, and minimises your editing window in a GUI if I recall correctly. Hence if you launch a new copy of "vim" on the same file (while the 1st one is minimised), you'll see the warning you mention.

  6. #6
    Member registered user
    Join Date
    Jun 2004
    Posts
    83
    Quote Originally Posted by Cuddles
    I have to admit, vi is powerful, a lot better than edlin could ever have been, etc... but it doesnt compete with GUI based editors, though.
    Hey Cuddles, vim (aka gvim), is a GUI editor!

    Cuddles, in spite of all your useful advice over these and other forums, you are wrong on vim . No other editor comes close and I've never met anybody who can edit/create files as quickly and efficiently as I can using vim (I'm a software developer). I've been using vi/vim for over 20 years and consider myself a vim guru but still am occasionally surprised to discover new features hidden within its treasure trove. With the recent vim 7, I've now got to learn heaps more ....

    Vim is for power users! Hooray for Bram Moolenaar.

  7. #7
    Senior Member registered user
    Join Date
    Dec 2003
    Location
    Salt Lake City, UT, U.S.A.
    Posts
    1,338
    Quote Originally Posted by kirol
    Woah there! Define "compete", please ?!? A knowledgeable vi user beats any GUI-editor user hands down for advanced plain text editing.
    Exactly! "Plain text editing". See below for more information, and my mistake, and apology

    Quote Originally Posted by markb
    Hey Cuddles, vim (aka gvim), is a GUI editor!

    Cuddles, in spite of all your useful advice over these and other forums, you are wrong on vim . No other editor comes close and I've never met anybody who can edit/create files as quickly and efficiently as I can using vim (I'm a software developer).
    First of all, thanks, I guess. Second, my mistake. I was comparing a "word processor" with vi. When it comes to editing, as the needs of a word processor, vi lacks in the competition. BUT, I completely agree with, both of you, when you just need to edit a file, nothing comes close to the speed, and ease, of a simple editor. ( not saying that vi is "simple", just that it doesnt have all those "bells and whistles" that a lot of word processor programs have, and thus, allows a person to just get in quickly, edit, and get out. Thus, "simple" here, denotes ease of doing the task. )

    I have to apologise, I was comparing vi to a "full blown" word processor, and its power. I made the mistake on this one, because, if all you want to do is edit a file, vi is KING. If, on the other hand, you want to compare all the power of, say, M$ WORD, and all of its features, then vi, would be a pale comparison to it.

    As kirol said, "plain text editing", you got me... vi is a great editor for that, no bells and whistles, no font selection, no point size, no object insertion; either links or photos, etc... vi is perfect.

    I retract my "competent" statement, on the grounds, that, vi is a text editor, whereas, I was comparing it to, a, word processor program. Use what program a task is used for. I use OpenOffice.Org Write for word processing, when I need all of the bells and whistles it has. I use KWrite for script and text file editing, to the point that it "blocks" scripts into format structure. And, finally, I use vi, for "quick and dirty" editting of text files, the kind I just need to get in, edit, and get out, i.e. "no frills" kind of stuff.

    As for a GUI based vi, never tried it, I am not even sure if I have it installed. But, this brings up my "competent" remark though... If vi runs in a GUI, can YOU compare it to, say, OpenOffice.Org Writer and all of its power? OR, is the GUI vi just a GUI of a text editor, still? I tend to fire up vi from a CLI, and when I do, my intent is, to just edit a text file quickly, "get in and out" quickly, thats all. If I wanted to change point sizes, fonts, insert some photos, some links to another file, add color, backgrounds, or, format it for publishing, I would never use vi for it, would you?

    When I ran Windows, and, more specifically, had M$ Word, Publish, Photo Editor, etc... i.e. M$ Office installed, I would do some things with Word, some things with Notepad. In this example, "notepad" is how I use vi, and "M$ Word" is how I use kwrite and OO.Org Write, for. The task at hand dictates what "program", or editor, I use... Not just "what I like to use", but, what the program is used, or, geared to be used, for. Kind of like Knoppix, same thing.

    So, again, I apologise for suggesting that vi isnt "competent", and comparing it to, a word processor program, sorry.
    Ms. Cuddles

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Intel Xeon E5-2699 V4 2.20GHz 55M 22-CORES LGA2011-3 Server Processor 145W SR2JS picture

Intel Xeon E5-2699 V4 2.20GHz 55M 22-CORES LGA2011-3 Server Processor 145W SR2JS

$84.49



Dell EMC PowerEdge R440 Xeon silver 4215 2.5GHz 16 GB ram  2x 550W PSU No HDD picture

Dell EMC PowerEdge R440 Xeon silver 4215 2.5GHz 16 GB ram 2x 550W PSU No HDD

$275.00



Dell Precision T5820 950W Workstation 4.00GHz W-2125 No RAM/ GPU/ HDD/ OS picture

Dell Precision T5820 950W Workstation 4.00GHz W-2125 No RAM/ GPU/ HDD/ OS

$144.98



Dell Precision T5820 Workstation 3.70GHz W-2135 No RAM/ GPU/ HDD/ OS picture

Dell Precision T5820 Workstation 3.70GHz W-2135 No RAM/ GPU/ HDD/ OS

$179.98



Lenovo ThinkStation P520 Intel Xeon W-2123 3.6GHz 900W - NO RAM/ GPU/ HDD/ OS picture

Lenovo ThinkStation P520 Intel Xeon W-2123 3.6GHz 900W - NO RAM/ GPU/ HDD/ OS

$189.98



Intel Xeon Gold 6230 2.1 GHz Processor - SRF8W picture

Intel Xeon Gold 6230 2.1 GHz Processor - SRF8W

$29.00



Intel Xeon W-2255 SRGV8 3.7GHz 10-Core LGA2066 Server CPU Processor picture

Intel Xeon W-2255 SRGV8 3.7GHz 10-Core LGA2066 Server CPU Processor

$199.99



Matched Pair _ Intel Xeon E5-2698 V4 2.2GHz 20-Core Processor CPU LGA2011 SR2JW picture

Matched Pair _ Intel Xeon E5-2698 V4 2.2GHz 20-Core Processor CPU LGA2011 SR2JW

$94.99



DELL Precision T3420 | Xeon 1240v6 | 525GB SSD |16GB RAM |Nvidia GPU |Win11 picture

DELL Precision T3420 | Xeon 1240v6 | 525GB SSD |16GB RAM |Nvidia GPU |Win11

$149.00



Dell T5810 - Intel Xeon E5-1630 V4@3.70GHz 4 Core, 16GB, 233gb SSD picture

Dell T5810 - Intel Xeon E5-1630 [email protected] 4 Core, 16GB, 233gb SSD

$169.99