Loading ...
Sorry, an error occurred while loading the content.

Couple of questions

Expand Messages
  • Arafat Mohamed
    I was wondering if I could get a little help.Is there a good tutorial on editing xml files with vim? What I m mostly looking for is syntax highlighting and
    Message 1 of 6 , Jul 30, 2001
    • 0 Attachment
      I was wondering if I could get a little help.

      Is there a good tutorial on editing xml files with vim? What I'm mostly
      looking for is syntax highlighting and smart indentation.

      Also, is there a command to select a whole file (say a c file) and
      automatically indent it? Basically, I'd like to clean up a file someone else
      sent me.

      Thanks,
      Arafat


      _________________________________________________________
      Do You Yahoo!?
      Get your free @... address at http://mail.yahoo.com
    • Jeff Walker
      Don t know about the 1st question, but the second, try this: ggVG= This will: gg - go to the top V - turn on line-wise selection G - selection til the
      Message 2 of 6 , Jul 30, 2001
      • 0 Attachment
        Don't know about the 1st question, but the second, try this:
        ggVG=

        This will:
        gg - go to the top
        V - turn on line-wise selection
        G - selection 'til the bottom (whole file)
        = - reindent the selection, which is the while file.

        If you use the menus in gvim, there is an entry for "select all", you hit
        that button and then hit "=". Same thing.

        --
        Jeff Walker MatchLogic, Inc.
        jwalker@... 7233 Church Ranch Blvd.
        Voice 1 (303) 222-2105 Westminster, CO 80021
        Fax 1 (303) 222-2001 www.matchlogic.com


        -----Original Message-----
        From: Arafat Mohamed [mailto:abmtek@...]
        Sent: Monday, July 30, 2001 8:20 AM
        To: vim@...
        Subject: Couple of questions


        I was wondering if I could get a little help.

        Is there a good tutorial on editing xml files with vim? What I'm mostly
        looking for is syntax highlighting and smart indentation.

        Also, is there a command to select a whole file (say a c file) and
        automatically indent it? Basically, I'd like to clean up a file someone else
        sent me.

        Thanks,
        Arafat


        _________________________________________________________
        Do You Yahoo!?
        Get your free @... address at http://mail.yahoo.com
      • Benji Fisher
        ... I do not know about tutorials, but if you use Vim 6.0 (soon to go beta) then you will get Johannes Zellner s indentation script for XML files. I think Vim
        Message 3 of 6 , Jul 30, 2001
        • 0 Attachment
          Arafat Mohamed wrote:
          >
          > I was wondering if I could get a little help.
          >
          > Is there a good tutorial on editing xml files with vim? What I'm mostly
          > looking for is syntax highlighting and smart indentation.
          >
          > Also, is there a command to select a whole file (say a c file) and
          > automatically indent it? Basically, I'd like to clean up a file someone else
          > sent me.
          >
          > Thanks,
          > Arafat

          I do not know about tutorials, but if you use Vim 6.0 (soon to go beta)
          then you will get Johannes Zellner's indentation script for XML files. I
          think Vim 5.x will also do syntax highlighting. Just make sure that you make
          a vimrc file, so that you do not run in vi-compatible mode. Start with
          vimrc_example.vim .

          HTH --Benji Fisher
        • Lawrence A. Rowe
          ... hi - since i was here during that period i can contribute to the history. the bell labs folks wrote an editor, called ed, which was a line editor. ed
          Message 4 of 6 , Jul 31, 2001
          • 0 Attachment
            Alexey Marinichev wrote:
            >
            > > Actually FreeBSD 3.3's vi implementation (Version 1.79 (10/23/96) The
            > > CSRG, University of California, Berkeley.) gives no errors.... Just to
            > > point that out. How "Original vi" did you want to go? ;)
            >
            > Original vi was written by W. Joy. It existed long before FreeBSD. It
            > was in all unices since at least 1984, according to vi FAQ. I want to
            > go at least that original.
            >
            ---

            hi - since i was here during that period i can contribute to the
            history. the bell labs folks wrote an editor, called ed, which was a
            line editor. ed was/is a very simple editor with insert/delete of lines
            and substitution. Bill added line-oriented editing, essentially visual
            editing on one line, to ed thereby creating ex. shortly thereafter, he
            added full-screen editing and the program was renamed vi. one of the
            most important features of this development was the design of the
            terminal independent full-screen i/o system that eventually was
            extracted from vi by Ken Arnold who created the curses package. all the
            features, including /etc/termcap, were designed and implemented by Bill,
            but Ken made an independent i/o package that was used by pretty much all
            full-screen apps on Unix. the ex/vi developments happened between
            1977-79, long before the BSD activities.

            the first unix releases from berkeley were made by jeff schreibman and
            bob kridle who headed up the instructional technology group within
            eecs. these releases included the pascal compiler and editors produced
            by Bill and other students as well as a collection of utilities and
            other tools needed by folks running an instructional unix system. bob
            once told me the first BSD release that used that name was 2.7 which i
            think was sometime between 78-9.

            the csh was developed in either '78 or '79. bill once told me that csh
            was the program, amongst the ones he developed at berkeley, of which he
            was most proud. turns out it is the only program where he actually wrote
            specifications for the program before he started coding.

            the first vax arrived at berkeley in late 79, and the arpa unix project
            started shortly thereafter. the arpa project, with Bill as the key
            developer, added memory management and the tcp/ip stack to unix. i think
            the arpa project started in 1980 and the first arpa-funded development
            was 4.0 - although i could be mistaken about the version number.

            anyway, those of us who used vi early and learned the key bindings - i
            say "vi bindings are in my fingers" and my students groan - are very
            grateful for vim and all the wonderful enhancements.

            enjoy!
            Larry
            --
            Professor Lawrence A. Rowe Internet: Rowe@...
            Computer Science Division - EECS Phone: 510-642-5117
            University of California, Berkeley Fax: 510-642-5615
            Berkeley, CA 94720-1776 URL: http://bmrc.berkeley.edu/~larry
          • Matthew Winn
            ... An interesting and little-known consequence of this is that running vi from the command line actually runs ex and then does an implicit vi command. This
            Message 5 of 6 , Aug 1, 2001
            • 0 Attachment
              On Tue, Jul 31, 2001 at 10:16:58AM -0700, Lawrence A. Rowe wrote:
              > hi - since i was here during that period i can contribute to the
              > history. the bell labs folks wrote an editor, called ed, which was a
              > line editor. ed was/is a very simple editor with insert/delete of lines
              > and substitution. Bill added line-oriented editing, essentially visual
              > editing on one line, to ed thereby creating ex. shortly thereafter, he
              > added full-screen editing and the program was renamed vi.

              An interesting and little-known consequence of this is that running vi
              from the command line actually runs ex and then does an implicit "vi"
              command. This means that in original versions of vi it's possible
              to use Q to return to ex's line-editing mode and then use ex's undo
              command to undo every change made since entering vi. This feature can
              also be used as a form of savepoint: doing a Qvi<CR> starts a new ex
              "vi" command which can be undone as a whole if you make a serious
              editing mistake later on.

              --
              Matthew Winn (matthew@...)
            • Bram Moolenaar
              ... Hmm, Vim doesn t do this, not even when in compatible mode. I ll add it to the todo list. -- ... /// Bram Moolenaar -- Bram@moolenaar.net --
              Message 6 of 6 , Aug 1, 2001
              • 0 Attachment
                Matthew Winn wrote:

                > An interesting and little-known consequence of this is that running vi
                > from the command line actually runs ex and then does an implicit "vi"
                > command. This means that in original versions of vi it's possible
                > to use Q to return to ex's line-editing mode and then use ex's undo
                > command to undo every change made since entering vi. This feature can
                > also be used as a form of savepoint: doing a Qvi<CR> starts a new ex
                > "vi" command which can be undone as a whole if you make a serious
                > editing mistake later on.

                Hmm, Vim doesn't do this, not even when in compatible mode. I'll add it to
                the todo list.

                --
                From "know your smileys":
                :'-D Laughing so much that they're crying

                /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
                ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim )))
                \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
              Your message has been successfully submitted and would be delivered to recipients shortly.