Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Thanks for joining the list
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  10 messages - 9 new - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Andy Lester  
View profile  
 More options Jun 3 2009, 6:21 pm
From: Andy Lester <a...@petdance.com>
Date: Wed, 3 Jun 2009 17:21:40 -0500
Local: Wed, Jun 3 2009 6:21 pm
Subject: Thanks for joining the list
Wow, 40 subscribers in 18 hours.  Not bad.

What cool stuff are y'all doing with Vim and Perl and how can we get  
the rest of the programmer public to take advantage of those marvelous  
advances you're using?

xoxo,
Andy

--
Andy Lester => a...@petdance.com => www.theworkinggeek.com => AIM:petdance


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Shlomi Fish  
View profile  
 More options Jun 4 2009, 7:55 am
From: Shlomi Fish <shlo...@iglu.org.il>
Date: Thu, 04 Jun 2009 14:55:20 +0300
Local: Thurs, Jun 4 2009 7:55 am
Subject: Re: [vim-perl] Thanks for joining the list
On Thursday 04 June 2009 01:21:40 Andy Lester wrote:

> Wow, 40 subscribers in 18 hours.  Not bad.

> What cool stuff are y'all doing with Vim and Perl and how can we get
> the rest of the programmer public to take advantage of those marvelous
> advances you're using?

Hi!

I'm doing most of my programming (and text editing in general) in Vim, and
that includes Perl programming. Most of the vim functionality I've been using
is programming language-neutral, and I've been blogging about various tips
I've discovered here:

http://community.livejournal.com/shlomif_tech/tag/vim

And previously here:

http://shlomif.livejournal.com/tag/vim

I'm using the perl-support vim plug-in, which has some nice features, but can
also be annoying. For example, when I type "\@" in insert-mode, it insert a
weird "my @..." declaration. Turns out that after typing \ one has to wait a
little before being able to continue because the perl-support bounded that
key. I also did not get used to using the perl-support code generation
feature, and I noticed that in a way, it was not adapted for more serious
code. For example when generating a function it does:

sub func
{
        my ($param1, $param2) = @_;

}

Instead of:

sub mymethod
{
        my ($self, $args) = @_;

}

I created and released a few Vim scripts:

http://www.vim.org/account/profile.php?user_id=499

I no longer use the xmms play and enqueue. The perl-test-manage.vim is now
mostly implemented using Test::Count (and thus I need to release a new version
of it.). range-search.vim is still relevant and I'm still using it.

Regards,

        Shlomi Fish

> xoxo,
> Andy

> --
> Andy Lester => a...@petdance.com => www.theworkinggeek.com => AIM:petdance

--
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
Interview with Ben Collins-Sussman - http://xrl.us/bjn8s

God gave us two eyes and ten fingers so we will type five times as much as we
read.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Danny  
View profile  
 More options Jun 4 2009, 12:28 pm
From: Danny <dekim...@gmail.com>
Date: Thu, 4 Jun 2009 09:28:42 -0700 (PDT)
Local: Thurs, Jun 4 2009 12:28 pm
Subject: Re: Thanks for joining the list
On Jun 4, 7:55 am, Shlomi Fish <shlo...@iglu.org.il> wrote:

> I'm using the perl-support vim plug-in, which has some nice features, but can
> also be annoying. For example, when I type "\@" in insert-mode, it insert a
> weird "my @..." declaration. Turns out that after typing \ one has to wait a
> little before being able to continue because the perl-support bounded that
> key.

I have to admit, that feature has driven me nuts. I remember
attempting to find a setting to disable or change the key it was using
for the trigger but I wasn't able to. I'm sure it is somewhere in
there.

> I also did not get used to using the perl-support code generation
> feature, and I noticed that in a way, it was not adapted for more serious
> code. For example when generating a function it does:

There is a code snippets directory in the ~/.vim folder that should
have the template it uses to generate that code. Should be just a
matter of editing it as you see fit.

Myself, I primarily find tabs and sub folding to be my favorites. I
still haven't found an out-liner window that I like. The tabbing
support was incredibly annoying to get right. As I use PuTTY and I
wanted to sent C-S-TAB and C-TAB as my tabbing keys. PuTTY doesn't
send CTRL key-bindings. That was an interesting endeavour.

As I usually work out of a project's root directory for editing its
files, I commonly have to build/install it to test it (most of the
projects are web-based). For this I use the following map:
"save buffer and build
:inoremap <Esc>b <Esc>:w<CR>:! ([ -e Build.PL ] && ./Build install) \|
\| ([ -e Makefile.PL ] && make install )<CR>i
:nnoremap <Esc>b :w<CR>:! ([ -e Build.PL ] && ./Build install) \|\|
([ -e Makefile.PL ] && make install )<CR>
Saves the buffer, checks if we are using a Build.PL based installer,
install or if we are using Makefile.PL, install using that.

And of course perltidy. Who doesn't like perltidy?
"Tidy block
vnoremap <silent> t :! perltidy -q<CR>
"Tidy entire file
nnoremap <Esc>t :%! perltidy -q<CR>

