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

Re: Spellchecking pod

Expand Messages
  • Suresh Govindachar
    ... To pipe a section to an external program, see :help filter (not sure if pipeing a section to aspell will help you). ... 1) My perl files have the
    Message 1 of 7 , Mar 13, 2005
      Bill Moseley Sent on 12 Mar 2005 06:44:29 -0800:

      > I have two questions. First, I can spell check an entire
      > file, but I'm not seeing how to pipe a section to aspell
      > and have only that text spell-checked.

      To "pipe a section" to an external program, see :help filter
      (not sure if pipeing a section to aspell will help you).

      > Second, anyone know of a way to spell check just the pod
      > when editing a Perl module?
      >
      > Thanks,
      >
      > BTW -- if you have a favorite an "vim for perl users"1
      > URLs can you post?

      1) My perl files have the following line toward the beginning:
      BEGIN {(*STDERR = *STDOUT) || die;}
      And in the file $VIM/vimfiles/ftplugin/perl.vim, I have
      the line:
      nmap <buffer> <F5> :w<esc>mwG:r!perl %:p<CR>`.

      2) The following is a perl and Word based spell checker for
      Windows:
      http://www.vim.org/scripts/script.php?script_id=1082
      You might modify it to use aspell and work on pods in
      perl.

      3) In regard to vim and perl, searching for "perl" in each
      of scripts and tips sections of www.vim.org might help.

      --Suresh
    • Bill Moseley
      ... Maybe I m not seeing what this is for. Why do you want everything going to stdout? ... My vim skills must not be that good. Are you just running the
      Message 2 of 7 , Mar 14, 2005
        On Sun, Mar 13, 2005 at 09:33:40PM +0000, Suresh Govindachar wrote:
        > 1) My perl files have the following line toward the beginning:
        > BEGIN {(*STDERR = *STDOUT) || die;}

        Maybe I'm not seeing what this is for. Why do you want everything
        going to stdout?

        > And in the file $VIM/vimfiles/ftplugin/perl.vim, I have
        > the line:
        > nmap <buffer> <F5> :w<esc>mwG:r!perl %:p<CR>`.

        My vim skills must not be that good. Are you just running the script
        and reading back the output?

        --
        Bill Moseley
        moseley@...
      • Suresh Govindachar
        ... See below. ... - Since the line is in a ftplugin/perl.vim file, it is activated, more or less, whenever a perl file is being worked on in Vim. - The nmap
        Message 3 of 7 , Mar 14, 2005
          Bill Moseley sent on 14 Mar 2005 12:11:59 -0800:

          > On Sun, Mar 13, 2005 at 09:33:40PM +0000, Suresh Govindachar wrote:
          >> 1) My perl files have the following line toward the
          >> beginning:
          >> BEGIN {(*STDERR = *STDOUT) || die;}
          >
          > Maybe I'm not seeing what this is for. Why do you want
          > everything going to stdout?

          See below.

          >> And in the file $VIM/vimfiles/ftplugin/perl.vim, I
          >> have the line:
          >> nmap <buffer> <F5> :w<esc>mwG:r!perl %:p<CR>`.
          >
          > My vim skills must not be that good. Are you just running
          > the script and reading back the output?

          - Since the line is in a ftplugin/perl.vim file, it is
          activated, more or less, whenever a perl file is being
          worked on in Vim.

          - The nmap line defines what will happen when the F5 key is
          hit while in normal mode; and the <buffer> restricts the
          nmap to perl files

          - :w<esc> results in the file being written
          mw marks the cursor position as w
          G moves the cursor to the bottom of the file (my
          perl files have a __END__ toward the bottom)
          :r! says execute the rest of the stuff as a command
          and put the STDOUT of the command below the
          cursor. I have the "BEGIN {(*STDERR ..." line so
          that any errors get captured too.
          perl calls perl
          %:p full path to the file being edited
          <CR> at this point, output of "perl %:p" will end up
          at the bottom of the file being edited
          `. jump to the starting point of the last edit:
          so the cursor ends up at the begining of the
          output from executing the file

          --Suresh
        • Hari Krishna Dara
          ... highlighting. ... text. ... Dr. Chip, Won t it be useful to support multiselect.vim to help with these cases? The plugin currently supports commands to
          Message 4 of 7 , Mar 14, 2005
            On Sat, 12 Mar 2005 at 5:39pm, drchip@... wrote:

            > Quoting Bill Moseley <moseley@...>:
            >
            > > I have two questions. First, I can spell check an entire file, but
            > > I'm not seeing how to pipe a section to aspell and have only that
            > > text spell-checked.
            > >
            > > Second, anyone know of a way to spell check just the pod when editing
            > > a Perl module?
            >
            > Engspchk doesn't use aspell, instead it uses Vim's native syntax
            highlighting.
            > However, it does support restricted spellchecking of a specific block of
            text.
            > I note that I don't have much on it in the help; I'll have to fix that.
            > Anyway, what you do is (after putting engspchk.vim in your .vim/plugin
            > directory, etc)
            >
            > use a visual mode to select text (V, v, or ctrl-v)
            > \ev (its actually <Leader>ev if you've changed your leader)
            >
            > \eV will turn spell checking back off.
            >
            > Engspchk is available at:
            > http://vim.sourceforge.net/scripts/script.php?script_id=195
            >
            > I'm afraid that I don't know what a Perl pod is.
            >
            > Regards,
            > Chip Campbell
            >
            >
            >

            Dr. Chip,

            Won't it be useful to support multiselect.vim to help with these cases?
            The plugin currently supports commands to create multiple visual
            selections, so if there is a command to select all the pod sections
            automatically, the \ev command could get the list of selections from
            multiselect and repeat what it is doing currently on a single
            visual-selection on all of them. There was no such command to make
            selections to indicate regions, but I just added a command to
            select lines by the syntax group (so you can say select all the lines
            that are identified as pod comments), and I will upload the new version
            soon. This technique can easily be extended to comments in any
            programming language.

            If you are interested, I can help you with the integration, but it is
            really easy (let me know if the documentation is not clear), and you can
            find the usage in my selectbuf.vim plugin.

            Comments are welcome.

            --
            Thank you,
            Hari



            __________________________________
            Do you Yahoo!?
            Yahoo! Small Business - Try our new resources site!
            http://smallbusiness.yahoo.com/resources/
          Your message has been successfully submitted and would be delivered to recipients shortly.