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

How to begin learning vim script?

Expand Messages
  • Neo
    hi, I have used vim for several years but now I want to learn how to write vim script. Is there any document or book I can reference? Thanks, Neo
    Message 1 of 16 , Nov 1, 2007
    • 0 Attachment
      hi,

      I have used vim for several years but now I want to learn how to write
      vim script.

      Is there any document or book I can reference?

      Thanks,
      Neo


      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Tony Mechelynck
      ... Basically, the commands used in Vim scripts are the same commands you type after a colon. However, some of them (like :q!) are more likely to be typed by
      Message 2 of 16 , Nov 1, 2007
      • 0 Attachment
        Neo wrote:
        > hi,
        >
        > I have used vim for several years but now I want to learn how to write
        > vim script.
        >
        > Is there any document or book I can reference?
        >
        > Thanks,
        > Neo

        Basically, the commands used in Vim scripts are the same commands you type
        after a colon. However, some of them (like :q!) are more likely to be typed by
        hand, while others (like :try) are almost only used in scripts.

        You could try

        :help usr_41.txt

        for the theory, or

        :view $VIMRUNTIME/vimrc_example.vim

        for an example.


        Best regards,
        Tony.
        --
        Churchill's Commentary on Man:
        Man will occasionally stumble over the truth, but most of the
        time he will pick himself up and continue on.

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Neo
        On Nov 1, 11:11 pm, Tony Mechelynck ... I really don t think so .... ... --~--~---------~--~----~------------~-------~--~----~
        Message 3 of 16 , Nov 1, 2007
        • 0 Attachment
          On Nov 1, 11:11 pm, Tony Mechelynck <antoine.mechely...@...>
          wrote:
          > Neo wrote:
          > > hi,
          >
          > > I have used vim for several years but now I want to learn how to write
          > > vim script.
          >
          > > Is there any document or book I can reference?
          >
          > > Thanks,
          > > Neo
          >
          > Basically, the commands used in Vim scripts are the same commands you type
          > after a colon. However, some of them (like :q!) are more likely to be typed by
          > hand, while others (like :try) are almost only used in scripts.

          I really don't think so ....

          >
          > You could try
          >
          > :help usr_41.txt
          >
          > for the theory, or
          >
          > :view $VIMRUNTIME/vimrc_example.vim
          >
          > for an example.
          >
          > Best regards,
          > Tony.
          > --
          > Churchill's Commentary on Man:
          > Man will occasionally stumble over the truth, but most of the
          > time he will pick himself up and continue on.


          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Ben Schmidt
          ... You will think so after you ve learnt. :-D Ben. Send instant messages to your online friends http://au.messenger.yahoo.com
          Message 4 of 16 , Nov 1, 2007
          • 0 Attachment
            >>> hi,
            >>> I have used vim for several years but now I want to learn how to write
            >>> vim script.
            >>> Is there any document or book I can reference?
            >>> Thanks,
            >>> Neo
            >> Basically, the commands used in Vim scripts are the same commands you type
            >> after a colon. However, some of them (like :q!) are more likely to be typed by
            >> hand, while others (like :try) are almost only used in scripts.
            >
            > I really don't think so ....

            You will think so after you've learnt. :-D

            Ben.




            Send instant messages to your online friends http://au.messenger.yahoo.com


            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_use" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • Tony Mechelynck
            ... Actually, thinking back on it, there are at least two ex-commands which are totally useless at the keyboard, viz., :loadkeymap and :scriptencoding ; but
            Message 5 of 16 , Nov 1, 2007
            • 0 Attachment
              Ben Schmidt wrote:
              >>>> hi,
              >>>> I have used vim for several years but now I want to learn how to write
              >>>> vim script.
              >>>> Is there any document or book I can reference?
              >>>> Thanks,
              >>>> Neo
              >>> Basically, the commands used in Vim scripts are the same commands you type
              >>> after a colon. However, some of them (like :q!) are more likely to be typed by
              >>> hand, while others (like :try) are almost only used in scripts.
              >> I really don't think so ....
              >
              > You will think so after you've learnt. :-D
              >
              > Ben.

              Actually, thinking back on it, there are at least two ex-commands which are
              totally useless at the keyboard, viz., :loadkeymap and :scriptencoding ; but
              these are special cases, and a beginner can safely leave them for later on:
              there are more important things to learn first.


              Best regards,
              Tony.
              --
              "I like being single. I'm always there when I need me."
              -- Art Leo

              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_use" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            • Brendon Schumacker
              Hi, I m new to this list! I ve used vim for about seven years. may I ask, what is vim script? It sounds as if you are writing scripts that can be executed to
              Message 6 of 16 , Nov 2, 2007
              • 0 Attachment
                Hi, I'm new to this list!
                 
                I've used vim for about seven years.
                may I ask, what is vim script?  It sounds as if you are writing scripts that can be executed to perform jobs... what type of situation is it useful for? can you run it at a command line?
                 
                Thanks,
                Brendon


                 
                2007/11/2, Tony Mechelynck <antoine.mechelynck@...>:

                Ben Schmidt wrote:
                >>>> hi,
                >>>> I have used vim for several years but now I want to learn how to write
                >>>> vim script.
                >>>> Is there any document or book I can reference?
                >>>> Thanks,
                >>>> Neo
                >>> Basically, the commands used in Vim scripts are the same commands you type
                >>> after a colon. However, some of them (like :q!) are more likely to be typed by
                >>> hand, while others (like :try) are almost only used in scripts.
                >> I really don't think so ....
                >
                > You will think so after you've learnt. :-D
                >
                > Ben.

                Actually, thinking back on it, there are at least two ex-commands which are
                totally useless at the keyboard, viz., :loadkeymap and :scriptencoding ; but
                these are special cases, and a beginner can safely leave them for later on:
                there are more important things to learn first.


                Best regards,
                Tony.
                --
                "I like being single.  I'm always there when I need me."
                               -- Art Leo

                --~--~---------~--~----~------------~-------~--~----~
                You received this message from the "vim_use" maillist.
                For more information, visit http://www.vim.org/maillist.php
                -~----------~----~----~----~------~----~------~--~---

              • thomas
                ... I d also suggest to read :help eval.txt on expression evaluation, which summarizes data structures, functions and v: variables.
                Message 7 of 16 , Nov 2, 2007
                • 0 Attachment
                  > :help usr_41.txt

                  I'd also suggest to read :help eval.txt on expression evaluation,
                  which summarizes data structures, functions and v: variables.


                  --~--~---------~--~----~------------~-------~--~----~
                  You received this message from the "vim_use" maillist.
                  For more information, visit http://www.vim.org/maillist.php
                  -~----------~----~----~----~------~----~------~--~---
                • Charles E Campbell Jr
                  ... The vim scripting language is what is used to make plugins, filetype plugins, indenting plugins, colorschemes, syntax highlighting... Anyway, its all vim
                  Message 8 of 16 , Nov 2, 2007
                  • 0 Attachment
                    Brendon Schumacker wrote:

                    > Hi, I'm new to this list!
                    >
                    > I've used vim for about seven years.
                    > may I ask, what is vim script? It sounds as if you are writing
                    > scripts that can be executed to perform jobs... what type of situation
                    > is it useful for? can you run it at a command line?

                    The vim scripting language is what is used to make plugins, filetype
                    plugins, indenting plugins, colorschemes, syntax highlighting...
                    Anyway, its all vim stuff. Nothing to run at a shell's command line
                    (ie. not ksh, bash, sh, csh, tcsh, ...); the commands can be run at
                    vim's "command line" -- ie. use the colon!

                    Regards,
                    Chip Campbell


                    --~--~---------~--~----~------------~-------~--~----~
                    You received this message from the "vim_use" maillist.
                    For more information, visit http://www.vim.org/maillist.php
                    -~----------~----~----~----~------~----~------~--~---
                  • Tony Mechelynck
                    ... Do you have a vimrc (I mean, a $HOME/_vimrc on Windows or a $HOME/.vimrc elsewhere)? If you don t, you should, even if its only contents, at first, are
                    Message 9 of 16 , Nov 2, 2007
                    • 0 Attachment
                      Brendon Schumacker wrote:
                      > Hi, I'm new to this list!
                      >
                      > I've used vim for about seven years.
                      > may I ask, what is vim script? It sounds as if you are writing scripts
                      > that can be executed to perform jobs... what type of situation is it
                      > useful for? can you run it at a command line?
                      >
                      > Thanks,
                      > Brendon

                      Do you have a vimrc (I mean, a $HOME/_vimrc on Windows or a $HOME/.vimrc
                      elsewhere)? If you don't, you should, even if its only contents, at first, are
                      something like:

                      set nocompatible
                      " if we need to change the language, put it here, e.g.:
                      " if has("unix")
                      " language messages C
                      " else
                      " language messages en
                      " endif
                      runtime vimrc_example.vim
                      " add user customizations here

                      If you do have a vimrc, the programming language in which it is written is
                      informally called vimscript. The same language is used for all the *.vim files
                      which come together with Vim.


                      Best regards,
                      Tony.
                      --
                      Bubble Memory, n.:
                      A derogatory term, usually referring to a person's
                      intelligence. See also "vacuum tube".

                      --~--~---------~--~----~------------~-------~--~----~
                      You received this message from the "vim_use" maillist.
                      For more information, visit http://www.vim.org/maillist.php
                      -~----------~----~----~----~------~----~------~--~---
                    • Charles E Campbell Jr
                      ... Here s some info... http://vim.sourceforge.net/docs.php http://iccf-holland.org/click5.html Regards, Chip Campbell
                      Message 10 of 16 , Nov 2, 2007
                      • 0 Attachment
                        Neo wrote:

                        >hi,
                        >
                        >I have used vim for several years but now I want to learn how to write
                        >vim script.
                        >
                        >Is there any document or book I can reference?
                        >
                        >
                        Here's some info...

                        http://vim.sourceforge.net/docs.php
                        http://iccf-holland.org/click5.html

                        Regards,
                        Chip Campbell


                        --~--~---------~--~----~------------~-------~--~----~
                        You received this message from the "vim_use" maillist.
                        For more information, visit http://www.vim.org/maillist.php
                        -~----------~----~----~----~------~----~------~--~---
                      • Neo
                        On Nov 2, 3:27 am, Brendon Schumacker ... I am trying to learn how to write a plugin, which can make my daily coding work much
                        Message 11 of 16 , Nov 2, 2007
                        • 0 Attachment
                          On Nov 2, 3:27 am, "Brendon Schumacker" <brendon.s...@...>
                          wrote:
                          > Hi, I'm new to this list!
                          >
                          > I've used vim for about seven years.
                          > may I ask, what is vim script? It sounds as if you are writing scripts that
                          > can be executed to perform jobs... what type of situation is it useful for?
                          > can you run it at a command line?

                          I am trying to learn how to write a plugin, which can make my daily
                          coding work much easier.

                          For example, I want to do everything inside the editor when I am
                          working on perforce (SCM). Maybe other SCM also.

                          Does that make sense?

                          Thanks,
                          Neo

                          >
                          > Thanks,
                          > Brendon
                          >
                          > 2007/11/2, Tony Mechelynck <antoine.mechely...@...>:
                          >
                          >
                          >
                          > > Ben Schmidt wrote:
                          > > >>>> hi,
                          > > >>>> I have used vim for several years but now I want to learn how to
                          > > write
                          > > >>>> vim script.
                          > > >>>> Is there any document or book I can reference?
                          > > >>>> Thanks,
                          > > >>>> Neo
                          > > >>> Basically, the commands used in Vim scripts are the same commands you
                          > > type
                          > > >>> after a colon. However, some of them (like :q!) are more likely to be
                          > > typed by
                          > > >>> hand, while others (like :try) are almost only used in scripts.
                          > > >> I really don't think so ....
                          >
                          > > > You will think so after you've learnt. :-D
                          >
                          > > > Ben.
                          >
                          > > Actually, thinking back on it, there are at least two ex-commands which
                          > > are
                          > > totally useless at the keyboard, viz., :loadkeymap and :scriptencoding ;
                          > > but
                          > > these are special cases, and a beginner can safely leave them for later
                          > > on:
                          > > there are more important things to learn first.
                          >
                          > > Best regards,
                          > > Tony.
                          > > --
                          > > "I like being single. I'm always there when I need me."
                          > > -- Art Leo


                          --~--~---------~--~----~------------~-------~--~----~
                          You received this message from the "vim_use" maillist.
                          For more information, visit http://www.vim.org/maillist.php
                          -~----------~----~----~----~------~----~------~--~---
                        • Neo
                          On Nov 2, 11:19 am, Charles E Campbell Jr ... Thanks. In fact, that is why I asked here. I really don t know which book or online
                          Message 12 of 16 , Nov 2, 2007
                          • 0 Attachment
                            On Nov 2, 11:19 am, Charles E Campbell Jr <drc...@...>
                            wrote:
                            > Neo wrote:
                            > >hi,
                            >
                            > >I have used vim for several years but now I want to learn how to write
                            > >vim script.
                            >
                            > >Is there any document or book I can reference?
                            >
                            > Here's some info...
                            >
                            > http://vim.sourceforge.net/docs.phphttp://iccf-holland.org/click5.html

                            Thanks. In fact, that is why I asked here. I really don't know which
                            book or online docs is good to learn writing plugins.

                            Neo

                            >
                            > Regards,
                            > Chip Campbell


                            --~--~---------~--~----~------------~-------~--~----~
                            You received this message from the "vim_use" maillist.
                            For more information, visit http://www.vim.org/maillist.php
                            -~----------~----~----~----~------~----~------~--~---
                          • Neo
                            ... Sorry to make the answer so quickly. I took a look at usr_41.txt. It helps a lot. Is there any PDF or book about writing plugins? Thanks, Neo ...
                            Message 13 of 16 , Nov 2, 2007
                            • 0 Attachment
                              On Nov 1, 11:34 pm, Ben Schmidt <mail_ben_schm...@...> wrote:
                              > >>> hi,
                              > >>> I have used vim for several years but now I want to learn how to write
                              > >>> vim script.
                              > >>> Is there any document or book I can reference?
                              > >>> Thanks,
                              > >>> Neo
                              > >> Basically, the commands used in Vim scripts are the same commands you type
                              > >> after a colon. However, some of them (like :q!) are more likely to be typed by
                              > >> hand, while others (like :try) are almost only used in scripts.
                              >
                              > > I really don't think so ....
                              >
                              > You will think so after you've learnt. :-D

                              Sorry to make the answer so quickly. I took a look at usr_41.txt. It
                              helps a lot.

                              Is there any PDF or book about writing plugins?

                              Thanks,
                              Neo

                              >
                              > Ben.
                              >
                              > Send instant messages to your online friendshttp://au.messenger.yahoo.com


                              --~--~---------~--~----~------------~-------~--~----~
                              You received this message from the "vim_use" maillist.
                              For more information, visit http://www.vim.org/maillist.php
                              -~----------~----~----~----~------~----~------~--~---
                            • Gary Johnson
                              ... Yes. I access most of the ClearCase functions I use from within vim. There are already some perforce plugs available at vim.sf.net. Go to the Search page
                              Message 14 of 16 , Nov 2, 2007
                              • 0 Attachment
                                On 2007-11-02, Neo <neojia@...> wrote:
                                > On Nov 2, 3:27 am, "Brendon Schumacker" <brendon.s...@...>
                                > wrote:
                                > > Hi, I'm new to this list!
                                > >
                                > > I've used vim for about seven years.
                                > > may I ask, what is vim script? It sounds as if you are writing scripts that
                                > > can be executed to perform jobs... what type of situation is it useful for?
                                > > can you run it at a command line?
                                >
                                > I am trying to learn how to write a plugin, which can make my daily
                                > coding work much easier.
                                >
                                > For example, I want to do everything inside the editor when I am
                                > working on perforce (SCM). Maybe other SCM also.
                                >
                                > Does that make sense?

                                Yes. I access most of the ClearCase functions I use from within
                                vim. There are already some perforce plugs available at vim.sf.net.
                                Go to the Search page and search Vim Scripts for "perforce".

                                Regards,
                                Gary

                                --~--~---------~--~----~------------~-------~--~----~
                                You received this message from the "vim_use" maillist.
                                For more information, visit http://www.vim.org/maillist.php
                                -~----------~----~----~----~------~----~------~--~---
                              • Tony Mechelynck
                                Neo wrote: [...] ... Everything is in the Vim help. If, like many others, you prefer a paper book to something on a screen, just find the helpfiles which are
                                Message 15 of 16 , Nov 2, 2007
                                • 0 Attachment
                                  Neo wrote:
                                  [...]
                                  > Sorry to make the answer so quickly. I took a look at usr_41.txt. It
                                  > helps a lot.
                                  >
                                  > Is there any PDF or book about writing plugins?
                                  >
                                  > Thanks,
                                  > Neo

                                  Everything is in the Vim help.

                                  If, like many others, you prefer a paper book to something on a screen, just
                                  find the helpfiles which are of interest to you (usr_41.txt and maybe a few
                                  others), and, while viewing each of them, type

                                  :%hardcopy

                                  You may want to first set 'printoptions' 'printfont' 'printheader' etc. to
                                  some sensible values for the printer and paper you're using.

                                  See
                                  :help :hardcopy
                                  :help popt-option
                                  :help pfn-option
                                  :help pheader-option

                                  However, by doing so, you will of course lose the use of the hotlinks from one
                                  help topic to another. Tanstaafl.


                                  Best regards,
                                  Tony.
                                  --
                                  What can you use used tampons for? Tea bags for vampires.

                                  --~--~---------~--~----~------------~-------~--~----~
                                  You received this message from the "vim_use" maillist.
                                  For more information, visit http://www.vim.org/maillist.php
                                  -~----------~----~----~----~------~----~------~--~---
                                • Tony Mechelynck
                                  Neo wrote: [...] ... IMHO, the best (most accurate, most complete and most up-to-date) reference about anything concerning Vim is the Vim help itself. Like the
                                  Message 16 of 16 , Nov 2, 2007
                                  • 0 Attachment
                                    Neo wrote:
                                    [...]
                                    > Thanks. In fact, that is why I asked here. I really don't know which
                                    > book or online docs is good to learn writing plugins.
                                    >
                                    > Neo

                                    IMHO, the best (most accurate, most complete and most up-to-date) reference
                                    about anything concerning Vim is the Vim help itself. Like the rest of your
                                    runtime files, you should keep them up-to-date by periodically syncing some
                                    directory on your hard disk with ftp://ftp.vim.org/pub/vim/runtime/ (where the
                                    helpfiles live in the doc/ subdirectory). On Unix (or on Windows with cygwin),
                                    where you would compile Vim yourself, start at your top directory "for
                                    building" (the parent of src/ runtime/ etc.) then use

                                    rsync -avzcP --delete --exclude="/dos/" ftp.nluug.nl::Vim/runtime/ ./runtime/
                                    2>&1 |tee rsync.log

                                    (all on one line), then, if there is anything other than doc/tags,

                                    make -C src installruntime 2>&1 |tee instrt.log

                                    This is not black magic: the rsync command updates your own runtime/ directory
                                    tree to make it a copy of Bram's master while transferring as little data as
                                    possible (files with the same date & length on both sides are not
                                    transferred), and the "make installruntime", well, installs the runtimes after
                                    they've been updated in the source tree.


                                    Best regards,
                                    Tony.
                                    --
                                    The mosquito is the state bird of New Jersey.
                                    -- Andy Warhol

                                    --~--~---------~--~----~------------~-------~--~----~
                                    You received this message from the "vim_use" maillist.
                                    For more information, visit http://www.vim.org/maillist.php
                                    -~----------~----~----~----~------~----~------~--~---
                                  Your message has been successfully submitted and would be delivered to recipients shortly.