Those are some of the things that popped into mind, I'm sure theres
others. And probably cooler other things.

--
Danny.

The mind of the believer stagnates. It fails to grow outward into an
unlimited, infinite universe.
 -Frank Herbert


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andy Armstrong  
View profile  
 More options Jun 4 2009, 1:25 pm
From: Andy Armstrong <a...@hexten.net>
Date: Thu, 4 Jun 2009 18:25:00 +0100
Subject: Re: [vim-perl] Thanks for joining the list
On 3 Jun 2009, at 23:21, Andy Lester wrote:

> What cool stuff are y'all doing with Vim and Perl and how can we get
> the rest of the programmer public to take advantage of those marvelous
> advances you're using?

I generally assume that my use of Vim is far from state of the art. I  
don't look over other users' shoulders often enough to pick up juicy  
tips. But here's what I do:

I have my home directory in svn[1] and check it out on MacOS, Linux,  
Solaris, *BSD and Cygwin - so I try to keep my customisations as cross  
platform as possible. If you follow the link to the svn repo below  
you'll notice, for example, that my .gvimrc has all sorts of tweaks so  
that I get the same font size in MacVim and GVim.

I generally run console Vim and usually have multiple windows open in  
Vim[2] so one of my biggest time savers is:

noremap <C-Up>    <esc><C-w>k<C-w>_
noremap <C-Down>  <esc><C-w>j<C-w>_
noremap <C-Left>  <esc><C-w>h<C-w>_
noremap <C-Right> <esc><C-w>l<C-w>_

They bind Ctrl+Left/Right/Up/Down to switch to the window in that  
direction and maximise it.

For every language for which I can find a decent source code  
prettifier I have a binding F2 -> tidy source. For Perl that's  
Perl::Tidy of course. I don't format anything manually if I can help  
it and using languages for which there is no prettifier has become a  
major pain as a result.

I have hooks so that when I create a new .pm file it attempts to guess  
the package name from the path and gives me a boilerplate module with  
the name filled in.

I have F5 bound to this script[3]. If the cursor is in a string  
literal it cycles the quoting between single and double quotes (and  
backwacks any embedded quotes to suit). If the string happens to be a  
valid bareword it also cycles through unquoted - and if the cursor is  
outside a string but on a valid bareword it will be quoted.

So I can

        "foo" => bar # cursor in "foo", F5
         'foo' => bar # F5 again
         foo => bar   # F5 again
         "foo" => bar

I just started playing with that. The philosophy behind it is slightly  
more grandiose than that example suggests. I wanted to have a FIX  
THIS! key which I can hit whenever something doesn't look quite right  
and have it, based on context, cycle through a number of alternative  
representations. For example if the cursor is on 'for' or 'foreach'  
hitting F5 should cycle through those alternatives, Similarly if/
unless, while/until, &&/and, ||/or.

One of the criteria for success will be whether I start instinctively  
stabbing frantically at F5 when confronted with anything I don't like  
- even if it's not written in Perl and has no chance of working :)

There's other stuff - most of which can be gleaned from [1].

Incidentally I suspect my Vim coding style is painfully naive -  
criticism is welcome :)

[1] https://svn.hexten.net/andy/home
[2] http://hexten.net/junk/vim.png
[3] https://svn.hexten.net/andy/home/.vim/include/flipquotes.vim

--
Andy Arms
trong, Hexten


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kiffin Gish  
View profile  
 More options Jun 4 2009, 3:57 pm
From: Kiffin Gish <kiffin.g...@gmail.com>
Date: Thu, 04 Jun 2009 21:57:40 +0200
Local: Thurs, Jun 4 2009 3:57 pm
Subject: Re: [vim-perl] Re: Thanks for joining the list
Excellent stuff, especially the C-arrow bindings!

--
Kiffin Gish <Kiffin.G...@planet.nl>
Gouda, The Netherlands

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Luke Triantafyllidis  
View profile  
 More options Jun 5 2009, 7:14 am
From: Luke Triantafyllidis <ltri...@cpan.org>
Date: Fri, 5 Jun 2009 04:14:07 -0700 (PDT)
Local: Fri, Jun 5 2009 7:14 am
Subject: Re: Thanks for joining the list
I use this key mapping to check the syntax of the current file I'm
editing.

map ,pc <Esc>:! perl -c %<CR>

Would be nice if I could get it to output to a separate buffer, but my
vim script-fu isn't up there yet :)

Cheers,
Luke


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andy Lester  
View profile  
 More options Jun 5 2009, 9:58 am
From: Andy Lester <a...@petdance.com>
Date: Fri, 5 Jun 2009 08:58:19 -0500
Local: Fri, Jun 5 2009 9:58 am
Subject: Re: [vim-perl] Re: Thanks for joining the list

On Jun 5, 2009, at 6:14 AM, Luke Triantafyllidis wrote:

> map ,pc <Esc>:! perl -c %<CR>

> Would be nice if I could get it to output to a separate buffer, but my
> vim script-fu isn't up there yet :)

Why don't you make that a ticket in the tracking system?  Maybe  
someone will take care of it for you.

xoa

--
Andy Lester => a...@petdance.com => www.theworkinggeek.com => AIM:petdance


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Grimes  
View profile  
 More options Jun 5 2009, 11:14 am
From: Mark Grimes <mvgri...@gmail.com>
Date: Fri, 5 Jun 2009 08:14:04 -0700
Local: Fri, Jun 5 2009 11:14 am
Subject: Re: [vim-perl] Re: Thanks for joining the list

On Thu, Jun 4, 2009 at 4:55 AM, Shlomi Fish<shlo...@iglu.org.il> wrote:
> I'm using the perl-support vim plug-in, which has some nice features, but can
> also be annoying. For example, when I type "\@" in insert-mode, it insert a
> weird "my @..." declaration. Turns out that after typing \ one has to wait a

You should be able to unset that mapping by adding the following to
your .vimrc file (or better yet ~/.vim/ftplugin/perl.vim):

  unimap \@

The only potential problem I see is making sure that this is run after
the perl-support plug-in is loaded.

-Mark


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Grimes  
View profile  
 More options Jun 5 2009, 11:07 am
From: Mark Grimes <mvgri...@gmail.com>
Date: Fri, 5 Jun 2009 08:07:51 -0700
Local: Fri, Jun 5 2009 11:07 am
Subject: Re: [vim-perl] Re: Thanks for joining the list

On Fri, Jun 5, 2009 at 4:14 AM, Luke Triantafyllidis<ltri...@cpan.org> wrote:

> I use this key mapping to check the syntax of the current file I'm
> editing.

> map ,pc <Esc>:! perl -c %<CR>

> Would be nice if I could get it to output to a separate buffer, but my
> vim script-fu isn't up there yet :)

I'm not sure how to open the output in another window, but if you set
"perl -c" as your compiler you can use the :make command to check
syntax and then use :cn and :cp to move forward and back to each
error. Here are the key lines from the rc files:

  CompilerSet makeprg=perl\ -Ilib\ -c\ %
  CompilerSet errorformat=
        \%-G%.%#had\ compilation\ errors.,
        \%-G%.%#syntax\ OK,
        \%m\ at\ %f\ line\ %l.,
        \%+A%.%#\ at\ %f\ line\ %l\\,%.%#,
        \%+C%.%#
  compiler perl
  nmap <buffer> ,pc  :w<cr>:make<cr>

I actually use Christian Robinson's perl.vim compiler file which is a
bit more complete (google for "Christian J. Robinson perl.vim" and
save it as ~/.vim/compiler/perl.vim).

-Mark


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Golden  
View profile  
 More options Jun 5 2009, 11:56 am
From: David Golden <xda...@gmail.com>
Date: Fri, 5 Jun 2009 11:56:55 -0400
Local: Fri, Jun 5 2009 11:56 am
Subject: Re: [vim-perl] Re: Thanks for joining the list

On Fri, Jun 5, 2009 at 7:14 AM, Luke Triantafyllidis<ltri...@cpan.org> wrote:
> map ,pc <Esc>:! perl -c %<CR>

For me, I add library paths to it or give options for tainting:

map ,pc :!perl -Mlib=lib -c %<CR>
map ,pcb :!perl -Mblib -c %<CR>
map ,pC :!perl -tc %<CR>

Other perl stuff:

* Running code (why I don't do the same Mlib/Mblib stuff as above, I
don't know.)

map ,pr :!perl %<CR>
map ,pR :!perl -t %<CR>
map ,pd :!perl -d %<CR>

* Run current (.t) file through "Build test"

map ,bt :!perl Build test verbose=1 --test_files=%<CR>

* Various ways to start of a blank file with some boilerplate

map ,pl ggI#!/usr/bin/env perl<CR>use strict;<CR>use warnings;<CR>use
XDG;<CR><ESC>
map ,pmm ggIpackage PACKAGE;<CR>use strict;<CR>use warnings;<CR><ESC>3kw
map ,pb iuse Benchmark qw( cmpthese :hireswallclock );<CR><CR>my
$count = 100_000;<CR>cmpthese( $count, {<CR>'Name1' => sub {

},<CR>});<CR><ESC>

* block add/remove comments
vmap ,ic :s/^/#/g<CR>:let @/ = ""<CR>
vmap ,rc :s/^#//g<CR>:let @/ = ""<CR>
map  ,ic :s/^/#/g<CR>:let @/ = ""<CR>
map  ,rc :s/^#//g<CR>:let @/ = ""<CR>

* increment decrement test count (only on a "plan tests =>" line, though)

map  <silent> ,at m` :silent ?plan tests =><CR>3w<C-A>,/``
map  <silent> ,rt m` :silent ?plan tests =><CR>3w<C-X>,/``


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic